2017-01-17 18 views
-1

STSアプリケーションでApache Ivyを実装した後、次のコンソールエラーが表示される。Apache Ivyに移行した後の例外

14:56:19,987 WARN XmlWebApplicationContext:544 - Exception encountered during context initialization - cancelling refresh attempt 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1105) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1050) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305) 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) 
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) 
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446) 
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328) 
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) 
    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.run(FutureTask.java:262) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: 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:89) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1098) 
    ... 22 more 
Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z 
    at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:445) 
    at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:366) 
    at org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.build(Jackson2ObjectMapperBuilder.java:538) 
    at org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.<init>(MappingJackson2HttpMessageConverter.java:56) 
    at org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter.<init>(AllEncompassingFormHttpMessageConverter.java:61) 
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.<init>(RequestMappingHandlerAdapter.java:187) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526) 
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) 
    ... 24 more 
14:56:20,018 INFO EhCacheManagerFactoryBean:181 - Shutting down EhCache CacheManager 
14:56:20,044 ERROR ContextLoader:353 - Context initialization failed 

私は、次のjarファイルを追加しました:あなたが提供しているスタックトレースから

<dependency org="org.hibernate" name="hibernate-core" rev="5.0.11.Final" conf="default"/> 
    <dependency org="org.springframework" name="spring-core" rev="4.2.1.RELEASE" conf="default"/> 
    <dependency org="org.springframework" name="spring-web" rev="4.2.1.RELEASE" conf="default"/> 
    <dependency org="org.springframework" name="spring-orm" rev="4.2.1.RELEASE" conf="default"/> 
    <dependency org="org.springframework" name="spring-context" rev="4.2.1.RELEASE" conf="default"/> 
    <dependency org="org.springframework" name="spring-context-support" rev="4.2.1.RELEASE" conf="default"/> 
    <dependency org="org.springframework" name="spring-test" rev="4.2.1.RELEASE" conf="default"/> 
    <dependency org="org.springframework" name="spring-oxm" rev="4.2.1.RELEASE" conf="default"/> 
    <dependency org="org.springframework" name="spring-webmvc" rev="4.2.1.RELEASE" conf="default"/> 
    <dependency org="org.springframework" name="spring-webmvc-portlet" rev="4.2.1.RELEASE" conf="default"/> 
    <dependency org="org.springframework" name="spring-aspects" rev="4.2.1.RELEASE" conf="default"/> 
    <dependency org="joda-time" name="joda-time" rev="2.8.2" conf="default"/> 
    <dependency org="org.apache.shiro" name="shiro-all" rev="1.2.6" conf="default"/> 
    <dependency org="org.apache.poi" name="poi" rev="3.14" conf ="default" /> 
    <dependency org="org.apache.poi" name="poi-ooxml" rev="3.14" conf ="default" /> 
    <dependency org="org.apache.commons" name="commons-exec" rev="1.3" conf="default"/> 
    <dependency org="org.apache.geronimo.specs" name="geronimo-jta_1.1_spec" rev="1.1.1" conf="default"/> 
    <dependency org="javax.el" name="javax.el-api" rev="2.2.5" conf="default"/> 
    <dependency org="javax.jdo" name="jdo-api" rev="3.0.1" conf="default"/> 
    <dependency org="javax.servlet.jsp.jstl" name="jstl-api" rev="1.2" conf="default"/> 
    <dependency org="javax.mail" name="mail" rev="1.4.7" conf="default"/> 
    <dependency org="javax.inject" name="javax.inject" rev="1" conf="default"/>   
    <dependency org="org.slf4j" name="slf4j-api" rev="1.7.12" conf="default"/> 
    <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.7.12" conf="default"/> 
    <dependency org="org.primefaces" name="primefaces" rev="5.1" conf="default"/> 
    <dependency org="com.sun.faces" name="jsf-api" rev="2.1.29" conf="default"/> 
    <dependency org="com.sun.faces" name="jsf-impl" rev="2.1.29" conf="default"/> 
    <dependency org="com.google.api-client" name="google-api-client" rev="1.20.0" conf ="default" /> 
    <dependency org="com.google.apis" name="google-api-services-calendar" rev="v3-rev77-1.17.0-rc" conf ="default" /> 
    <dependency org="com.google.code.gson" name="gson" rev="2.3.1" conf="default"/> 
    <dependency org="org.mnode.ical4j" name="ical4j" rev="1.0.5" conf ="default" /> 
    <dependency org="net.sourceforge.jexcelapi" name="jxl" rev="2.6.12" conf="default"/> 
    <dependency org="org.quartz-scheduler" name="quartz" rev="2.2.3" conf="default"/> 
    <dependency org="org.seleniumhq.selenium" name="selenium-java" rev="2.53.1"/> 
    <dependency org="com.ocpsoft" name="prettyfaces-jsf2" rev="3.3.3" conf="default"/> 
    <dependency org="org.mindrot" name="jbcrypt" rev="0.3m" conf="default"/> 
     <dependency org="org.omnifaces" name="omnifaces" rev="1.6.3" conf="default"/> 
     <dependency org="commons-collections" name="commons-collections" rev="3.2.2" conf="default"/> 
    <dependency org="org.mockito" name="mockito-all" rev="1.10.19" conf="default"/> 
    <dependency org="org.xerial" name="sqlite-jdbc" rev="3.8.10.1" conf="default"/> 

答えて

0

を、私は次のエラーを参照してください。

java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()

はで、次の依存関係を追加します。あなたのポンと再び試してみてください。

<dependency> 
    <groupId>com.fasterxml.jackson.core</groupId> 
    <artifactId>jackson-annotations</artifactId> 
    <version>${jackson.version}</version> 
</dependency> 
<dependency> 
    <groupId>com.fasterxml.jackson.core</groupId> 
    <artifactId>jackson-core</artifactId> 
    <version>${jackson.version}</version> 
</dependency> 

注:

私はちょうどjackson-core瓶のさまざまなバージョンでJsonFactoryのソースコードをチェックします。メソッドrequiresPropertyOrderingがバージョン2.3.0で最初に追加されたことがわかります。したがって、少なくとも2.3.0のバージョンを使用していることを確認してください。

+0

**次のjackson依存関係が追加されました。しかし、問題は依然として存在します。** GjA

+0

@ GjA、バージョン2.0.1は非常に古いです。 2.8.xバージョンで試してください。私は 'requiresPropertyOrdering'メソッドが2.6.0以降のJsonFactoryクラスにのみ追加されたと思います。 – VHS

+0

@GjA、 'JsonFactory'のソースコードを' jackson-core'ジャーのさまざまなバージョンでチェックしました。 'requiresPropertyOrdering'メソッドがバージョン2.3.0で最初に追加されたことがわかりました。したがって、少なくとも2.3.0のバージョンを使用していることを確認してください。 – VHS

関連する問題