Page 2 of 3

Posted: 10 Apr 2008, 06:20
by potmo
that looks just like my project where I can debug with breakpoints.
Do you start the server from inside eclipse? Cos you shouldnt, you should only hook on eclipse to an already running server.
I havent got a clue on why that dont work.

A coworker have found a new way of debugging and that is actually running all of smartfox in Eclipse. Then you will get all output to the eclipse prompt.
Its like you would have developed the server and run it inside eclipse (but you dont get any source from the it.gotoandplay-classes). I will make a new tutorial on that when I have some spare time.

Posted: 10 Apr 2008, 09:14
by Zak
I have tried both starting the server from eclipse and also connecting to the server while it is already running.

The project type in eclipse is a "pydev" project, and pydev "perspective" since I am using python, if that makes any difference. I have tried setting it as both types python 2.3-2.5, and Jython, but still getting the same result.


Yes, running sfs inside of eclipse would be great. Anything that could get remote debugging to work for me would be great. Please post that up when you have time. Thank you for your help.

If anybody else has any suggestions, or is using python in eclipse themselves, I would appreciate it. :)

Posted: 19 Apr 2008, 19:12
by Zak
So any update?

Has anybody been able to get debugging to work with python extensions? Please post back if so. I'd kill for the ability to step through code on my extensions, it would certainly save me a lot of time now and in the future.

This would also certainly help out any other python extension developers TREMENDOUSLY. :)

Any luck with the interactive python debugging?

Posted: 10 Sep 2008, 00:03
by samirn
Zak,

Did you ever figure anything out with this? I'm trying to decide to proceed in Python or Java. I'd much prefer Python for speed of development, but having an interactive debugger is key. Let me know if you had any luck

Thanks!

debugging

Posted: 16 Sep 2008, 14:18
by ffratoni
I'm able to debug
with the following wrapper config
wrapper.java.additional.3=-Xdebug
wrapper.java.additional.4=-Xnoagent
wrapper.java.additional.5=-Xrunjdwp:transport=dt_socket,address=9797,server=y,suspend=y

Initializations happen only after debugging session is started from eclipse

Posted: 29 Oct 2008, 18:11
by cangelo
Wow!!! Thank you. Thank you. Thank you!!!!

I had no clue that I could access this information so easily!!!

Posted: 31 May 2009, 16:25
by jah2488
hrmm i've been using Eclipse for all my editing thus far (Actually i'm using Flex Builder 3, but its the same thing)

and I have just added the entire Java library so i can edit my SSEs in Flex as well, but I am having a lot of trouble trying to add the actual java source files for Flex into my document path for trouble shooting.

Posted: 29 Jul 2009, 18:57
by starzero
just wanted to say thanks to the original poster. this works beautifully with suspend=y and attaching the debugger! :-)

Posted: 03 Sep 2009, 18:20
by jpardoe
Unfortunately I am unable to run the server as a service, because it is running on Vista 64bit.

I was wondering if there is a way to enable debugging when launching the server from command prompt?

Posted: 03 Sep 2009, 18:25
by starzero
you should be able to start the server using the start.bat or wrapper.exe file from the cli

Posted: 04 Jun 2010, 12:56
by ffourcad
Hello everybody,

I'm trying your excellent solution to debug my smartfox extension, but when I'm using the debugger, I have a NoClassDefFoundError, which I have not when launching smartfox without debugging.
I am using OpenSpace, and it's precisely the OpenSpaceExtension class which is not found. I don't know why.
Can somebody help me ?

Posted: 04 Jun 2010, 14:56
by corwin
I managed to connect and add breakpoints to my ext (mac os x machine), but can't get System.out.println messages at the console. Somebody with any hints? :)

Posted: 04 Nov 2011, 17:41
by HumanPoweredGames
I've been trying to get this to work, and managed to break my smartfox server. It starts up listening only on 8787, the debugger port, but does not write to the log or anything.

I am looking for the file that contains the config options for remote debugging, as I can't run the admin tool. Does anyone know where the JVM debug options are stored?

edit:

found it: sfs2x-service.vmoptions

edit:

I'm now getting this in the console when I connect the debugger:

Exception in thread "main" java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/HierarchicalStreamDriver
at com.smartfoxserver.v2.SmartFoxServer.<init>(SmartFoxServer.java:141)
at com.smartfoxserver.v2.SmartFoxServer.getInstance(SmartFoxServer.java:133)
at com.smartfoxserver.v2.Main.main(Main.java:24)
Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.io.HierarchicalStreamDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 3 more

edit:

That error doesn't seem to prevent me from debugging. My problem was I hadn't selected my extension from the debug window.

Is working for me now, with my server on a remote Linux box. Very nice!

Re: [TUTORIAL] Debug Smartfox at runtime

Posted: 03 Sep 2015, 07:02
by hoanghuybao
Hi all,

How to add source code smartfoxserver to debug code? Is the source code server public?

Thanks,
Thong Le

Re: [TUTORIAL] Debug Smartfox at runtime

Posted: 03 Sep 2015, 07:18
by Lapo
Hi,
no, SmartFoxServer is not an open source project.

Cheers