Giter Site home page Giter Site logo

softwarecobbler / luceedebug Goto Github PK

View Code? Open in Web Editor NEW
41.0 7.0 12.0 85.19 MB

line debugger for lucee

License: GNU Lesser General Public License v2.1

Java 94.76% ColdFusion 0.34% TypeScript 4.64% Dockerfile 0.23% Batchfile 0.03%
cfml debugging lucee coldfusion

luceedebug's People

Contributors

jamiejackson avatar softwarecobbler avatar symbianx avatar zspitzer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

luceedebug's Issues

Enhancement: Rename cfHost & cfPort to debugHost & debugPort

I'm in the ephemeral position where I'm new enough to the project that I'm not used to any counterintuitive quirks, so I'm trying to document or fix them as I go along, before I no longer notice them.

I think the cfHost and cfPort variables are confusingly named and I kept having to refer to the readme because of the cognitive dissonance. As far as I know, these are not really the Lucee/ColdFusion host and port but the debugger connection information. (The Lucee host, and especially the port, are something completely different than the debugger attachment host/port.) I think something like debugHost and debugPort wouldn't have made me go back and forth to the documentation as much as I did.

Maybe since the project is still new, it might not be too painful to make a change like that (and maybe there could be an adaptor to set the legacy variable names to the new variables, for backward compatibility).

Just a thought.

NoClassDefFoundError: com/sun/jdi/Bootstrap

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:

  • Docker/Commandbox
  • Lucee 5.3.10.97
  • Java 11.0.17 (Eclipse Adoptium) 64bit
  • Ubuntu 22.04

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: ******************************************************************************

Trouble Connecting to Debugger (Insists on Using localhost?)

I installed the extension via the Marketplace. :-)

However, I'm getting the following. It seems like it's trying localhost, instead of the host I supplied.

image

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
    //     {
    //         "type": "cfml-debugger",
    //         "request": "launch",
    //         "name": "CFML Debug",
    //         "program": "${workspaceFolder}/${command:AskForProgramName}",
    //         "globalConfigFilePath": "${command:globalConfigFilePath}",
    //         "project": "${command:AskForProject}",
    //         "stopOnEntry": false,
    //         "windows": {
    //             "program": "${workspaceFolder}\\${command:AskForProgramName}"
    //         }
    //     }

    {
        "type": "cfml",
        "request": "attach",
        "name": "Project A",
        "hostName": "local.hudx.net",
        "port": 10000,
        "pathTransform": { // optional
            "idePrefix": "${workspaceFolder}/cfml/deployment_root",
            "cfPrefix": "/app/www/"
        }
    }
    ]

}

As a sanity check, I then changed the port (to 10001), which is reflected in the popup:

image

Vulnerabilities in Guava Dependency

There's a HIGH vulnerability.

guava-31.1-jre.jar (pkg:maven/com.google.guava/[email protected], cpe:2.3:a:google:guava:31.1:*:*:*:*:*:*:*) : CVE-2023-2976, CVE-2020-8908

Even though the security vulnerability is fixed in version 32.0.0, we recommend using version 32.0.1 as version 32.0.0 breaks some functionality under Windows.

Note that #44 helps identify this stuff. It will drop an HTML report as build/reports/dependency-check-report.html, which has more detail.

Setup in Windows/Tomcat

Forgive my ignorance. What's the setup for Windows/Tomcat with regards the setenv file?

Is this an equivalent setenv.bat file for Windows, e.g. C:\lucee\tomcat\bin\setenv.bat ?

If so, what are the corresponding bat file commands as opposed to those for a sh file ?

ChatGPT informs me it's:

set "JAVA_OPTS=%JAVA_OPTS% -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:9999"
set "JAVA_OPTS=%JAVA_OPTS% -javaagent:C:\abspath\to\luceedebug.jar=jdwpHost=localhost,jdwpPort=9999,debugHost=0.0.0.0,debugPort=10000,jarPath=C:\abspath\to\luceedebug.jar"

Is this correct?

EDIT:
Guess not since I'm running Tomcat as a Windows service and from what I've read this isn't the way to go.
Some additional documentation/guidance on setup would be appreciated.

Server Won't Start

I'm using the lucee docker image (lucee/lucee:5.3.7.47). I'm new to luceedebug so I have no idea what I'm doing wrong, but the server won't start.

You can see the agentlib and javaagent configs I'm trying to use in the logs, below.

