cancel
Showing results for 
Search instead for 
Did you mean: 

What is the easiest way to debug my Nuxeo plugin?

Klyff_Harlley
Champ on-the-rise
Champ on-the-rise

We are working as primates to deploy and test the new features of our plugins for Nuxeo DM (customizing the default JSF Web UI).

We are developing totaly off-line the Nuxeo OSGi maven plugin. Coding into the IDE the xhtml pages and Seam beans, contribs, etc... after compilation, copy the plugin JAR to Nuxeo plugin folder...

Run Nuxeo and navigate... and just wait for the Exceptions to be thrown in the log to find the developer mistakes, also poluting the code with many Log.Debug to test steps of methods, var values, actions result, etc...

If we are working with JSF, Seam, etc... it should be a dream to debug, deploy, start, stop the Nuxeo (e.g. Tomcat package) as a IDE Server, e.g. Eclipse... just compile and clean the project and click PLAY/DEBUG button... some night I catch my self dreaming that I can debug my Seam inside Eclipse and seeing the Breakpoints in debug perspective....

Is it possible? What is the way to have a develop environment like this?

1 ACCEPTED ANSWER

Nelson_Silva
Confirmed Champ
Confirmed Champ

You can use remote socket debugging.

Just look for it in nuxeo.conf and uncomment

JAVA_OPTS=$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n

Start Nuxeo and from Eclipse create a new debugger profile in menu Run > Debug create a new Remote Java Application profile and set the source to the filesystem directory that host your complete Eclipse workspace and set the port to 8787.

I've been using this with IDEA and it works great. Personally I prefer to just symlink my jars to the bundles directory so I just have to do a mvn package and restart Nuxeo (if you're using Windows you have mklink)

Also, you can hot-reload your JSF-Seam layer (seam components and xhtml files) just look here: How to do incremental deployment (hot reload) in the JSF-Seam layer

View answer in original post

6 REPLIES 6

Nelson_Silva
Confirmed Champ
Confirmed Champ

You can use remote socket debugging.

Just look for it in nuxeo.conf and uncomment

JAVA_OPTS=$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n

Start Nuxeo and from Eclipse create a new debugger profile in menu Run > Debug create a new Remote Java Application profile and set the source to the filesystem directory that host your complete Eclipse workspace and set the port to 8787.

I've been using this with IDEA and it works great. Personally I prefer to just symlink my jars to the bundles directory so I just have to do a mvn package and restart Nuxeo (if you're using Windows you have mklink)

Also, you can hot-reload your JSF-Seam layer (seam components and xhtml files) just look here: How to do incremental deployment (hot reload) in the JSF-Seam layer

Hi Nelson!!!

Thanks a lot!

Does not work for me, it always fail with this error "Failed to connect to remote VM. Connection refused.

Florent_Guillau
World-Class Innovator
World-Class Innovator

In addition, keep in mind that when you have an IDE with a debugger attached to your project through JPDA like described above for Eclipse or IDEA, you can make non-structural modifications to your code in the IDE, save the file, and have the changes reflected immediately in the running code.

This applies for any code modification that does not involve class changes (new fields or new methods), or method signature changes (changed parameters). It won't work either on classes that have been instrumented by things like Hibernate, Seam or EJBs. But it's valid for the rest.

This is extremely useful and we use it all the time.

geekonspace
Star Contributor
Star Contributor

Hi, I have nuxeo 5.5 on virtualbox and windows 7, I try debug my plugin following these steps

  • Open the nuxeo.conf file, by default is here $TOMCAT_HOME/bin/nuxeo.conf or /etc/nuxeo.conf
  • Uncomment the following line: #JAVA_OPTS=$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
  • start your server

but when I try to start my server this error is showed on screen: alt text

I commented this line again but the error persist what can I do?

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.