Caused by: java.lang.VerifyError: Failed to link com/fasterxml/jackson/databind/type/ReferenceType: Cannot inherit from final class Caused by: java.lang.VerifyError: Failed to link com/fasterxml/jackson/databind/type/ReferenceType: Cannot inherit from final class mongodb mongodb

Caused by: java.lang.VerifyError: Failed to link com/fasterxml/jackson/databind/type/ReferenceType: Cannot inherit from final class


The spring boot 2.0 war created by the maven or gradle war plugin will work on jboss EAP 7.1. The same war file will through an exception on jboss EAP 7.0 server.

The exception is java.lang.VerifyError: Failed to link com/fasterxml/jackson/databind/type/ReferenceType

The deployment exception arises becuse the jboss has it own jackson library and a class loading time verification error occours.

SOLUTION :The solution to this problem is to add a jboss specific xml file named jboss-deployment-structure.xml in to the WEB-INF folder.

<?xml version='1.0' encoding='UTF-8'?><jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1"><deployment><exclusions><module name="com.fasterxml.jackson.core.jackson-annotations" /><module name="com.fasterxml.jackson.core.jackson-core" /><module name="com.fasterxml.jackson.core.jackson-databind" /><module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" /><module name="org.jboss.resteasy.resteasy-jackson2-provider" /><module name="org.slf4j" /></exclusions></deployment></jboss-deployment-structure>


I Have the same error while runnig the application in EAP 6.4 as belowI have migrated to EAP 7.1.0 and the error got resolved and application is runnig fine. This is because of the older version of jakson jars in jboss EAP6 please refer to https://issues.jboss.org/browse/JBEAP-5189 now its resolved in 7.x version

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'httpPutFormContentFilter' defined in class path resourc [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is orgspringframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.filter.OrderedHttpPutFormContentFilter]: Facory method 'httpPutFormContentFilter' threw exception; nested exception is java.lang.VerifyError: Failed to link com/fasterxml/jackson/databind/type/RefernceType (Module "deployment.acsm.ear.CCP-API-0.0.1-SNAPSHOT.war:main" from Service Module Loader): Cannot inherit from final class        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:587)        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.jva:1254)        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1103)        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:541)        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:225)        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:181)        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:176)        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAdaptableBeans(ServletContextInitializerBeans.java:158)        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:80)        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationCotext.java:250)        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:237)        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:183)        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152)        ... 18 moreCaused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.filter.OrderedHttpPutFormContntFilter]: Factory method 'httpPutFormContentFilter' threw exception; nested exception is java.lang.VerifyError: Failed to link com/fasterxml/jackson/dataind/type/ReferenceType (Module "deployment.acsm.ear.CCP-API-0.0.1-SNAPSHOT.war:main" from Service Module Loader): Cannot inherit from final class        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:579)        ... 35 moreCaused by: java.lang.VerifyError: Failed to link com/fasterxml/jackson/databind/type/ReferenceType (Module "deployment.acsm.ear.CCP-API-0.0.1-SNAPSHOT.warmain" from Service Module Loader): Cannot inherit from final class        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)