how to Debug Server Side with Eclipse on Mac

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Posts: 120
Joined: 20 Feb 2011, 12:54

how to Debug Server Side with Eclipse on Mac

Postby BonyYousuf » 11 Apr 2011, 06:52

I know if i ask this question you will forward me to the old smartfox 1.x debug setup page ( viewtopic.php?t=1872 ). But a lot of things are different here on 2x. And i am a noob on this. So please help me out thoroughly.

Tell me When i am wrong

1) there is no .sh file on Mac. So i am guessing "sfs2x-service" under the "SFS2X" folder is the .sh file
2) so with terminal if i do ./sfs2x-service start it runs the server perfectly
3) I dont know how java switch works. But i am guessing i need to add those line found at ... 4856#36030 at the end of sfs2x-service on my mac's terminal. Like this :

Code: Select all

./sfs2x-service start @java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend= -cp "./;lib/*;lib/Jetty/*;extensions/__lib__/*" -Dfile.encoding=UTF-8 com.smartfoxserver.v2.Main $1 $2 $3

4) Question: what is the address=8787 here? my addressbar on browser shows 8080 but sfsserver login port is 9933. So which address should i use?? address=9933 or address=8080 or address=8787?

5) the above code runs my server perfectly. But What port should i use on "Remote Java Application". The same address i used to run the server, right?? interestingly if i run both server and eclipse port 8787 or with 9933 i get VM connection refuse error. However if use port 8080 with both then i get VM connection timed out error on Eclipse.

Now can anyone please tell me what i did was wrong.

Note: i am using RC1a

Posts: 77
Joined: 16 Sep 2010, 17:58

Postby Democre » 11 Apr 2011, 22:39

I would "Show package contents" of and edit Content/Resources/script to add the jvm -X options mentioned in your first link. I do not know if this changes it also for the service (I suspect it does), I only ever run the standalone on my mac.

The port that you use in the address parameter of

Code: Select all


is the port that the java debugger will attach to, and pass all debug messages through. It is completely unrelated to whatever ports your java application opens up.

You can change the "suspend=n" to "suspend=y" if you want the application to suspend until a debugger is attached.

The finished line would look something like:

Code: Select all

java -cp  "./:build/:lib/*:lib/Jetty/*:extensions/__lib__/*" -Dfile.encoding=UTF-8 -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n com.smartfoxserver.v2.Main $1 $2
Posts: 120
Joined: 20 Feb 2011, 12:54

Postby BonyYousuf » 15 Apr 2011, 16:00

thanks dude, you are a life saver...

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 9 guests