Any ideas?

Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/local/openjdk-11
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
Listening for transport dt_socket at address: 9999
[luceedebug] agent premain complete
09-Dec-2022 17:50:02.462 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/9.0.39
09-Dec-2022 17:50:02.485 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Oct 6 2020 14:11:46 UTC
09-Dec-2022 17:50:02.486 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.39.0
09-Dec-2022 17:50:02.487 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
09-Dec-2022 17:50:02.487 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.15.0-200-generic
09-Dec-2022 17:50:02.487 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
09-Dec-2022 17:50:02.488 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/local/openjdk-11
09-Dec-2022 17:50:02.488 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           11.0.9+11
09-Dec-2022 17:50:02.489 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
09-Dec-2022 17:50:02.494 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat
09-Dec-2022 17:50:02.495 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat
09-Dec-2022 17:50:02.524 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
09-Dec-2022 17:50:02.529 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
09-Dec-2022 17:50:02.530 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
09-Dec-2022 17:50:02.531 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
09-Dec-2022 17:50:02.531 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
09-Dec-2022 17:50:02.532 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512m
09-Dec-2022 17:50:02.533 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx4096m
09-Dec-2022 17:50:02.533 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.security.egd=file:/dev/./urandom
09-Dec-2022 17:50:02.534 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:9999
09-Dec-2022 17:50:02.535 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -javaagent:/app/lib/luceedebug/luceedebug.jar=jdwpHost=localhost,jdwpPort=9999,cfHost=0.0.0.0,cfPort=10000,jarPath=/app/lib/luceedebug/luceedebug.jar
09-Dec-2022 17:50:02.535 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
09-Dec-2022 17:50:02.536 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
09-Dec-2022 17:50:02.538 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
09-Dec-2022 17:50:02.539 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
09-Dec-2022 17:50:02.539 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
09-Dec-2022 17:50:02.540 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
09-Dec-2022 17:50:02.540 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
09-Dec-2022 17:50:02.552 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.25] using APR version [1.6.5].
09-Dec-2022 17:50:02.557 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
09-Dec-2022 17:50:02.559 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
09-Dec-2022 17:50:02.568 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1n  15 Mar 2022]
09-Dec-2022 17:50:03.201 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8888"]
09-Dec-2022 17:50:03.290 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1300] milliseconds
09-Dec-2022 17:50:03.395 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
09-Dec-2022 17:50:03.396 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.39]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.felix.framework.ext.ClassPathExtenderFactory$DefaultClassLoaderExtender (file:/usr/local/tomcat/lucee/lucee.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
log4j:WARN No appenders could be found for logger (org.jets3t.service.Jets3tProperties).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
09-Dec-2022 17:50:08.263 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8888"]
09-Dec-2022 17:50:08.313 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [5013] milliseconds
com.sun.jdi.AbsentInformationException
	at jdk.jdi/com.sun.tools.jdi.ReferenceTypeImpl.allLineLocations(ReferenceTypeImpl.java:897)
	at jdk.jdi/com.sun.tools.jdi.ReferenceTypeImpl.allLineLocations(ReferenceTypeImpl.java:873)
	at luceedebug.coreinject.CfVm$KlassMap.<init>(CfVm.java:573)
	at luceedebug.coreinject.CfVm.trackClassRef(CfVm.java:465)
	at luceedebug.coreinject.CfVm.handleClassPrepareEvent(CfVm.java:494)
	at luceedebug.coreinject.CfVm$1.run(CfVm.java:396)
	at java.base/java.lang.Thread.run(Thread.java:834)
09-Dec-2022 17:50:44.488 INFO [Thread-6] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8888"]
09-Dec-2022 17:50:44.491 INFO [Thread-6] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina]
09-Dec-2022 17:50:44.499 INFO [Thread-6] org.apache.catalina.core.StandardWrapper.unload Waiting for [1] instance(s) to be deallocated for Servlet [CFMLServlet]
09-Dec-2022 17:50:45.528 INFO [Thread-6] org.apache.catalina.core.StandardWrapper.unload Waiting for [1] instance(s) to be deallocated for Servlet [CFMLServlet]
09-Dec-2022 17:50:46.552 INFO [Thread-6] org.apache.catalina.core.StandardWrapper.unload Waiting for [1] instance(s) to be deallocated for Servlet [CFMLServlet]
09-Dec-2022 17:50:51.965 WARNING [Thread-6] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [FelixResolver-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
 [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
 [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123)
 [email protected]/java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:458)
 [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1053)
 [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
 [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
 [email protected]/java.lang.Thread.run(Thread.java:834)
09-Dec-2022 17:50:51.969 WARNING [Thread-6] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [FelixResolver-2] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
 [email protected]/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
 [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123)
 [email protected]/java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:458)
 [email protected]/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1053)
 [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
 [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
 [email protected]/java.lang.Thread.run(Thread.java:834)
09-Dec-2022 17:50:51.974 WARNING [Thread-6] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [luceedebug-worker] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.net.PlainSocketImpl.socketAccept(Native Method)
 [email protected]/java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:458)
 [email protected]/java.net.ServerSocket.implAccept(ServerSocket.java:565)
 [email protected]/java.net.ServerSocket.accept(ServerSocket.java:533)
 app//luceedebug.DapServer.createForSocket(DapServer.java:84)
 luceedebug.coreinject.DebugManager$1.run(DebugManager.java:40)
 [email protected]/java.lang.Thread.run(Thread.java:834)
09-Dec-2022 17:50:51.976 WARNING [Thread-6] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [Thread-14] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
 [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
 [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
 [email protected]/java.util.concurrent.LinkedBlockingDeque.takeLast(LinkedBlockingDeque.java:496)
 luceedebug.coreinject.AsyncWorker$1.run(AsyncWorker.java:28)
 [email protected]/java.lang.Thread.run(Thread.java:834)
09-Dec-2022 17:50:51.978 WARNING [Thread-6] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [Thread-15] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Object.wait(Native Method)
 [email protected]/java.lang.Thread.join(Thread.java:1305)
 [email protected]/java.lang.Thread.join(Thread.java:1380)
 [email protected]/java.lang.ApplicationShutdownHooks.runHooks(ApplicationShutdownHooks.java:107)
 [email protected]/java.lang.ApplicationShutdownHooks$1.run(ApplicationShutdownHooks.java:46)
 [email protected]/java.lang.Shutdown.runHooks(Shutdown.java:130)
 [email protected]/java.lang.Shutdown.exit(Shutdown.java:174)
 [email protected]/java.lang.Runtime.exit(Runtime.java:116)
 [email protected]/java.lang.System.exit(System.java:1752)
 luceedebug.coreinject.CfVm$KlassMap.<init>(CfVm.java:579)
 luceedebug.coreinject.CfVm.trackClassRef(CfVm.java:465)
 luceedebug.coreinject.CfVm.handleClassPrepareEvent(CfVm.java:494)
 luceedebug.coreinject.CfVm$1.run(CfVm.java:396)
 [email protected]/java.lang.Thread.run(Thread.java:834)
09-Dec-2022 17:50:51.980 WARNING [Thread-6] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [Thread-17] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 luceedebug.coreinject.CfVm$JdwpWorker.jdwp_stays_suspended_in_this_method_as_a_worker(CfVm.java:155)
 luceedebug.coreinject.CfVm$JdwpWorker$1.run(CfVm.java:162)
 [email protected]/java.lang.Thread.run(Thread.java:834)
09-Dec-2022 17:50:51.982 WARNING [Thread-6] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [JDI Internal Event Handler] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.lang.Object.wait(Native Method)
 [email protected]/java.lang.Object.wait(Object.java:328)
 app/[email protected]/com.sun.tools.jdi.EventQueueImpl.removeUnfiltered(EventQueueImpl.java:190)
 app/[email protected]/com.sun.tools.jdi.EventQueueImpl.removeInternal(EventQueueImpl.java:125)
 app/[email protected]/com.sun.tools.jdi.InternalEventHandler.run(InternalEventHandler.java:61)
 [email protected]/java.lang.Thread.run(Thread.java:834)
09-Dec-2022 17:50:51.985 WARNING [Thread-6] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [JDI Target VM Interface] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 [email protected]/java.net.SocketInputStream.socketRead0(Native Method)
 [email protected]/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
 [email protected]/java.net.SocketInputStream.read(SocketInputStream.java:168)
 [email protected]/java.net.SocketInputStream.read(SocketInputStream.java:140)
 [email protected]/java.net.SocketInputStream.read(SocketInputStream.java:200)
 app/[email protected]/com.sun.tools.jdi.SocketConnection.readPacket(SocketConnection.java:82)
 app/[email protected]/com.sun.tools.jdi.TargetVM.run(TargetVM.java:124)
 [email protected]/java.lang.Thread.run(Thread.java:834)
09-Dec-2022 17:50:52.001 INFO [Thread-6] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8888"]
09-Dec-2022 17:50:57.053 WARNING [Thread-6] org.apache.tomcat.util.net.AbstractEndpoint.shutdownExecutor The executor associated with thread pool [http-nio-8888] has not fully shutdown. Some application threads may still be running.
09-Dec-2022 17:50:57.059 INFO [Thread-6] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8888"]
root@f63be9409cce:/usr/local/tomcat# cat /tmp/
container_start_date  hsperfdata_root/      modified_cacerts      ssl_pubkeys/          template_renderer/    web.xml.patch
root@f63be9409cce:/usr/local/tomcat# cat /usr/local/tomcat/logs/java_opts.log
-Xms512m -Xmx4096m -Djava.security.egd=file:/dev/./urandom -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:9999 -javaagent:/app/lib/luceedebug/luceedebug.jar=jdwpHost=localhost,jdwpPort=9999,cfHost=0.0.0.0,cfPort=10000,jarPath=/app/lib/luceedebug/luceedebug.jar

Usage with CommandBox

I thought I'd look into the path translation problem on Windows but I fell into a bunch of rabbit holes.

I've been toying with the idea of having a working commandbox and/or docker example that people could try so I tried spinning things up in commandbox, but first, there was a learning curve to commandbox, and finally and I wasn't able to run it.

Any ideas?

{
    "name":"[email protected]",
    "jvm":{
        "args":[
            "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:9999",
            "-javaagent:C:/Users/jamie/projects/luceedebug/luceedebug/build/libs/luceedebug.jar=jdwpHost=localhost,jdwpPort=9999,debugHost=0.0.0.0,debugPort=10000,jarPath=C:/Users/jamie/projects/luceedebug/luceedebug/build/libs/luceedebug.jar"
        ],
        "javaVersion":"openjdk11"
    },
    "app":{
        "cfengine":"[email protected]"
    }
}

server run gave the following:

[INFO ] Runwar: ******************************************************************************
[INFO ] Runwar: Starting RunWAR 4.7.16
[INFO ] Runwar: Binding HTTP on 127.0.0.1:23481
[INFO ] Runwar: Enabling HTTP/2
[INFO ] Runwar: Starting background [email protected] [lucee 5.3.10+97] from: /C:/Users/jamie/.CommandBox/lib/runwar-4.7.16.jar
[INFO ] Starting in background -
[INFO ] Runwar: ******************************************************************************
[INFO ] Runwar: Starting RunWAR 4.7.16
[INFO ] Runwar: Binding HTTP on 127.0.0.1:23481
[INFO ] Runwar: Enabling HTTP/2
[INFO ] Runwar: Servlet Context: /
[INFO ] Runwar: Log Directory: C:\Users\jamie\.CommandBox\server\[email protected]\lucee-5.3.10.97\logs
[INFO ] Runwar: ******************************************************************************
[INFO ] Runwar: Parsing 'C:\Users\jamie\.CommandBox\server\[email protected]\lucee-5.3.10.97\WEB-INF\web.xml'
[INFO ] Runwar: Creating deployment [default] in C:\Users\jamie\projects\luceedebug\sample
CommandBox:sample> server log
[INFO ] Runwar: ******************************************************************************
[INFO ] Runwar: Starting RunWAR 4.7.16
[INFO ] Runwar: Binding HTTP on 127.0.0.1:23481
[INFO ] Runwar: Enabling HTTP/2
[INFO ] Runwar: Starting background [email protected] [lucee 5.3.10+97] from: /C:/Users/jamie/.CommandBox/lib/runwar-4.7.16.jar
[INFO ] Starting in background -
[INFO ] Runwar: ******************************************************************************
[INFO ] Runwar: Starting RunWAR 4.7.16
[INFO ] Runwar: Binding HTTP on 127.0.0.1:23481
[INFO ] Runwar: Enabling HTTP/2
[INFO ] Runwar: Servlet Context: /
[INFO ] Runwar: Log Directory: C:\Users\jamie\.CommandBox\server\[email protected]\lucee-5.3.10.97\logs
[INFO ] Runwar: ******************************************************************************
[INFO ] Runwar: Parsing 'C:\Users\jamie\.CommandBox\server\[email protected]\lucee-5.3.10.97\WEB-INF\web.xml'
[INFO ] Runwar: Creating deployment [default] in C:\Users\jamie\projects\luceedebug\sample
[INFO ] [luceedebug] Loaded luceedebug.coreinject.DebugManager@7ed9499e with ClassLoader 'lucee.core [49]'
[INFO ] [luceedebug] instrumented PageContextImpl <clinit> called spawnWorker...
[INFO ] [luceedebug] attempting jdwp self connect to jdwp on localhost:9999...
[ERROR] java.lang.NoClassDefFoundError: com/sun/jdi/Bootstrap
[ERROR]         at luceedebug.coreinject.DebugManager.getConnector(DebugManager.java:76)
[ERROR]         at luceedebug.coreinject.DebugManager.jdwpSelfConnect(DebugManager.java:89)
[ERROR]         at luceedebug.coreinject.DebugManager.spawnWorker(DebugManager.java:62)
[ERROR]         at luceedebug.LuceeTransformer.transform(LuceeTransformer.java:108)
[ERROR]         at java.instrument/java.lang.instrument.ClassFileTransformer.transform(Unknown Source)
[ERROR]         at java.instrument/sun.instrument.TransformerManager.transform(Unknown Source)
[ERROR]         at java.instrument/sun.instrument.InstrumentationImpl.transform(Unknown Source)
[ERROR]         at java.base/java.lang.ClassLoader.defineClass1(Native Method)
[ERROR]         at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
[ERROR]         at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2312)
[ERROR]         at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClassParallel(BundleWiringImpl.java:2130)
[ERROR]         at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2064)
[ERROR]         at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1533)
[ERROR]         at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:78)
[ERROR]         at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1950)
[ERROR]         at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
[ERROR]         at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
[ERROR]         at java.base/java.lang.Class.privateGetDeclaredMethods(Unknown Source)
[ERROR]         at java.base/java.lang.Class.getMethodsRecursive(Unknown Source)
[ERROR]         at java.base/java.lang.Class.getMethod0(Unknown Source)
[ERROR]         at java.base/java.lang.Class.getMethod(Unknown Source)
[ERROR]         at lucee.loader.engine.CFMLEngineFactory.getEngine(CFMLEngineFactory.java:1468)
[ERROR]         at lucee.loader.engine.CFMLEngineFactory.initEngine(CFMLEngineFactory.java:384)
[ERROR]         at lucee.loader.engine.CFMLEngineFactory.initEngineIfNecessary(CFMLEngineFactory.java:262)
[ERROR]         at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:168)
[ERROR]         at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:202)
[ERROR]         at lucee.loader.servlet.LuceeServlet.init(LuceeServlet.java:42)
[ERROR]         at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
[ERROR]         at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:309)
[ERROR]         at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:145)
[ERROR]         at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:588)
[ERROR]         at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:559)
[ERROR]         at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
[ERROR]         at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
[ERROR]         at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
[ERROR]         at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:601)
[ERROR]         at runwar.Server.createServletDeployment(Server.java:1360)
[ERROR]         at runwar.Server.startServer(Server.java:527)
[ERROR]         at runwar.Start.main(Start.java:51)
[ERROR] Caused by: java.lang.ClassNotFoundException: com.sun.jdi.Bootstrap not found by lucee.core [49]
[ERROR]         at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1565)
[ERROR]         at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:78)
[ERROR]         at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1950)
[ERROR]         at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
[ERROR]         ... 39 more
[INFO ] Runwar: ******************************************************************************
[INFO ] Runwar: *** stopping server '[email protected]' (socket 23482)
[INFO ] Runwar: ******************************************************************************

