Question

I'm looking for days now how to attach my debugger in netbeans. So we have a Start.java class where the jetty is embedded. Similar to this http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty So I start my web application by running this Start.java file. Everything works fine till the point where I want to debug. I've seen multiple how to's for eclipse and the very few I found for netbeans didnt help.

Does anyone have a clue? In the project properties, under actions, I added Env.MAVEN_OPTS=-Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m -Xverify:none -Xnoclassgc -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

under Run file via main() and Debug file via main()

when I attach the java debugger (jpda) it seems as if its running but its ignoring the breakpoints

Has anyone any idea?

Thanks in advance

Was it helpful?

Solution 2

In my project properties -> actions: Debug file via main() I had added as mentioned above

Env.MAVEN_OPTS=-Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m -Xverify:none -Xnoclassgc

whitch attached the debugger but not with my project. I added -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address}

to my exc.args and now its working perfectly!

exec.args=-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -classpath %classpath ${packageClassName}

This is the complete config of my Debug file via main() and Run file via main()

exec.args=-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -classpath %classpath ${packageClassName}
exec.executable=java
exec.classpathScope=${classPathScope}
jpda.listen=true
Env.MAVEN_OPTS=-Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m -Xverify:none -Xnoclassgc

OTHER TIPS

Do following step to debug JSP web maven project in Netbeans using jetty

  1. Right click on project and click on properties
  2. Go to actions and select "Debug Project" actions
  3. Click on ok button
  4. Again right click on project go to Custom->Goals
  5. Set Goals jetty:run
  6. Set properties jpda.listen=maven
  7. Click on ok button
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top