DevTools - java.lang.LinkageError: loader constraint violation in interface itable initialization
See original GitHub issueTrying to use axon-framework with spring boot 2.1.4. When I add spring-boot-devtools dependency I get the following exception:
java.lang.LinkageError: loader constraint violation in interface itable initialization for class org.axonframework.spring.config.AxonConfiguration: when selecting method org.axonframework.config.Configuration.resourceInjector()Lorg/axonframework/modelling/saga/ResourceInjector; the class loader 'app' (instance of jdk.internal.loader.ClassLoaders$AppClassLoader) for super interface org.axonframework.config.Configuration, and the class loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader @3acec512 (instance of org.springframework.boot.devtools.restart.classloader.RestartClassLoader, child of 'app' jdk.internal.loader.ClassLoaders$AppClassLoader) of the selected method's type, org.axonframework.spring.config.AxonConfiguration have different Class objects for the type org.axonframework.modelling.saga.ResourceInjector used in the signature
at java.base/java.lang.Class.getDeclaredMethods0(Native Method) ~[na:na]
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3167) ~[na:na]
at java.base/java.lang.Class.getDeclaredMethods(Class.java:2310) ~[na:na]
at org.axonframework.common.ReflectionUtils.methodsOf(ReflectionUtils.java:229) ~[axon-messaging-4.1.1.jar:4.1.1]
at org.axonframework.spring.config.SpringAxonAutoConfigurer.lambda$registerEventHandlerRegistrar$42(SpringAxonAutoConfigurer.java:254) ~[axon-spring-4.1.1.jar:4.1.1]
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[na:na]
at org.axonframework.spring.config.SpringAxonAutoConfigurer.registerEventHandlerRegistrar(SpringAxonAutoConfigurer.java:248) ~[axon-spring-4.1.1.jar:4.1.1]
at org.axonframework.spring.config.SpringAxonAutoConfigurer.registerBeanDefinitions(SpringAxonAutoConfigurer.java:214) ~[axon-spring-4.1.1.jar:4.1.1]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromRegistrars$1(ConfigurationClassBeanDefinitionReader.java:364) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) ~[na:na]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:363) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:145) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) ~[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) ~[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) ~[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) ~[spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
at pm.mbo.easyway.api.app.AppApi.main(AppApi.java:10) ~[main/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.1.4.RELEASE.jar:2.1.4.RELEASE]
Found #491 but couldn’t find a way to get around the exception. The only thing that works is removing devtools…
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
java.lang.LinkageError: loader constraint violation in interface ...
The exception is thrown because in your web application at least exists a jar which contains the javax.xml.namespace.
Read more >java.lang.LinkageError: loader constraint ... - Quest Support
Unable to start JBoss server due to java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolvin ...
Read more >java.lang.LinkageError: loader constraint violation in interface ...
java.lang.LinkageError: loader constraint violation in interface itable initialization. LinkageError occurs while invoking published services.
Read more >LinkageError with Spring Boot Developer tools | Arlo O'Keeffe
Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "com.sun.proxy.$Proxy203.
Read more >WebLogic Run error java.lang.LinkageError:loader constraint ...
WebLogic Run error java.lang.LinkageError:loader constraint violation in interface itable initialization. Last Update:2018-07-26 Source: Internet.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
With Spring Boot (I’m currently at 2.1.3) I think I resolved devtools issues by creating a file: /src/main/resources/META-INF/spring-devtools.properties
restart.include.modelmapper=/modelmapper-(.*).jar
restart.include.axon=/axon-(.*).jar
My project was also adding/getting started with a library called modelmapper which had similar warnings for using Spring Boot Devtools. http://modelmapper.org/user-manual/spring-boot-devtools-integration/
I thought why not try the same workaround for Axon? And so far so good for a number of months now and a few Spring Boot version bumps. I don’t know where this workaround may fall flat for others…
I have the same issue, and I have solved with @thydian workaround.