Troubleshooting "unverified breakpoint"

I did a workshop with my team yesterday, so they could get their IDEs working with our new Lucee docker image with the luceedebug java agent baked in.

One colleague couldn't get his breakpoints working. When VS Code connected, the breakpoint hollowed out, and mousing-over gave "unverified breakpoint."

We double-checked the IDE paths, and the container paths were the same as the rest of ours, but no luck.

Do you have any tips for troubleshooting this?

Logging & Shaded Jar

While troubleshooting, I wanted some extra logging in the Agent, so I thought I'd implement a logger. I was having trouble at integration time (missing classes) and I realized that the packaging process was stripping out the logging libraries.

I didn't spend a lot of time trying to figure out the gradle tasks, but I didn't grok the packaging tasks and how the shaded vs non-shaded jar placement was intended to work. (It kinda looked like the intention was to ultimately place the shaded jar, but maybe not?)

So two questions:

  • Do you have any interest in a logger?
  • Could you describe the intention of the packaging process (i.e., shaded vs slim)?

gradlew.bat shadowjar

Getting error

Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
...on executing gradlew.bat shadowjar

NoClassDefException on Lucee 6

I'm getting an exception:

java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at luceedebug.LuceeTransformer.transform(LuceeTransformer.java:102)
        at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:244)
        at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:541)
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2338)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClassParallel(BundleWiringImpl.java:2156)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2090)
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556)
        at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1976)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
        at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)
        at java.base/java.lang.Class.getMethodsRecursive(Class.java:3543)
        at java.base/java.lang.Class.getMethod0(Class.java:3529)
        at java.base/java.lang.Class.getMethod(Class.java:2225)
        at lucee.loader.engine.CFMLEngineFactory.getEngine(CFMLEngineFactory.java:1470)
        at lucee.loader.engine.CFMLEngineFactory.initEngine(CFMLEngineFactory.java:384)
        at lucee.loader.engine.CFMLEngineFactory.initEngineIfNecessary(CFMLEngineFactory.java:262)
        at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:168)
        at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:202)
        at lucee.loader.servlet.LuceeServlet.init(LuceeServlet.java:42)
        at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1124)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1079)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:971)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4829)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5143)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1141)
        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1876)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1053)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:428)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1585)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:969)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
