Sorry upfront- I am a total newbie, but I like Clearspace a lot and would like to use this in my student project.
Can anyone give me a "simple" / step by step explanation on how I would be able to debug a plugin that has been developed with eclipse for Clearspace 2.4 Currently I only have the ability to:
Aim:
I would like to be able to see the stacktrace, and to set breakpoints from within Eclipse.
Current Configuration:
I am using Tomcat 6
Mysql 5
Clearspace 2.5.4. My plugin is a simple helloworld plugin from this site implemented in Eclipse 3.4
I saw some entries here in the forum, but up to now nothing really worked for me- most of the entries referred to older software version which btw I also tried.
Maybe someone can give me a hint?
Thx,
Alistair
It is actually not difficult. I'm not going to give you step by step here (time contraints ;-) but these are the basics.
Deploy your plugin as normal. But start Tomcat in debug mode. If you are starting it with the standard batch or shell script then simply add the "jpda start" arguments to the command. For example in the bin directory of Tomcat "startup jpda start".
That will start the Tomcat with the default debug settings which means port 8000.
Then in Eclipse with your plugin project selected you can create a debug configuration. Select the Run Menu and Debug Configurations. On that page you can create a new debug configuration (attached a snap shot of the screen). Name it and specify your project and check that it is set to localhost and port 8000. Then save that and at the bottom right choose the "debug" button.
Eclipse will switch to debug perspective. You can open a source file in your plugin and set a breakpoint. Hit a page in your browser for Clearspace and if your plugin runs on that page Eclipse will stop on the code line. Start debugging.
On future restarts (deploying your plugin) you can select your debug configuration from the run debug history menu.
Oh one note. If you are running Tomcat from within Eclipse you will have to alter this a bit.
Hello whoiskevin,
I think this was a helpful start - thank you!
However it seems like I still have some way to go on this one.
So here is how far I got:
- I uploaded the Clearspace.war as you specified to the Tomcat environment and configured it.
- I use tomcat 6 with windows installation on a windows vista machine (this may add a bit to the issue) as I am not configuring with the startup script
- So my configuration looks like this:
My entry in eclipse looks like this:
When I now push the Debug button I receive the message:

I believe this is not what this is supposed to be looking like?
What can I do to correct this and get this running? I do not feel very comfortable working on a project without debugging option.
Thanks,
Alistair
Well those startup settings seem correct so I'm not really sure what the issue might be right now. Check the Tomcat log files (stop Tomcat, clear the /logs directory under Tomcat then start it back up). In the log files (catalinia.log) you should be able to determine whether or not Tomcat started with the JPDA debug.
Also, you can stop the tomcat service and go to the Tomcat directory from the command line. Go to the bin directory and execute "catalina start jpda" . Then try to attach. Just to make sure that it is starting properly.
If none of that reveals anything you might also check whether the Vista firewall is blocking that port (shouldn't be an issue since everything in local but I would check anyway).
The windows installer version for tomcat does not have the catalina.bat file.
I checked the log file (see attached) and it does not seem to start on port 8000 - the only ports mentioned are 8009 and 8080. So maybe I should use the zip distribution for tomcat after all?
I will try and post again.
(Firewall is free for these ports.)
Alistair
Definitely go with the zip file version. It is just too easy anyway. Unzip and head to that directory. The other advantage is that you can run multiple versions of Tomcat on your machine when needed for upgrades and debugging purposes.
Hi,
yes this helped. Debugging works now.
SET JAVA_OPTS=-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true -Xmx512m -Dlog.debug.enabled=true
SET JPDA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y
CD "C:\Program Files\Apache Software Foundation\apache-tomcat-6.0.18"
CALL bin\catalina.bat jpda start
Was never that happy to see an excpetion stack before, that relates to my source code ;-)
I now will learn howto work with this. As this is only afirst step to comfort... but a good one. i.e. it may be good to have the trace in the eclipse console and also to check how breakpoints will work. But so far problem solved.
Thx.
Alistair
I had success with the ZIp file for 2.5.7 and the "jpda" setting as described.
I am now working with SBS 3.0. There is no zip version, just the windows install. I am not having any luck trying to force "jpda" into that environment.
Anybody know of any "internal" setting within Tomcat to force it to always launch in 'remote debug' mode?
Through a lot of trial-and-error I stumbled upon somthing that appears to work for me. I can't say this is a good technique, but since I have it working (for now), I wanted to share.
In the directory C:\Program Files\Jive SBS Employee 3.0\bin I found a file sbs_employee-server.vmoptions. I added the following as the first line to that file:
-agentlib:jdwp=transport=dt_socket,address=localhost:8000,server=y,suspend=n
So now my file looks like:
-agentlib:jdwp=transport=dt_socket,address=localhost:8000,server=y,suspend=n
-Xmx600m
-XX:MaxPermSize=256m
-Djava.awt.headless=true
-server
-Djava.endorsed.dirs=../jre
-Djava.io.tmpdir=../var/temp
-Dhttp.port=8080
-Dserver.port=80801
-Dcatalina.base=../tomcat
-Dcatalina.home=../tomcat
-Djive.home=../
-Djive.context=/
-Djive.application=../../applications/sbs
-Djive.work=../var/temp
-Djive.instance.home=../var/home
-Djive.setup.local.database.port=15432
-Djive.app.cache.ttl=10000
-Djive.app.cache.size=10240
-Djive.ws.enabled=false
I hope this helps somebody.
Jive combines collaboration software, community software & social networking software into the leading SBS solution.
© Copyright 2000–2009 Jive Software. All rights reserved.
915 SW Stark St., Suite 400, Portland, OR 97205