I've tried DCEVM recently and it works like a charm. As a next step I'd like to integrate hotswap agent, but it keeps throwing NPEs on application start:
Listening for transport dt_socket at address: 8000
HOTSWAP AGENT: 22:45:7.174 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent {0.3.0-SNAPSHOT} - unlimited runtime class redefinition.
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
FATAL ERROR in native method: processing of -javaagent failed
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:382)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:397)
Caused by: java.lang.NullPointerException
at org.hotswap.agent.config.PluginConfiguration.<init>(PluginConfiguration.java:44)
at org.hotswap.agent.config.PluginManager.init(PluginManager.java:95)
at org.hotswap.agent.HotswapAgent.premain(HotswapAgent.java:42)
... 6 more
Application itself is a jar file with an embedded Jetty 9 inside launched by Gradle as follows:
javaexec {
main = '-jar'
args jar.archivePath
jvmArgs = ['-XXaltjvm=dcevm',
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000",
"-javaagent:${configurations.hot_swap.asPath}=autoHotswap=true"]
}
I've tried it on different machines, with or without plugins, with DCEVM installed as altvm or as a replacement, but to no avail.
Here's the simplified version of the project I'm trying to run. Calling './gradlew runJar' results in an aforementioned exception.
Any advice and suggestions will be greatly appreciated.