Caused by: java.lang.NoClassDefFoundError: luceedebug_shadow/com/google/common/collect/MapMaker
        at luceedebug.coreinject.ValTracker$Mapping.<init>(ValTracker.java:45)
        at luceedebug.coreinject.ValTracker.<init>(ValTracker.java:19)
        at luceedebug.coreinject.DebugManager.<init>(DebugManager.java:99)
        ... 73 more
Caused by: java.lang.ClassNotFoundException: luceedebug_shadow.com.google.common.collect.MapMaker not found by lucee.core [45]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1591)
        at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1976)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        ... 76 more

But luceedebug_shadow.com.google.common.collect.MapMaker is there:

image

Did I miss a step?

java.lang.IllegalArgumentException: character to be escaped is missing - when running latest build

I had a working version from a build I made on 3/5/2023 - Windows , commandbox
no longer runs with code from master branch last updated 4/25/2023. Am able to roll back to the 3/5 version and it works (although that has some limitations - see end)

[ERROR] Apr 29, 2023 7:04:48 AM luceedebug_shadow.org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError SEVERE: Internal error: java.lang.reflect.InvocationTargetException java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at luceedebug_shadow.org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67) at luceedebug_shadow.org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120) at luceedebug_shadow.org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261) at luceedebug_shadow.org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190) at luceedebug_shadow.org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194) at luceedebug_shadow.org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) at luceedebug_shadow.org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at luceedebug_shadow.org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65) ... 11 more Caused by: java.lang.IllegalArgumentException: character to be escaped is missing at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1020) at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:998) at java.base/java.util.regex.Matcher.replaceAll(Matcher.java:1182) at java.base/java.lang.String.replaceAll(String.java:2126) at luceedebug.DapServer.applyPathTransformsIdeToCf(DapServer.java:65) at luceedebug.DapServer.setBreakpoints(DapServer.java:366) ... 16 more

my config in server.json is
config -
"jvm":{ "args":[ "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:9999", "-javaagent:c:\\source\\luceedebug\\luceedebug.jar=jdwpHost=localhost,jdwpPort=9999,debugHost=localhost,debugPort=10000,jarPath=c:\\source\\luceedebug\\luceedebug.jar" ], "javaVersion":"openjdk11_jdk" }

for me - the version from 3/5 - I cannot use the dump commands,

[ERROR] Apr 29, 2023 7:14:56 AM luceedebug_shadow.org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint request
WARNING: Unsupported request method: dumpAsJSON

watches kick out an exception too on the 3/5 version - but I am not going to confuse this issue with all the problems with an older version.. Suffice to say, I am keen to get the latest working version to see if I can get more of the features working.

