NPE in hotswap agent on an embedded Jetty 9

瀏覽次數:92 次
跳到第一則未讀訊息

Евгений Науменко

未讀,
2015年11月17日 下午3:03:262015/11/17
收件者:HotswapAgent
Hello everyone,

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.

vladimir dvorak

未讀,
2015年11月18日 凌晨2:25:172015/11/18
收件者:HotswapAgent
The fix (Issue 97) should be available in repo. Do clone last version from repo and build hotswap-agent.jar.

Евгений Науменко

未讀,
2015年11月18日 清晨5:09:082015/11/18
收件者:HotswapAgent
Thanks a lot, the latest version seems to have the problem fixed.
回覆所有人
回覆作者
轉寄
0 則新訊息