Return to Jive Software

Skip navigation
3,796 Views 9 Replies Last post: Apr 2, 2009 8:01 AM by mpdrury RSS
alenhard Novice 39 posts since
Nov 22, 2008
Currently Being Moderated

Jan 6, 2009 4:58 AM

Howto Debug with Clearspace, Tomcat, Eclipse

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:

  • create the jar file
  • upload the jar to Clearspace and run it

 

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

whoiskevin Novice 121 posts since
Jul 23, 2007
Currently Being Moderated
Jan 6, 2009 6:17 AM in response to: Alistair Lenhard
Re: Howto Debug with Clearspace, Tomcat, Eclipse

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.

Attachments:
whoiskevin Novice 121 posts since
Jul 23, 2007
Currently Being Moderated
Jan 6, 2009 6:18 AM in response to: whoiskevin
Re: Howto Debug with Clearspace, Tomcat, Eclipse

Oh one note. If you are running Tomcat from within Eclipse you will have to alter this a bit.

whoiskevin Novice 121 posts since
Jul 23, 2007
Currently Being Moderated
Jan 8, 2009 4:49 AM in response to: Alistair Lenhard
Re: Howto Debug with Clearspace, Tomcat, Eclipse

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).

whoiskevin Novice 121 posts since
Jul 23, 2007
Currently Being Moderated
Jan 8, 2009 5:20 AM in response to: Alistair Lenhard
Re: Howto Debug with Clearspace, Tomcat, Eclipse

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.

mpdrury Novice 4 posts since
Feb 11, 2009
Currently Being Moderated
Apr 1, 2009 7:41 AM in response to: Alistair Lenhard
Re: Howto Debug with Clearspace, Tomcat, Eclipse

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?

mpdrury Novice 4 posts since
Feb 11, 2009
Currently Being Moderated
Apr 2, 2009 8:04 AM in response to: mpdrury
Re: Howto Debug with Clearspace, Tomcat, Eclipse

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.

More Like This

  • Retrieving data ...

Bookmarked By (1)

To better serve our customers we have included functionality to automatically follow up on a case after it has been idle for more than 5 days, and then auto close after an additional 3 days of inactivity. Choose No to acknowledge that this case will remain idle for longer than 5 days.
Making cases public allows other customers to learn from the solution of the case. It can also be used to gain feedback from others in the community. Ask our Support Engineers for more info, but we encourage you to make your cases public.