Lucee Requires luceedebug to be Compiled for Java 11

Lucee wants luceedebug to be compiled for Java 11.

Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/local/openjdk-11
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
Listening for transport dt_socket at address: 9999
Exception in thread "main" java.lang.UnsupportedClassVersionError: luceedebug/Agent has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:431)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
*** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at ./src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
Aborted (core dumped)

Lucee 5.4.1.8 Issue: java.lang.NoClassDefFoundError: com/sun/jdi/Bootstrap

Lucee 5.4.1.8 just dropped. I'm trying it out but I had issues right away with server startup.

I haven't dug into this at all yet.

FYI, this is with the Lucee docker image (5.4.1.8-light).

07-Jul-2023 16:24:55.049 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /opt/java/openjdk
07-Jul-2023 16:24:55.049 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           11.0.19+7
07-Jul-2023 16:24:55.049 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Eclipse Adoptium
07-Jul-2023 16:24:55.049 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat
07-Jul-2023 16:24:55.049 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat
07-Jul-2023 16:24:55.089 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
07-Jul-2023 16:24:55.092 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
07-Jul-2023 16:24:55.092 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
07-Jul-2023 16:24:55.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
07-Jul-2023 16:24:55.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
07-Jul-2023 16:24:55.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
07-Jul-2023 16:24:55.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
07-Jul-2023 16:24:55.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512m
07-Jul-2023 16:24:55.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx4096m
07-Jul-2023 16:24:55.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.security.egd=file:/dev/./urandom
07-Jul-2023 16:24:55.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:9999
07-Jul-2023 16:24:55.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -javaagent:/app/lib/luceedebug/luceedebug.jar=jdwpHost=localhost,jdwpPort=9999,cfHost=0.0.0.0,cfPort=10000,jarPath=/app/lib/luceedebug/luceedebug.jar
07-Jul-2023 16:24:55.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
07-Jul-2023 16:24:55.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
07-Jul-2023 16:24:55.094 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
07-Jul-2023 16:24:55.094 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
07-Jul-2023 16:24:55.094 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
07-Jul-2023 16:24:55.094 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
07-Jul-2023 16:24:55.094 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
07-Jul-2023 16:24:55.120 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.37] using APR version [1.7.0].
07-Jul-2023 16:24:55.122 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [true].
07-Jul-2023 16:24:55.122 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
07-Jul-2023 16:24:55.134 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 3.0.2 15 Mar 2022]
07-Jul-2023 16:24:55.814 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8888"]
07-Jul-2023 16:24:55.920 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1507] milliseconds
07-Jul-2023 16:24:56.020 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
07-Jul-2023 16:24:56.021 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.76]
[luceedebug] Loaded luceedebug.coreinject.DebugManager@784c5ef5 with ClassLoader 'lucee.core [41]'
[luceedebug] attempting jdwp self connect to jdwp on localhost:9999...
java.lang.NoClassDefFoundError: com/sun/jdi/Bootstrap
     at luceedebug.coreinject.DebugManager.getConnector(DebugManager.java:81)
     at luceedebug.coreinject.DebugManager.jdwpSelfConnect(DebugManager.java:94)
     at luceedebug.coreinject.DebugManager.spawnWorker(DebugManager.java:71)
     at luceedebug.LuceeTransformer.transform(LuceeTransformer.java:108)
     at java.instrument/java.lang.instrument.ClassFileTransformer.transform(Unknown Source)
     at java.instrument/sun.instrument.TransformerManager.transform(Unknown Source)
     at java.instrument/sun.instrument.InstrumentationImpl.transform(Unknown Source)
     at java.base/java.lang.ClassLoader.defineClass1(Native Method)
     at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
     at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2338)
     at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClassParallel(BundleWiringImpl.java:2156)
     at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2090)
     at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556)
     at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
     at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1976)
     at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
     at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
     at java.base/java.lang.Class.privateGetDeclaredMethods(Unknown Source)
     at java.base/java.lang.Class.getMethodsRecursive(Unknown Source)
     at java.base/java.lang.Class.getMethod0(Unknown Source)
     at java.base/java.lang.Class.getMethod(Unknown Source)
     at lucee.loader.engine.CFMLEngineFactory.getEngine(CFMLEngineFactory.java:1468)
     at lucee.loader.engine.CFMLEngineFactory.initEngine(CFMLEngineFactory.java:384)
     at lucee.loader.engine.CFMLEngineFactory.initEngineIfNecessary(CFMLEngineFactory.java:262)
     at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:168)
     at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:202)
     at lucee.loader.servlet.CFMLServlet.init(CFMLServlet.java:42)
     at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1106)
     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1063)
     at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:960)
     at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4673)
     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4980)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1328)
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1318)
     at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
     at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
     at java.base/java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
     at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
     at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:795)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1328)
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1318)
     at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
     at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
     at java.base/java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
     at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
     at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:249)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
     at org.apache.catalina.core.StandardService.startInternal(StandardService.java:428)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
     at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:923)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
     at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.base/java.lang.reflect.Method.invoke(Unknown Source)
     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:347)
     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
Caused by: java.lang.ClassNotFoundException: com.sun.jdi.Bootstrap not found by lucee.core [41]
     at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1591)
     at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
     at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1976)
     at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
     ... 60 more

Proper settings and Unverified Breakpoint

I'm struggling to understand the correct syntax to set this up in VSCode. I am using Commandbox with the host-updater module so each dev site runs on port 443 with its own hostname. My hosts file would look similar to this:

127.127.0.30     test1.dev.local
127.127.0.31     test2.dev.local

In this setup, I'm unsure where to put what in the jvm args? Using the stock settings in the docs, but with my path to the jar, results in an error starting up the server:

agent library failed to init: instrument

I get closer when I replace "localhost" with my host file's hostname (e.g. "test1.dev.local"). The server starts and when I start the debug profile the "CALL STACK" panel fills up, but then I get the "unverified breakpoint" discussed in issue #18

I also tried replacing the cfHost (and corresponding "hostname" in the launch.json) to test1.dev.local, but suffer the exact same results.

It would probably help if I better understood what "localhost" is meant to refer to in the agentlib address as well as the jdwpHost and also what cfHost should refer to when NOT in a dockerized setting?

Deal with Large Class Files

Enhancement Opportunity: Consider large class files

In #3, we discovered that large class files were causing server startup to fail, so a workaround was added to ignore large class files.

