Below is the log. When I added following maven dependency, my Spring application started to show the errors. Now, it does not start.
<dependency>
<groupId>org.jvnet.staxex</groupId>
<artifactId>stax-ex</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>com.sun.xml.stream.buffer</groupId>
<artifactId>streambuffer</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>policy</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.0.1</version>
</dependency>
It caused following error:
Aug 31, 2015 12:50:57 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'arbapiService' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.anet.api.arb.ARBAPIServiceImpl]: Constructor threw exception; nested exception is java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: Provider com.sun.xml.ws.spi.ProviderImpl could not be instantiated
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.anet.api.arb.ARBAPIServiceImpl]: Constructor threw exception; nested exception is java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: Provider com.sun.xml.ws.spi.ProviderImpl could not be instantiated
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1030)
... 22 more
Caused by: java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: Provider com.sun.xml.ws.spi.ProviderImpl could not be instantiated
at java.util.ServiceLoader.fail(Unknown Source)
at java.util.ServiceLoader.access$100(Unknown Source)
at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
at java.util.ServiceLoader$1.next(Unknown Source)
at javax.xml.ws.spi.Provider.getProviderUsingServiceLoader(Unknown Source)
at javax.xml.ws.spi.Provider.provider(Unknown Source)
at javax.xml.ws.Service.<init>(Unknown Source)
at net.authorize.services.Service.<init>(Service.java:53)
v2.runtime.reflect.Lister.getImplClass(Lister.java:116)
at com.sun.xml.bind.v2.runtime.reflect.Lister.create(Lister.java:102)
at com.sun.xml.bind.v2.runtime.property.ArrayProperty.<init>(ArrayProperty.java:26)
at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.<init>(ArrayERProperty.java:45)
at com.sun.xml.bind.v2.runtime.property.ArrayReferenceNodeProperty.<init>(ArrayReferenceNodeProperty.java:44)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:88)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:142)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:407)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:426)
at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
I found this might be version related issue of these libs . How to resolve this? I am using apache tomcat 7 and spring 3 with maven 3
Related
I have used all poi jars but still i ame getting this error
Exception in thread "main" org.apache.poi.POIXMLException:
java.lang.reflect.InvocationTargetException
at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:62)
at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:456)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:162)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:271)
at ReadExcel.readXLSXFile(ReadExcel.java:38)
at ReadExcel.main(ReadExcel.java:69)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:60)
... 5 more
Caused by: java.lang.NoClassDefFoundError: org/apache/poi/POIXMLTypeLoader
at org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument$Factory.parse(Unknown
Source)
at org.apache.poi.xssf.model.ThemesTable.(ThemesTable.java:46)
... 10 more
Caused by: java.lang.ClassNotFoundException: org.apache.poi.POIXMLTypeLoader
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 12 more
Sounds like you do not have the correct dependencies in you project.
POIXMLTypeLoader comes with POI 3.14-Beta1 and the ooxml-schemas:1.3 reference that class.You have the following options, you can add any of this dependency in your project:
use poi 3.14 beta1
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.14</version>
</dependency>
use ooxml-schemas 1.2
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.14</version>
</dependency>
I am trying to deploy my Spring boot Rest API application on Tomcat in Eclipse Mars and getting following exception while deployment.
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.boot.actuate.autoconfigure.ManagementSecurityAutoConfiguration$ManagementSecurityPropertiesConfiguration] for bean with name 'org.springframework.boot.actuate.autoconfigure.ManagementSecurityAutoConfiguration$ManagementSecurityPropertiesConfiguration' defined in null: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/boot/autoconfigure/security/SecurityPrerequisite
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1331) ~[AbstractBeanFactory.class:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:622) ~[AbstractAutowireCapableBeanFactory.class:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:591) ~[AbstractAutowireCapableBeanFactory.class:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1397) ~[AbstractBeanFactory.class:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:968) ~[AbstractBeanFactory.class:4.1.6.RELEASE]
at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:257) [BeanTypeRegistry$OptimizedBeanTypeRegistry.class:1.2.0.RELEASE]
at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.addBeanType(BeanTypeRegistry.java:246) [BeanTypeRegistry$OptimizedBeanTypeRegistry.class:1.2.0.RELEASE]
at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.getNamesForType(BeanTypeRegistry.java:227) [BeanTypeRegistry$OptimizedBeanTypeRegistry.class:1.2.0.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:154) [OnBeanCondition.class:1.2.0.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:143) [OnBeanCondition.class:1.2.0.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:115) [OnBeanCondition.class:1.2.0.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:90) [OnBeanCondition.class:1.2.0.RELEASE]
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:45) [SpringBootCondition.class:1.2.0.RELEASE]
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102) [ConditionEvaluator.class:4.1.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:190) [ConfigurationClassBeanDefinitionReader.class:4.1.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:148) [ConfigurationClassBeanDefinitionReader.class:4.1.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:124) [ConfigurationClassBeanDefinitionReader.class:4.1.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:318) [ConfigurationClassPostProcessor.class:4.1.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:239) [ConfigurationClassPostProcessor.class:4.1.6.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254) [PostProcessorRegistrationDelegate.class:4.1.6.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94) [PostProcessorRegistrationDelegate.class:4.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606) [AbstractApplicationContext.class:4.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462) [AbstractApplicationContext.class:4.1.6.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109) [EmbeddedWebApplicationContext.class:1.2.0.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) [SpringApplication.class:1.2.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321) [SpringApplication.class:1.2.0.RELEASE]
at org.springframework.boot.context.web.SpringBootServletInitializer.run(SpringBootServletInitializer.java:117) [SpringBootServletInitializer.class:1.2.0.RELEASE]
at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:108) [SpringBootServletInitializer.class:1.2.0.RELEASE]
at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:68) [SpringBootServletInitializer.class:1.2.0.RELEASE]
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) [SpringServletContainerInitializer.class:4.1.6.RELEASE]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173) [catalina.jar:8.0.9]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.0.9]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) [catalina.jar:8.0.9]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) [catalina.jar:8.0.9]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_102]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_102]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_102]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_102]
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/autoconfigure/security/SecurityPrerequisite
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_102]
at java.lang.ClassLoader.defineClass(Unknown Source) ~[na:1.8.0_102]
at java.security.SecureClassLoader.defineClass(Unknown Source) ~[na:1.8.0_102]
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2479) ~[catalina.jar:8.0.9]
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:880) ~[catalina.jar:8.0.9]
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1294) ~[catalina.jar:8.0.9]
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1177) ~[catalina.jar:8.0.9]
at org.springframework.util.ClassUtils.forName(ClassUtils.java:249) ~[ClassUtils.class:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:395) ~[AbstractBeanDefinition.class:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1349) ~[AbstractBeanFactory.class:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1320) ~[AbstractBeanFactory.class:4.1.6.RELEASE]
... 37 common frames omitted
I am not able to understand why it is not able to find the class although, I have it in my maven dependencies
spring-boot-autoconfigure-1.2.3.RELEASE.jar
Any help would be highly appreciated.
You seem to have included incorrect jar. Use spring-boot-autoconfigure-1.2.3.RELEASE.jar instead of spring-boot-autoconfigure-1.2.3.RELEASE-sources.jar
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>1.2.5.RELEASE</version>
</dependency>
SEVERE: Exception sending context initialized event to listener
instance of class
org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at
org.springframework.core.CollectionFactory.(CollectionFactory.java:64)
at
org.springframework.web.context.ContextLoader.(ContextLoader.java:153)
at
org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:44)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4544)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5016)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)
at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:738)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)
at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:289)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at
org.apache.catalina.core.StandardService.startInternal(StandardService.java:442)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:674)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.startup.Catalina.start(Catalina.java:596) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303) at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431) Caused
by: java.lang.ClassNotFoundException:
org.apache.commons.logging.LogFactory at
java.net.URLClassLoader$1.run(Unknown Source) at
java.net.URLClassLoader$1.run(Unknown Source) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(Unknown Source) at
java.lang.ClassLoader.loadClass(Unknown Source) at
sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at
java.lang.ClassLoader.loadClass(Unknown Source) ... 24 more
I am using tom cat- 7, Maven version is 4.0.0
Can you please suggest me on this..
Thanks in advance
commons-logging dependency is missing. it should be in lib directory or in pom dependency declaration.
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
you need check commons-logging-1.2.jar in you tomcat lib.
some dependency jar is in you project .but may not in tomcat.
I got this exception:
SEVERE: Exception sending context initialized event to listener instance of class utils.DBConfig
java.lang.NoClassDefFoundError: org/jboss/logging/Logger
at org.hibernate.jpa.HibernatePersistenceProvider.<clinit>(HibernatePersistenceProvider.java:38)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at javax.persistence.spi.PersistenceProviderResolverHolder$DefaultPersistenceProviderResolver.getPersistenceProviders(PersistenceProviderResolverHolder.java:99)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:75)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at utils.DBConfig.contextInitialized(DBConfig.java:22)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1574)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1564)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.jboss.logging.Logger
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1858)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1709)
... 19 more
I have added to build following jar files:
javax.persistence.jar
hibernate-entitymanager.jar
Someone know how to fix it?
You miss the jboss-common.jar add it to your classpath.
If you use Maven:
il you have "java.lang.NoClassDefFoundError xxxxxx" error, you search in google: "maven xxxxxx". you find http://mvnrepository.com/artifact/...
copy/paste the dependency in pom.xml file.
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.3.0.Final</version>
</dependency>
Download a newer version of that Jar file from the Maven Repository and put it in your lib directory. Better use Maven.
In my Spring based Camel maven project on adding the following dependency for Jasper reports , I am facing issue while project build.
Jasper Dependency:
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.0.4</version>
</dependency>
Below is the stack trace for the exception:
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> RestBinding <<< in route: Route(route1)[[From[rest:post:/request:/addMultiple?inType=j... because of Error creating bean with name 'org.apache.camel.component.jackson.JacksonDataFormat': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.component.jackson.JacksonDataFormat]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1556)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:123)
at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:332)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> RestBinding <<< in route: Route(route1)[[From[rest:post:/request:/addMultiple?inType=j... because of Error creating bean with name 'org.apache.camel.component.jackson.JacksonDataFormat': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.component.jackson.JacksonDataFormat]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1028)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:185)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:841)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:2895)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2618)
at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2467)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2463)
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2486)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2463)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432)
at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:255)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:121)
... 19 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.camel.component.jackson.JacksonDataFormat': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.component.jackson.JacksonDataFormat]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:278)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1133)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1036)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:505)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:342)
at org.apache.camel.spring.spi.SpringInjector.newInstance(SpringInjector.java:39)
at org.apache.camel.impl.DefaultDataFormatResolver.resolveDataFormat(DefaultDataFormatResolver.java:57)
at org.apache.camel.impl.DefaultCamelContext.resolveDataFormat(DefaultCamelContext.java:3561)
at org.apache.camel.model.rest.RestBindingDefinition.createProcessor(RestBindingDefinition.java:109)
at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:505)
at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:217)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1025)
... 32 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.component.jackson.JacksonDataFormat]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:270)
... 44 more
Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z
at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:458)
at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:379)
at org.apache.camel.component.jackson.JacksonDataFormat.<init>(JacksonDataFormat.java:109)
at org.apache.camel.component.jackson.JacksonDataFormat.<init>(JacksonDataFormat.java:96)
at org.apache.camel.component.jackson.JacksonDataFormat.<init>(JacksonDataFormat.java:84)
at org.apache.camel.component.jackson.JacksonDataFormat.<init>(JacksonDataFormat.java:74)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
... 46 more
I think the supporting jackson dependencies for the jasper reports are conflicting with previous dependencies.
Below is the Dependency Hierarchy of pom.xml for jasper report.
However if i remove the dependency for the jasper report then it is working fine.
I am not able to sort it out exactly.
Got your problem wrong, changed answer
The class on which your method is occuring is part of jackson.core 2.4.3. If you include that explicitly, it should solve your problem.
Add the following dependencies:
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.4.3</version>
</dependency>