[GeoNetwork-devel] How to debug java code, in Eclipse ?

Hi list,

A while ago, François told me, but I don’t remember. Can someone remember me how I could use debug mode, while running jetty in eclipse ?

I’ve tried running jetty:run in debug mode, but it won’t stop to my breakpoints.

I’m working on the 2.10.3 branch. Using Eclipse 4.2 and maven 3 using m2e eclipse plugin.

Thanks !

Jean

Hi,

You could run
export MAVEN_OPTS=“-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005”

before you run jetty:run.
This will put debug port of your maven on 5005.

Then in eclipse, go in debug configuration, add a new “remote java application”, and specify the port 5005

···

On Thu, Apr 24, 2014 at 10:53 AM, Jean Pommier (IGE) <jean.pommier@anonymised.com> wrote:

Hi list,

A while ago, François told me, but I don’t remember. Can someone remember me how I could use debug mode, while running jetty in eclipse ?

I’ve tried running jetty:run in debug mode, but it won’t stop to my breakpoints.

I’m working on the 2.10.3 branch. Using Eclipse 4.2 and maven 3 using m2e eclipse plugin.

Thanks !

Jean


Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork


Florent Gravin
Camptocamp - Chambéry
0479444492

On Thu, Apr 24, 2014 at 10:53 AM, Jean Pommier (IGE) <jean.pommier@anonymised.com.>wrote:

Hi list,

A while ago, François told me, but I don't remember. Can someone remember
me how I could use debug mode, while running jetty in eclipse ?
I've tried running jetty:run in debug mode, but it won't stop to my
breakpoints.

I'm working on the 2.10.3 branch. Using Eclipse 4.2 and maven 3 using m2e
eclipse plugin.
Thanks !

Jean

Hi Jean,

I don't use jetty inside eclipse, but tomcat. Just configure a normal
tomcat server in eclipse (as most tutorials show) and then add the web
project as a web application.

Sometimes, eclipse will have problems detecting that the web project is a
"web" project because the folder webapp has java files and that confuses
eclipse. What I do to override this is to remove (temporarily) the
webapp/classes folder, then right click on the project to run "Maven ->
Update Project" and, after it finishes, add again the webapp/classes
folder.

Regards,
María.

Hi,

Fast reply indeed !
Thanks for your answers, Florent & Maria. I'll try Florent's way, as I'm
working, for now, with jetty.
I've just tested it and it works fine.

However, I'd be glad to discuss the pro and cons of each way when we meet
(Bolsena)
Cheers and thanks again

Jean

2014-04-24 10:58 GMT+02:00 Florent Gravin <florent.gravin@anonymised.com>:

Hi,

You could run
export MAVEN_OPTS="-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"

before you run jetty:run.
This will put debug port of your maven on 5005.

Then in eclipse, go in debug configuration, add a new "remote java
application", and specify the port 5005

On Thu, Apr 24, 2014 at 10:53 AM, Jean Pommier (IGE) <jean.pommier@anonymised.com...>wrote:

Hi list,

A while ago, François told me, but I don't remember. Can someone remember
me how I could use debug mode, while running jetty in eclipse ?
I've tried running jetty:run in debug mode, but it won't stop to my
breakpoints.

I'm working on the 2.10.3 branch. Using Eclipse 4.2 and maven 3 using m2e
eclipse plugin.
Thanks !

Jean

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--
Florent Gravin
Camptocamp - Chambéry
0479444492