However, @zspitzer mentioned that Lucee has the ability to split large class files: #3 (comment)

Could you outline the solution, @zspitzer? Is it all on the Lucee side? How does one enable it and what are the pros and cons?

Exception while attempting classfile rewrite

Hi, I'm getting the following in the last two releases of luceedebug

[luceedebug] exception during attempted classfile rewrite
org/apache/felix/framework/Felix
java.lang.ClassCircularityError: org/apache/felix/framework/Felix

It looks like its trying to load the one wrapped here https://github.com/softwareCobbler/luceedebug/blob/master/luceedebug/src/main/java/luceedebug/instrumenter/Felix.java as well as the main one. I've tried ignoring the default one with my class loader without success.

Extension Installation Questions & Target CFML

These might be very basic questions but I'm new to VS Code, much less VS Code non-marketplace extensions and VS Code debuggers. (I come from Eclipse => IntelliJ.)

I'm not sure how the luceedebug extension gets installed into VS Code. (Or how to uninstall it once it's installed.)

On a possibly related note, I'm not sure what the recommended way is to incorporate this into one's own CFML project. I can cd vscode-client && code ., then open my CFML project source root folder, but that's clunky to do each time and for each project.

Note that I don't really know about VS Code workspaces yet, so please be explicit about if/how to use them for setup of one's project.

Could you explain those, please?

Version/Tag the Agent

I tend to pin versions of dependencies to prevent surprises; however, the agent, itself doesn't have version tags.

I do this in my Dockerfile, but tags would be cleaner:

RUN git clone https://github.com/softwareCobbler/luceedebug.git /tmp/luceedebug \
  && cd /tmp/luceedebug \
  && git checkout 6c5e3ff3641773ba57ff0f5ff36346e2acdac495 # 5/17/23

Upgrade:

RUN git clone https://github.com/softwareCobbler/luceedebug.git /tmp/luceedebug \
  && cd /tmp/luceedebug \
  && git checkout 91d662287f2a69271a476d949c034b2cb4e3cf19 # 6/2/23

That's workable but it would be more standard to use tags.

I realize that we kinda have two projects in one here, the VS Code Extension and the Agent, which complicates things a little.

However, I don't see why we couldn't have two different tagging schemes going on and it looks like you foresaw it because you're namespacing the VS Code Extension tags like vsclient/2.0.5. Maybe something like serveragent/x.x.x would work?

move server init to earlier in lifecycle

Right now the dap server and jdwp connections are initialized in response to Lucee loading PageContextImpl. This require users to "prime" the engine, by making a typical http request to it first. Investigate moving networking init to earlier in the lifecycle, optimally during agent premain.

Lucee Extension?

It looks as though you've got at least the beginnings of a Lucee extension build?

How far along is that and what's the end goal? I'm assuming that will be the end-user way to install the agent? Then maybe there will be a Lucee admin interface for configuring the debug port, etc.?

How to Run Tests?

I mentioned this in #45 but wanted to create a separate ticket for it.

How does one set up and run tests?

Here's what happens when I try. (Note that docker is running.)

luceedebug % docker ps       
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

luceedebug % docker --version
Docker version 20.10.17, build 100c701

luceedebug % ./gradlew test                  
Setting maxParallelForks to 12

> Task :luceedebug:test

EvaluatesAnExpression > a() STANDARD_ERROR
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

StepsToFinallyAndThenCatchSkippingPastUnwoundLines > a() STANDARD_ERROR
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

SteppingWorksAsExpectedOnSinglelineStatementWithManySubexpressions > a() STANDARD_ERROR
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

HitsABreakpointAndRetrievesVariableInfo > a() STANDARD_ERROR
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

SteppingThroughDefaultArgs > a() STANDARD_ERROR
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

HitsABreakpointAndRetrievesVariableInfo > a() FAILED
    org.opentest4j.AssertionFailedError at HitsABreakpointAndRetrievesVariableInfo.java:59

SteppingThroughDefaultArgs > a() FAILED
    org.opentest4j.AssertionFailedError at SteppingThroughDefaultArgs.java:58

EvaluatesAnExpression > a() FAILED
    org.opentest4j.AssertionFailedError at EvaluatesAnExpression.java:57

SteppingWorksAsExpectedOnSinglelineStatementWithManySubexpressions > a() FAILED
    org.opentest4j.AssertionFailedError at SteppingWorksAsExpectedOnSinglelineStatementWithManySubexpressions.java:57

StepsToFinallyAndThenCatchSkippingPastUnwoundLines > a() FAILED
    org.opentest4j.AssertionFailedError at StepsToFinallyAndThenCatchSkippingPastUnwoundLines.java:57

5 tests completed, 5 failed

> Task :luceedebug:test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':luceedebug:test'.
> There were failing tests. See the report at: file:///Users/jjackson/projects/luceedebug/luceedebug/build/reports/tests/test/index.html

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 22s
6 actionable tasks: 4 executed, 2 up-to-date

The report shows this as the root cause: org.opentest4j.AssertionFailedError: server is up ==> expected: <true> but was: <false>

Connection Refused on port 9999 on Lucee 5.4.0.23

[luceedebug] Loaded luceedebug.coreinject.DebugManager@4269aad7 with ClassLoader 'lucee.core [45]'
[luceedebug] instrumented PageContextImpl <clinit> called spawnWorker...
[luceedebug] attempting jdwp self connect to jdwp on localhost:9999...
java.net.ConnectException: Connection refused
        at java.base/sun.nio.ch.Net.connect0(Native Method)
        at java.base/sun.nio.ch.Net.connect(Net.java:579)
        at java.base/sun.nio.ch.Net.connect(Net.java:568)
        at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
        at java.base/java.net.Socket.connect(Socket.java:633)
        at jdk.jdi/com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:261)
        at jdk.jdi/com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:119)
        at jdk.jdi/com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:83)
        at luceedebug.coreinject.DebugManager.jdwpSelfConnect(DebugManager.java:79)
        at luceedebug.coreinject.DebugManager.spawnWorker(DebugManager.java:51)
        at luceedebug.LuceeTransformer.transform(LuceeTransformer.java:105)
        at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:244)
        at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:541)
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2312)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClassParallel(BundleWiringImpl.java:2130)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2064)
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1533)
        at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:78)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1950)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
        at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)
        at java.base/java.lang.Class.getMethodsRecursive(Class.java:3543)
        at java.base/java.lang.Class.getMethod0(Class.java:3529)
        at java.base/java.lang.Class.getMethod(Class.java:2225)
        at lucee.loader.engine.CFMLEngineFactory.getEngine(CFMLEngineFactory.java:1468)
        at lucee.loader.engine.CFMLEngineFactory.initEngine(CFMLEngineFactory.java:384)
        at lucee.loader.engine.CFMLEngineFactory.initEngineIfNecessary(CFMLEngineFactory.java:262)
        at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:168)
        at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:202)
        at lucee.loader.servlet.LuceeServlet.init(LuceeServlet.java:42)
        at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1124)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1079)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:971)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4829)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5143)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1141)
        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1876)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1053)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:428)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1585)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:969)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)

