IntellJ Idea tomcat Hot swap failed: schema change not implemented Operation not supported by VM

I got this error when I try to reload a class (hot swap) using the modified method bodies in my project. Before everything works fine, but suddenly it will stop, and I do not remember anything that could be the reason. It is strange that I have another project with the same setup, and a hot swap for the method bodies works fine.

Here is the configuration for the non-working project:

enter image description here

enter image description here

And my VM settings:

-XX:PermSize=512m -XX:MaxPermSize=1024m -Xms1024m -Xmx2048m -Dcatalina.home="C:\Programy\apache-tomcat-7.0.57" -Djava.endorsed.dirs="C:\Programy\apache-tomcat-7.0.57\endorsed" -javaagent:C:\Programy\apache-tomcat-7.0.57/lib/spring-instrument-3.1.2.RELEASE.jar -Dspring.profiles.active=closeMonthTest -Dnpk.jobs.enabled=true 

and here is the configuration for my working draft:

enter image description here

enter image description here

VM parameters:

 -XX:PermSize=512m -XX:MaxPermSize=1024m -Xms1024m -Xmx2048m -Dcatalina.home="C:\Programy\apache-tomcat-7.0.57" -Djava.endorsed.dirs="C:\Programy\apache-tomcat-7.0.57\endorsed" -javaagent:C:\Programy\apache-tomcat-7.0.57/lib/spring-instrument-3.1.2.RELEASE.jar -Dspring.profiles.active=test 
+7
intellij-idea tomcat tomcat7 jvm-hotspot hotswap
source share
1 answer

It is very difficult to find the root cause without code. However, I can write an artificial test case when the Java compiler will create synthetic methods, even if I just changed the body of the method:

 public class Test { static class Inner { private void getPrivate(int i) { Thread.dumpStack(); } private void getPrivate() { Thread.dumpStack(); } } public static void main(String[] args) { Inner inner = new Inner(); inner.getPrivate(0); inner.getPrivate(); } } 

This effect is due to the synthetic access method $ 000 that javac generates to access a private member of the Inner class.

 javac Test.java javap -c -private Test\$Inner 
  ... static void access$000(edu.Test$Inner, int); Code: 0: aload_0 1: iload_1 2: invokespecial #2 // Method getPrivate:(I)V 5: return static void access$100(edu.Test$Inner); Code: 0: aload_0 1: invokespecial #1 // Method getPrivate:()V 4: return 

Reorder the two methods basically:

  public static void main(String[] args) { Inner inner = new Inner(); inner.getPrivate(); inner.getPrivate(0); } 

As a result, the compiler changed the signature methods.

  ... static void access$000(edu.Test$Inner); Code: 0: aload_0 1: invokespecial #2 // Method getPrivate:()V 4: return static void access$100(edu.Test$Inner, int); Code: 0: aload_0 1: iload_1 2: invokespecial #1 // Method getPrivate:(I)V 5: return 

From the point of view of HotSwap, this change is prohibited because the signature of the access$000 method has been changed.

+7
source share

All Articles