Hi all,
till now I was happy with editing sources in eclipse and actually running it outside using Jetty, since I was able to run from the source without deploying.
But now I need to debug java code. If I right click on geonetwork-main, I don’t get the option “Run on Server…” as with any dynamic web project in eclipse.
It looks I need to add ‘Dynamic Web Module’ option in Properties → Project facets, to be able to run geonetwork-main on tomcat. But following error is preventing it to be added:
On Fri, Apr 25, 2014 at 7:30 AM, Ameet Chaudhari
<ameet.chaudhari@anonymised.com>wrote:
Hi all,
till now I was happy with editing sources in eclipse and actually running
it outside using Jetty, since I was able to run from the source without
deploying.
But now I need to debug java code. If I right click on geonetwork-main, I
don't get the option "Run on Server..." as with any dynamic web project in
eclipse.
It looks I need to add 'Dynamic Web Module' option in Properties ->
Project facets, to be able to run geonetwork-main on tomcat. But following
error is preventing it to be added:
What a coincidence! Yesterday I posted another mail about how to do this.
It's very easy:
* Move the webapp/classes folder to another location outside the project
* Right click on the project to run "Maven -> Update Project"
* Restore the webapp/classes folder
Sometimes it still shows some errors when adding again the webapp/classes
folder, but they don't break the build or the run. If you need to update
maven project again (when adding new dependencies, for example), you will
have to do the same steps again.
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
Hi all,
till now I was happy with editing sources in eclipse and actually running it outside using Jetty, since I was able to run from the source without deploying.
But now I need to debug java code. If I right click on geonetwork-main, I don’t get the option “Run on Server…” as with any dynamic web project in eclipse.
It looks I need to add ‘Dynamic Web Module’ option in Properties → Project facets, to be able to run geonetwork-main on tomcat. But following error is preventing it to be added:
What a coincidence! Yesterday I posted another mail about how to do this. It’s very easy:
Move the webapp/classes folder to another location outside the project
Right click on the project to run “Maven → Update Project”
Restore the webapp/classes folder
Sometimes it still shows some errors when adding again the webapp/classes folder, but they don’t break the build or the run. If you need to update maven project again (when adding new dependencies, for example), you will have to do the same steps again.
Hey thanks to both of you, incidentally I came up with third solution by the time I saw your messages. That was to just comment out the following code in pom.xml and then import in eclipse:
With this, I could run geonetwork-main in Tomcat in Eclipse without manually adding dynamic web module facet. But then another issue came since I was redirecting to widgets tab UI. Tomcat could not find /geonetwork/apps/tabsearch… I copied the apps folder in web-client to web module and it finally worked!
This solution does not impress as everytime I’ll have to update client files back in their correct location and remove copied apps folder, once debugging session is done. But at least now I can debug java code.
I’ll try solutions given by both of you this weekend, the one by Florent Gravin seems to eliminate the need for any modification/restoration etc…
The other solution provided to debug java with jetty:run :
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
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
Hi all,
till now I was happy with editing sources in eclipse and actually running it outside using Jetty, since I was able to run from the source without deploying.
But now I need to debug java code. If I right click on geonetwork-main, I don’t get the option “Run on Server…” as with any dynamic web project in eclipse.
It looks I need to add ‘Dynamic Web Module’ option in Properties → Project facets, to be able to run geonetwork-main on tomcat. But following error is preventing it to be added:
What a coincidence! Yesterday I posted another mail about how to do this. It’s very easy:
Move the webapp/classes folder to another location outside the project
Right click on the project to run “Maven → Update Project”
Restore the webapp/classes folder
Sometimes it still shows some errors when adding again the webapp/classes folder, but they don’t break the build or the run. If you need to update maven project again (when adding new dependencies, for example), you will have to do the same steps again.