Step 1
Download the Netbeans IDE for java development. (47mb SE version should be fine!)
Step 2
Install and open Netbeans. Create a project from existing java source pointing to where your extensions are. Should be placed in src subfolder to be nice.
(I for sure could not make it work if the source was not in a subfolder)
Right click on project and choose properties->libraries. Add all jar files from your smartfox installation lib dir.
Step 3
Goto Files tab. Expand nbbuild.xml. Click on -post-compile target.
Copy and paste the following code: (Note: adjust todir to point to your smartfox program extension directory)
<copy todir="C:\Programmer\SmartFoxServerPRO_1.6.6\Server\javaExtensions">
<fileset dir="${build.dir}/classes/"/>
</copy>
Step 4
Create a new batchfile called SmartFoxDebug?.bat
Copy and paste the following content into it: (Again adjust to your installation directory)
C:\Programmer\SmartFoxServerPRO_1.6.6\Server\wrapper.exe -c "C:\Programmer\SmartFoxServerPRO_1.6.6\Server\conf\wrapper.conf"
Step 5
Add the following lines to your wrapper.conf
Code: Select all
# runtimedebug
wrapper.java.additional.3=-Xdebug
wrapper.java.additional.4=-Xnoagent
wrapper.java.additional.5=-Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n
Step 6
Choose Run->Build main project (F11) in Netbeans.
If build is ok, click the batch file. Now select debug->attach debugger and choose port 8888. Debugger console should say "User program running".
Now you can place breakpoints and trigger your extensions normally.
NOTE: Just a quick 5 minute job. You can autolaunch smartfox and whatnot given some more effort