softwareCobbler / luceedebug

line debugger for lucee
GNU Lesser General Public License v2.1
44 stars 15 forks source link

NoClassDefFoundError: com/sun/jdi/Bootstrap #33

Closed chapmandu closed 1 year ago

chapmandu commented 1 year ago

Hey there..

I've used the suggested settings:

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:9999
-javaagent:/app/luceedebug.jar=jdwpHost=localhost,jdwpPort=9999,debugHost=0.0.0.0,debugPort=10000,jarPath=/app/luceedebug.jar

Generated the jar with gradlew as documented.

It seems the luceedebug.jar has been loaded, but throws java.lang.NoClassDefFoundError: com/sun/jdi/Bootstrap attempting jdwp self connect to jdwp on localhost:9999.

I'm using:

Logs:

INFO: Starting server using generated script: /usr/bin/startup.sh Listening for transport dt_socket at address: 9999 [luceedebug] fs is case sensitive: true [luceedebug] agent premain complete [INFO ] runwar.server: ** [INFO ] runwar.server: Starting RunWAR 4.7.16 [INFO ] runwar.server: Binding HTTP on 0.0.0.0:80 [INFO ] runwar.server: Enabling HTTP/2 [INFO ] runwar.server: Servlet Context: / [INFO ] runwar.server: Log Directory: /usr/lib/serverHome/logs [INFO ] runwar.server: ** [INFO ] runwar.config: Parsing '/usr/lib/serverHome/WEB-INF/web.xml' [INFO ] runwar.server: Creating deployment [default] in /app WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.apache.felix.framework.ext.ClassPathExtenderFactory$DefaultClassLoaderExtender (file:/usr/lib/serverHome/WEB-INF/lib/lucee-5.3.10.97.jar) to method java.net.URLClassLoader.addURL(java.net.URL) WARNING: Please consider reporting this to the maintainers of org.apache.felix.framework.ext.ClassPathExtenderFactory$DefaultClassLoaderExtender WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [INFO ] runwar.context: [luceedebug] Loaded luceedebug.coreinject.DebugManager@1a28b346 with ClassLoader 'lucee.core [49]' [INFO ] runwar.context: [luceedebug] attempting jdwp self connect to jdwp on localhost:9999... [ERROR] runwar.context: java.lang.NoClassDefFoundError: com/sun/jdi/Bootstrap [ERROR] runwar.context: at luceedebug.coreinject.DebugManager.getConnector(DebugManager.java:74) [ERROR] runwar.context: at luceedebug.coreinject.DebugManager.jdwpSelfConnect(DebugManager.java:87) [ERROR] runwar.context: at luceedebug.coreinject.DebugManager.spawnWorker(DebugManager.java:64) [ERROR] runwar.context: at luceedebug.LuceeTransformer.transform(LuceeTransformer.java:108) [ERROR] runwar.context: at java.instrument/java.lang.instrument.ClassFileTransformer.transform(Unknown Source) [ERROR] runwar.context: at java.instrument/sun.instrument.TransformerManager.transform(Unknown Source) [ERROR] runwar.context: at java.instrument/sun.instrument.InstrumentationImpl.transform(Unknown Source) [ERROR] runwar.context: at java.base/java.lang.ClassLoader.defineClass1(Native Method) [ERROR] runwar.context: at java.base/java.lang.ClassLoader.defineClass(Unknown Source) [ERROR] runwar.context: at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2312) [ERROR] runwar.context: at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClassParallel(BundleWiringImpl.java:2130) [ERROR] runwar.context: at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2064) [ERROR] runwar.context: at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1533) [ERROR] runwar.context: at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:78) [ERROR] runwar.context: at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1950) [ERROR] runwar.context: at java.base/java.lang.ClassLoader.loadClass(Unknown Source) [ERROR] runwar.context: at java.base/java.lang.Class.getDeclaredMethods0(Native Method) [ERROR] runwar.context: at java.base/java.lang.Class.privateGetDeclaredMethods(Unknown Source) [ERROR] runwar.context: at java.base/java.lang.Class.getMethodsRecursive(Unknown Source) [ERROR] runwar.context: at java.base/java.lang.Class.getMethod0(Unknown Source) [ERROR] runwar.context: at java.base/java.lang.Class.getMethod(Unknown Source) [ERROR] runwar.context: at lucee.loader.engine.CFMLEngineFactory.getEngine(CFMLEngineFactory.java:1468) [ERROR] runwar.context: at lucee.loader.engine.CFMLEngineFactory.initEngine(CFMLEngineFactory.java:384) [ERROR] runwar.context: at lucee.loader.engine.CFMLEngineFactory.initEngineIfNecessary(CFMLEngineFactory.java:262) [ERROR] runwar.context: at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:168) [ERROR] runwar.context: at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:202) [ERROR] runwar.context: at lucee.loader.servlet.LuceeServlet.init(LuceeServlet.java:42) [ERROR] runwar.context: at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117) [ERROR] runwar.context: at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:309) [ERROR] runwar.context: at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:145) [ERROR] runwar.context: at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:588) [ERROR] runwar.context: at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:559) [ERROR] runwar.context: at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42) [ERROR] runwar.context: at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [ERROR] runwar.context: at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [ERROR] runwar.context: at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:601) [ERROR] runwar.context: at runwar.Server.createServletDeployment(Server.java:1360) [ERROR] runwar.context: at runwar.Server.startServer(Server.java:527) [ERROR] runwar.context: at runwar.Start.main(Start.java:51) [ERROR] runwar.context: Caused by: java.lang.ClassNotFoundException: com.sun.jdi.Bootstrap not found by lucee.core [49] [ERROR] runwar.context: at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1565) [ERROR] runwar.context: at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:78) [ERROR] runwar.context: at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1950) [ERROR] runwar.context: at java.base/java.lang.ClassLoader.loadClass(Unknown Source) [ERROR] runwar.context: ... 39 more [INFO ] runwar.server: ** [INFO ] runwar.server: * stopping server 'my_app' (socket 39763) [INFO ] runwar.server: ****

softwareCobbler commented 1 year ago

This appears to be a missing JDK -- are you / can you run your server under the JDK version of your Adoptium 11?

related https://cfml.slack.com/archives/C06TA0A9W/p1678415322823899

chapmandu commented 1 year ago

Thanks for the tip! The solution was to change the docker image to the jdk version.

ortussolutions/commandbox:jdk11