HotswapProjects / HotswapAgent

Java unlimited redefinition of classes at runtime.
GNU General Public License v2.0
2.36k stars 493 forks source link

NPE on eclipse + tomcat, java 1.7 #94

Closed maximilia closed 9 years ago

maximilia commented 9 years ago

I followed the instruction from http://www.hotswapagent.org/quick-start When I run tomcat in debug mode from my eclipse, this is what I got:

HOTSWAP AGENT: 14:55:48.326 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) 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.(PluginConfiguration.java:44) at org.hotswap.agent.config.PluginManager.init(PluginManager.java:95) at org.hotswap.agent.HotswapAgent.premain(HotswapAgent.java:42) ... 6 more FATAL ERROR in native method: processing of -javaagent failed

The NPE happened because the classloader is null. Any idea? Thanks in advance.

skybber commented 9 years ago

It looks very strange. I'm using the same configuration - tomcat/openjdk1.7 on daily basis without any problems. Does the openjdk version match with dcevm? Try to follow Eclipse-specific instructions from wiki https://github.com/HotswapProjects/HotswapAgent/wiki/Eclipse-setup.

maximilia commented 9 years ago

I am using java-7-oracle instead of openjdk. My java version is 1.7.0_80 while the dcevm is 1.7.0_79.

skybber commented 9 years ago

May be it is source of your problems. Btw don't worry to use openjdk.

maximilia commented 9 years ago

After installing openjdk 1.7.0_79, it's working now. Thanks