Create Pipeline & Releases

Enhancement: So not everybody has to build from source: Create pipeline to release pre-built Jars.

This could also be a stepping stone toward a *.lex (extension) builder #12.

I may take a stab at this, myself, if I get a chance.

java.lang.NullPointerException on Lucee Restart

When restarting Lucee via the admin UI, the NullPointerException below is thrown. The service starts as expected and Luceedebug is fully operational until restarting.

If I remove these 2 jvm args, the service will restart as expected,

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

Lucee 5.3.10.97
Lucee Debug @ 084fa57
Docker Commandbox
Ubuntu Linux

[INFO] 2023-05-26T05:29:33Z - 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.8.3
[INFO ] runwar.server: Binding HTTP on 0.0.0.0:80
[INFO ] runwar.server: Enabling HTTP/2
[INFO ] runwar.server: Binding SSL on 0.0.0.0:443
[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.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@2b10ace9 with ClassLoader 'lucee.core [49]'
[INFO ] runwar.context: [luceedebug] attempting jdwp self connect to jdwp on localhost:9999...
[INFO ] runwar.context: [luceedebug] jdwp self connect OK
[INFO ] runwar.server: ******************************************************************************
[INFO ] runwar.server: *** starting 'stop' listener thread - Host: 0.0.0.0 - Socket: 34723
[INFO ] runwar.server: ******************************************************************************
[INFO ] runwar.server: Server is up - http-port:80 https-port:443 stop-port:34723 PID:1 version 4.8.3
[ERROR] runwar.context: java.lang.NullPointerException
[ERROR] runwar.context: 	at luceedebug.LuceeTransformer.transform(LuceeTransformer.java:96)
[ERROR] runwar.context: 	at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:246)
[ERROR] runwar.context: 	at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
[ERROR] runwar.context: 	at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:563)
[ERROR] runwar.context: 	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
[ERROR] runwar.context: 	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
[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(ClassLoader.java:522)
[ERROR] runwar.context: 	at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
[ERROR] runwar.context: 	at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3166)
[ERROR] runwar.context: 	at java.base/java.lang.Class.getMethodsRecursive(Class.java:3307)
[ERROR] runwar.context: 	at java.base/java.lang.Class.getMethod0(Class.java:3293)
[ERROR] runwar.context: 	at java.base/java.lang.Class.getMethod(Class.java:2106)
[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._restart(CFMLEngineFactory.java:617)
[ERROR] runwar.context: 	at lucee.loader.engine.CFMLEngineFactory.restart(CFMLEngineFactory.java:596)
[ERROR] runwar.context: 	at lucee.runtime.config.XMLConfigAdmin.restart(XMLConfigAdmin.java:3947)
[ERROR] runwar.context: 	at lucee.runtime.tag.Admin.doRestart(Admin.java:947)
[ERROR] runwar.context: 	at lucee.runtime.tag.Admin._doStartTag(Admin.java:876)
[ERROR] runwar.context: 	at lucee.runtime.tag.Admin.doStartTag(Admin.java:364)
[ERROR] runwar.context: 	at restart_cfm$cf.__luceedebug__call(/admin/restart.cfm:6)
[ERROR] runwar.context: 	at restart_cfm$cf.call(/admin/restart.cfm)
[ERROR] runwar.context: 	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1025)
[ERROR] runwar.context: 	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:948)
[ERROR] runwar.context: 	at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:219)
[ERROR] runwar.context: 	at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44)
[ERROR] runwar.context: 	at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2493)
[ERROR] runwar.context: 	at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2478)
[ERROR] runwar.context: 	at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2449)
[ERROR] runwar.context: 	at lucee.runtime.engine.Request.exe(Request.java:45)
[ERROR] runwar.context: 	at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1216)
[ERROR] runwar.context: 	at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1162)
[ERROR] runwar.context: 	at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97)
[ERROR] runwar.context: 	at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51)
[ERROR] runwar.context: 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
[ERROR] runwar.context: 	at org.cfmlprojects.regexpathinfofilter.RegexPathInfoFilter.doFilter(RegexPathInfoFilter.java:47)
[ERROR] runwar.context: 	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
[ERROR] runwar.context: 	at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
[ERROR] runwar.context: 	at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
[ERROR] runwar.context: 	at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
[ERROR] runwar.context: 	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:405)
[ERROR] runwar.context: 	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
[ERROR] runwar.context: 	at runwar.undertow.SSLClientCertHeaderHandler.handleRequest(SSLClientCertHeaderHandler.java:144)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
[ERROR] runwar.context: 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
[ERROR] runwar.context: 	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
[ERROR] runwar.context: 	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
[ERROR] runwar.context: 	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
[ERROR] runwar.context: 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52)
[ERROR] runwar.context: 	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:275)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:79)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131)
[ERROR] runwar.context: 	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
[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.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:79)
[ERROR] runwar.context: 	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:100)
[ERROR] runwar.context: 	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
[ERROR] runwar.context: 	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:852)
[ERROR] runwar.context: 	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR] runwar.context: 	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2019)
[ERROR] runwar.context: 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1558)
[ERROR] runwar.context: 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1449)
[ERROR] runwar.context: 	at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
[ERROR] runwar.context: 	at java.base/java.lang.Thread.run(Thread.java:829)

image

Why can't be bundled luceedebug.jar in VS Code extension?

I suppose there's no way to run this extension without the jar file.
So my question is, why can't be bundled luceedebug.jar in VS Code extension?
It's something OS specific. In that case we can include some major OS versions no?

Improved Inspection of CFML Data Structures?

lucedebug is already great, but I'm looking ahead...

For a good percentage of use cases, the variable inspection for query objects probably isn't going to be adequate, without copying the value to clipboard and pasting it to file. (I'm happy to have the existing stringified version available to paste, though. It's a good workaround.)

