spring-loaded: Spring boot JDK Problem ? - Problems copying method. Incompatible JVM?

I am havening trouble using spring loaded with whatever. I am getting org.springsource.loaded.jvm.JVM : Problems copying method. Incompatible JVM?

Maybe this is JDK issue

the same thing happens if I swap JVM

openjdk version “1.8.0_40” OpenJDK Runtime Environment (build 1.8.0_40-b20) OpenJDK 64-Bit Server VM (build 25.40-b23, mixed mode)

java version “1.7.0_55” OpenJDK Runtime Environment (IcedTea 2.4.8) (suse-24.17.1-x86_64) OpenJDK 64-Bit Server VM (build 24.55-b03, mixed mode)

java version “1.6.0_33” OpenJDK Runtime Environment (IcedTea6 1.13.5) (suse-37.1-x86_64) OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode

Any ideas ?

Here ist stack

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Spring Boot Web UI Sample 1.2.2.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> spring-boot-maven-plugin:1.2.2.BUILD-SNAPSHOT:run (default-cli) > test-compile @ spring-boot-sample-web-ui >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ spring-boot-sample-web-ui ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 9 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ spring-boot-sample-web-ui ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ spring-boot-sample-web-ui ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/user/github/spring-boot/spring-boot-samples/spring-boot-sample-web-ui/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ spring-boot-sample-web-ui ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] <<< spring-boot-maven-plugin:1.2.2.BUILD-SNAPSHOT:run (default-cli) < test-compile @ spring-boot-sample-web-ui <<<
[INFO] 
[INFO] --- spring-boot-maven-plugin:1.2.2.BUILD-SNAPSHOT:run (default-cli) @ spring-boot-sample-web-ui ---
[INFO] Attaching agents: [/home/user/.m2/repository/org/springframework/springloaded/1.2.0.RELEASE/springloaded-1.2.0.RELEASE.jar]

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::  (v1.2.2.BUILD-SNAPSHOT)

2015-01-10 19:28:22.833  INFO 29434 --- [           main] sample.ui.SampleWebUiApplication         : Starting SampleWebUiApplication on XXXXXXXXX with PID 29434 (/home/user/github/spring-boot/spring-boot-samples/spring-boot-sample-web-ui/target/classes started by user in /home/user/github/spring-boot/spring-boot-samples/spring-boot-sample-web-ui)
2015-01-10 19:28:22.946  INFO 29434 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@37574691: startup date [Sat Jan 10 19:28:22 CET 2015]; root of context hierarchy
2015-01-10 19:28:23.146 ERROR 29434 --- [           main] org.springsource.loaded.jvm.JVM          : Problems copying method. Incompatible JVM?

java.lang.reflect.InvocationTargetException: null
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springsource.loaded.jvm.JVM.copyMethod(JVM.java:134)
        at org.springsource.loaded.ri.OriginalClassInvoker.createJavaMethod(OriginalClassInvoker.java:68)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlClassGetDeclaredMethods(ReflectiveInterceptor.java:151)
        at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:140)
        at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:286)
        at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:226)
        at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:193)
        at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:163)
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:306)
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:239)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462)
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:961)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:950)
        at sample.ui.SampleWebUiApplication.main(SampleWebUiApplication.java:43)
Caused by: java.lang.IllegalArgumentException: Can not copy a non-root Method
        at java.lang.reflect.Method.copy(Method.java:151)
        ... 24 common frames omitted

2015-01-10 19:28:23.149 ERROR 29434 --- [           main] org.springsource.loaded.jvm.JVM          : Problems copying method. Incompatible JVM?

java.lang.reflect.InvocationTargetException: null
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.springsource.loaded.jvm.JVM.copyMethod(JVM.java:134)
        at org.springsource.loaded.ri.OriginalClassInvoker.createJavaMethod(OriginalClassInvoker.java:68)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlClassGetDeclaredMethods(ReflectiveInterceptor.java:151)
        at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:140)
        at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:286)
        at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:226)
        at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:193)
        at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:163)
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:306)
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:239)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254)
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94)
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462)
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:961)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:950)
        at sample.ui.SampleWebUiApplication.main(SampleWebUiApplication.java:43)
Caused by: java.lang.IllegalArgumentException: Can not copy a non-root Method
        at java.lang.reflect.Method.copy(Method.java:151)
        ... 24 common frames omitted

2015-01-10 19:28:23.151 ERROR 29434 --- [           main] org.springsource.loaded.jvm.JVM          : Problems copying method. Incompatible JVM?

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Comments: 25 (10 by maintainers)

Commits related to this issue

Most upvoted comments

So one liner to fix Grails installed with GVM in Linux (worked for me with OpenJDK 1.8.0_40-internal-b27): wget repo.spring.io/libs-snapshot-local/org/springframework/springloaded/1.2.3.BUILD-SNAPSHOT/springloaded-1.2.3.BUILD-SNAPSHOT.jar -O ~/.gvm/grails/2.4.4/lib/org.springframework/springloaded/jars/springloaded-1.2.1.RELEASE.jar

Will we get a new Grails 2.4 release?

Oops nevermind. I was using grails-maven-plugin 2.4.3 which was bringing in springloaded 1.2.0. I upgraded to grails-maven-plugin 2.4.6 which uses springloaded-1.2.4 and the issue was resolved.

I’m experiencing this issue, but with Grails 2.5.1 (which uses springloaded-1.2.4.RELEASE), and the latest version of Java 8 (build 1.8.0_112). It’s all very confusing as most of the comments here seem to indicate that I shouldn’t experience this issue in 1.2.4.