Possible to debug at runtime?
Possible to debug at runtime?
Im no java pro but i'd like to lern.
Is there any way to debug my java extensions in runtime? Like setting debugstops in eclipse and se all values?
Just like you do in flash.
Is there any way to debug my java extensions in runtime? Like setting debugstops in eclipse and se all values?
Just like you do in flash.
Nisse Bergman
Raketspel
Raketspel
In order to debug in eclipse you should be able to run the extension directly in the IDE. It's not possible to debug the extension while running in the server but you could add a main() method to the extension and run it as a standalone java app to do some testing and debugging.
Another effective way to test the extension is using JUnit --> http://www.junit.org/index.htm
Another effective way to test the extension is using JUnit --> http://www.junit.org/index.htm
has anybody done this successfully? I have been working on a server extension in java (programming in eclipse, building and copying to remote server over and over) and remote or local debugging would be very helpful.Lapo wrote:In order to debug in eclipse you should be able to run the extension directly in the IDE. It's not possible to debug the extension while running in the server but you could add a main() method to the extension and run it as a standalone java app to do some testing and debugging.
I havent but if someone have please let me know how to do it.zood wrote:has anybody done this successfully?
I have now written all my code in AS2 but for performance purposes id like to convert the code to JAVA. For that it would be great to "runtime" debug the extensions. Its a hell compiling and copying files to the server all the time.
B.T.W and O.T.
When researching for the convertion to JAVA I saw that the JAVA SS-API has a lot more properties and functions than the flash SS-API. I find this a bit strange but i like it
Nisse Bergman
Raketspel
Raketspel
I figured this out shortly after posting. It turns out it IS possible to do some remote debugging of java extensions.
I loosely followed the instructions in this tutorial:
http://www.onjava.com/pub/a/onjava/2005 ... tml?page=1
however in this case, obviously we are using smartfoxserver and not jboss. OK!
find the wrapper.conf file in your server/conf directory and open it in an editor. find this line:
and add these lines directly below:
now if you follow the rest of the tutorial, you should be able to attach eclipse to your smartfoxserver and debug your extension. using this technique I was able to set breakpoints and inspect variables, etc... when you are not debugging you should probably disable these lines with the "#" character at the beginning.
HTH
I loosely followed the instructions in this tutorial:
http://www.onjava.com/pub/a/onjava/2005 ... tml?page=1
however in this case, obviously we are using smartfoxserver and not jboss. OK!
find the wrapper.conf file in your server/conf directory and open it in an editor. find this line:
Code: Select all
wrapper.java.additional.3=-Djava.util.logging.config.file=logging.propertiesCode: Select all
wrapper.java.additional.4=-Xdebug
wrapper.java.additional.5=-Xnoagent
wrapper.java.additional.6=-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=nHTH
Thanks Zood,
very useful tip
I have experimented with automating this using Python and it's also very effective, I did a simple script that monitors my build folder and transfers all the changes to the SFS machine as soon as a class file is modified.
very useful tip
You guys can relieve the pain using Ant which usually comes embedded with Eclipse. With Ant you can automate the entire process of copying the files from your dev environment to your remote server, wheter it's another machine in the LAN or through FTP etc...For that it would be great to "runtime" debug the extensions. Its a hell compiling and copying files to the server all the time.
I have experimented with automating this using Python and it's also very effective, I did a simple script that monitors my build folder and transfers all the changes to the SFS machine as soon as a class file is modified.
I've been trying to get this to work but i can't. Anyone got a better turorial on how to do this? It would be great to debu my extensions and put breakpoints and stuff.zood wrote:I figured this out shortly after posting. It turns out it IS possible to do some remote debugging of java extensions.
Nisse Bergman
Raketspel
Raketspel