开发者

Debuging issue with maven, jetty and IDEA

开发者 https://www.devze.com 2022-12-13 23:42 出处:网络
I have problem with running jetty in debug and attaching IntelliJ IDEA to listening port. mvnDebug jetty:run-exploded

I have problem with running jetty in debug and attaching IntelliJ IDEA to listening port.

mvnDebug jetty:run-exploded

will start jetty as I can see following message

Preparing to Execute Maven in Debug Mode Listening for transport dt_socket at address: 8000

However when I try to to connect IDEA to port 8000 I will get message in IDE saying connected and immediately followed by disconnected. Where jetty will kick following error

Exception in thread "main" java.lang.NoClassDefFo开发者_JAVA百科undError: org/codehaus/classworlds/Launcher Caused by: java.lang.ClassNotFoundException: org.codehaus.classworlds.Launcher at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) Could not find the main class: org.codehaus.classworlds.Launcher. Program will exit.

I'm little confused by this as there is no problem in running project under jetty with

mvn jetty:run-exploded

also my colleague have no problem with debugging under IDEA, only difference between his and my setup is that I have 64bit machine and he is on 32bit


I found temporary solution for debug.

Before executing I just re-export MAVEN_OPTS with some additional parameters so this will work only on currently open terminal window.

My system MAVEN_OPTS are export MAVEN_OPTS="-Xms256m -Xmx512m -XX:PermSize=128m -XX:-UseGCOverheadLimit"

and session changed to export MAVEN_OPTS="-Xms256m -Xmx1500m -XX:PermSize=128m -XX:-UseGCOverheadLimit -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

I will have to discuss "mvnDebug" alias set-up with my colleague when he gets back tomorrow...

0

精彩评论

暂无评论...
验证码 换一张
取 消