In this screen shot, you can see the hover-over display of the stringified query object and in the right pane, you can see the full stringified query object that I've pasted in.

image

I haven't tried VS Code with (for instance) Java yet, but I wonder if, say, Java ResultSets are rendered in a more structured way or if the VS Code debugger is always limited in this way.

Debugger failed to attach: handshake failed

When I click the "Start Debugging (F5)" button it tries to connect and then I see an error in the Lucee console:

Debugger failed to attach: handshake failed - received >Content-Length< - expected >JDWP-Handshake<

Support for Other IDEs?

Lots of questions, since I've wanted an IDE-based step debugger for CFML for almost a quarter of a century now...

What made you choose VS Code as the IDE for luceedebug? Was it a personal preference for VS Code? Is VS Code inherently friendlier to CFML debugging than other IDEs?

Having an agent-based step debugger for Lucee in an IDE (VS Code) is going to be a game changer for me, versus the web app solutions (FusionReactor, coldbug) but I'll have to bounce around between my preferred IDE (IntelliJ) and VS Code in order to do step debugging. (Or I can obviously switch completely to VS Code, but I already tried them both a while back and landed on IntelliJ.)

Performance Overhead

It appears that having the luceedebug.jar installed has a significant performance overhead.

The results below is a snippet of some integration test output, with and without the luceedebug.jar loaded via java args.

Note that I don't have the step debugger running in vscode, it's simply installed, and running my test suite.

I'm happy to live with a bit of overhead, but my test suite's execution time goes from 6 mins to 28 mins.

I concede that the "listings" controller does a fair bit of work, but the "mfadevices" controller really does not. Interestingly, the memory and CPU don't really run as high as I would have expected in relation to the response time.

Without luceedebug.jar loaded

listings.converttolisting 1693ms
listings.create 2706ms
listings.details 3116ms
listings.documents 1105ms
listings.edit 3300ms
listings.index 820ms
listings.listingfields.create 334ms
listings.listingfields.update 214ms
listings.modalform 618ms
listings.new 2732ms
listings.update 2210ms
listings.updatesettle 1686ms
mfadevices.create 128ms
mfadevices.delete 117ms
mfadevices.edit 171ms
mfadevices.new 62ms
mfadevices.show 217ms

With luceedebug.jar loaded

listings.converttolisting 7559ms
listings.create 16588ms
listings.details 16522ms
listings.documents 5013ms
listings.edit 28354ms
listings.index 4004ms
listings.listingfields.create 1328ms
listings.listingfields.update 824ms
listings.modalform 2508ms
listings.new 29730ms
listings.update 16355ms
listings.updatesettle 7555ms
mfadevices.create 613ms
mfadevices.delete 798ms
mfadevices.edit 1316ms
mfadevices.new 357ms
mfadevices.show 1688ms

image

I'm happy to help wherever I can.

java.lang.OutOfMemoryError: Java heap space after loading numerous pages

After sitting idle for an hour or so loading numerous pages (debugger not started in vscode), the stdout shows as below

[INFO ] runwar.context: [luceedebug] Loaded luceedebug.coreinject.DebugManager@2e53b094 with ClassLoader 'lucee.core [49]'
[INFO ] runwar.context: [luceedebug] attempting jdwp self connect to jdwp on localhost:9999...
[INFO ] runwar.context: [luceedebug] jdwp self connect OK
[INFO ] runwar.server: ******************************************************************************
[INFO ] runwar.server: *** starting 'stop' listener thread - Host: 0.0.0.0 - Socket: 43951
[INFO ] runwar.server: ******************************************************************************
[INFO ] runwar.server: Server is up - http-port:80 stop-port:43951 PID:1 version 4.8.3

.... making 10-20 requests to various application pages ....

[ERROR] runwar.context: Exception in thread "JDI Target VM Interface" 
[ERROR] runwar.context: java.lang.OutOfMemoryError: Java heap space
[ERROR] runwar.context: java.lang.OutOfMemoryError: Java heap space
[ERROR] runwar.context: 	at org.apache.commons.pool2.impl.GenericObjectPool.evict(GenericObjectPool.java:718)
[ERROR] runwar.context: 	at org.apache.commons.pool2.impl.BaseGenericObjectPool$Evictor.run(BaseGenericObjectPool.java:1138)
[ERROR] runwar.context: 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[ERROR] runwar.context: 	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
[ERROR] runwar.context: 	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
[ERROR] runwar.context: 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[ERROR] runwar.context: 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[ERROR] runwar.context: 	at java.base/java.lang.Thread.run(Thread.java:829)

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "XNIO-1 I/O-5"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-6"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-489"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "java-sdk-http-connection-reaper"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "XNIO-1 Accept"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "commons-pool-evictor-thread"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "XNIO-1 I/O-6"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-395"
^[[1;2D
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "luceedebug-worker"

It looks like the heap is not being garbage collected..

image

I'm running 2 lucee containers in Docker behind an nginx proxy. Ports 10000 and 10001
Linux Mint
Lucee 5.3.10.97
Commandbox: commandbox:jdk11-alpine-3.7.0

JVM Settings:

"jvm": {
	"minHeapSize": 256,
	"heapSize": 1024,
	"args": [
		"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:9999",
		"-javaagent:/app/lib/luceedebug.jar=jdwpHost=localhost,jdwpPort=9999,debugHost=0.0.0.0,debugPort=10000,jarPath=/app/lib/luceedebug.jar"
	]
}

Support Multiple `pathTransform` Mappings

I think I need multiple pathTransforms.

I think (because I'm new to vs code) I want a multi-root workspace as follows:

  • my_site_cfml
  • mura_cfml

Since I bake the Mura core into my image, it's not available in my_site_cfml. I have Mura checked out separately.

I'd want something like:

"pathTransform": [
  {
    "idePrefix": "${workspaceFolder}/cfml/deployment_root",
    "cfPrefix": "/var/www"
  },
  {
    // not sure the most semantic way to specify this path in vs code, but this would probably work
    "idePrefix": "${workspaceFolder}/../hudx_mura_fork/app/core",
    "cfPrefix": "/var/www/wwwroot/core/"
  },
]

I could probably work around it with symlinks or something, but it would be good to have native support.

It might get a little tricky because layering would need to be accommodated. (It would probably make sense to have increasing precedent as you append to the pathTransform array.

use lucee light?

awesome project!

I noticed you have included the fat jar (i.e with all the extensions bundled), i I don't know if you need all the extensions for this to work, if not you could try using lucee light?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.