[TUTORIAL] Debug Smartfox at runtime

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

User avatar
potmo
Posts: 154
Joined: 02 Feb 2007, 14:28
Location: Stockholm Sweden
Contact:

Postby potmo » 10 Apr 2008, 06:20

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.
Nisse Bergman
Raketspel
Zak
Posts: 13
Joined: 04 Mar 2008, 07:41
Location: Las Vegas
Contact:

Postby Zak » 10 Apr 2008, 09:14

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. :)
Zak
Posts: 13
Joined: 04 Mar 2008, 07:41
Location: Las Vegas
Contact:

Postby Zak » 19 Apr 2008, 19:12

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. :)
samirn
Posts: 11
Joined: 09 Sep 2008, 23:56

Any luck with the interactive python debugging?

Postby samirn » 10 Sep 2008, 00:03

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!
ffratoni
Posts: 10
Joined: 15 Sep 2008, 13:45

debugging

Postby ffratoni » 16 Sep 2008, 14:18

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
cangelo
Posts: 25
Joined: 15 Feb 2007, 17:54

Postby cangelo » 29 Oct 2008, 18:11

Wow!!! Thank you. Thank you. Thank you!!!!

I had no clue that I could access this information so easily!!!
jah2488
Posts: 19
Joined: 05 May 2009, 04:06
Contact:

Postby jah2488 » 31 May 2009, 16:25

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.
Sic Transit Gloria Mundi
starzero
Posts: 28
Joined: 19 Jun 2009, 18:41

Postby starzero » 29 Jul 2009, 18:57

just wanted to say thanks to the original poster. this works beautifully with suspend=y and attaching the debugger! :-)
User avatar
jpardoe
Posts: 132
Joined: 31 Aug 2009, 20:54

Postby jpardoe » 03 Sep 2009, 18:20

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?
starzero
Posts: 28
Joined: 19 Jun 2009, 18:41

Postby starzero » 03 Sep 2009, 18:25

you should be able to start the server using the start.bat or wrapper.exe file from the cli
ffourcad
Posts: 130
Joined: 25 Feb 2010, 10:26

Postby ffourcad » 04 Jun 2010, 12:56

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 ?
corwin
Posts: 77
Joined: 17 Jul 2009, 08:19

Postby corwin » 04 Jun 2010, 14:56

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? :)
HumanPoweredGames
Posts: 71
Joined: 19 Oct 2011, 16:40
Location: Alaska
Contact:

Postby HumanPoweredGames » 04 Nov 2011, 17:41

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!
hoanghuybao
Posts: 35
Joined: 22 Aug 2015, 16:20

Re: [TUTORIAL] Debug Smartfox at runtime

Postby hoanghuybao » 03 Sep 2015, 07:02

Hi all,

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

Thanks,
Thong Le
User avatar
Lapo
Site Admin
Posts: 21276
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: [TUTORIAL] Debug Smartfox at runtime

Postby Lapo » 03 Sep 2015, 07:18

Hi,
no, SmartFoxServer is not an open source project.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 8 guests