1

I have followed at the steps mentioned here

  1. Install “jvm.dll” DCEVM patch in JDK (Successful. DCEVM patch folder is created )
  2. In Eclipse - Tomcat Server - Runtime Environment - JRE must be mapped to the same JRE of JDK in which DECVM is patched in step-1
  3. Tomcat - Add “-XXaltjvm="dcevm" -javaagent:\HotswapAgent.jar” in VM Arguments (VM Arguments -Dcatalina.base="C:\MCA\workspaces\MCA\.metadata\.plugins\org.eclipse.wst.server.core\tmp0" -Dcatalina.home="C:\MCA\tools\apache-tomcat-7.0.54" -Dwtp.deploy="C:\MCA\workspaces\MCA\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps" -Djava.endorsed.dirs="C:\MCA\tools\apache-tomcat-7.0.54\endorsed" -XXaltjvm="dcevm" -javaagent:C:\MCA\tools\dcevm\hotswap-agent.jar)
  4. Disable “Auto Reload” in Tomcat web modules

Whenever I try to use an exception is thrown.

Below is the stack trace.

 HOTSWAP AGENT: 17:15:46.234 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent {0.3.0-SNAPSHOT} - unlimited runtime class redefinition.
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.<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
FATAL ERROR in native method: processing of -javaagent failed
Exception in thread "main" 

Java - version is

java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

Installer file downloaded from here.

Abhishek Singh
  • 10,243
  • 22
  • 74
  • 108

3 Answers3

0

Here it is described a very similar bug caused bythe same NPE that you get:

Caused by: java.lang.NullPointerException
   at org.hotswap.agent.config.PluginConfiguration.<init>(PluginConfiguration.java:44)

The solution seems to be switching from Oracle JDK to OpenJDK.

So, if you are using Oracle JDK, try to change it. If you are already using OpenJDK, forget my answer.

Hope it helps!

malaguna
  • 4,183
  • 1
  • 17
  • 33
  • How to switch from Oracle JDK to Open JDK. Will it have impact on other running applications ? – Abhishek Singh Nov 24 '15 at 13:17
  • It is another JDK implementation, so you have to remove/uninstall Oracle JDK and install OpenJDK, and then reinstall DCEVM and reconfigure Eclipse. There is not impact expected on applications, [here](http://stackoverflow.com/questions/22358071/differences-between-oracle-jdk-and-open-jdk-and-garbage-collection) you have more info. – malaguna Nov 24 '15 at 13:27
  • And how to check which jdk I am using ? – Abhishek Singh Nov 24 '15 at 13:30
  • in a shell write `java -version` it will print info about which jvm is installed – malaguna Nov 24 '15 at 13:37
  • Its there in the question. It is oracle jdk i think. – Abhishek Singh Nov 24 '15 at 13:39
  • You are right, you are using oracle jdk, so I recommend you to change it and try – malaguna Nov 24 '15 at 13:44
0

I solved this issue by changing JDK1.7_80 to JDK1.7_55.

Abhishek Singh
  • 10,243
  • 22
  • 74
  • 108
0

I had this issue when my path to the hotswap-agent was wrong.

John Deverall
  • 5,954
  • 3
  • 27
  • 37