本文介绍了NoSuchMethodError:org.codehaus.jackson.type.JavaType的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用程序抛出下面的错误,虽然我在我的应用程序中有 jackson-core-asl-1.4.2
和 jackson-mapper -asl-1.4.2
引起:java.lang.NoSuchMethodError:org.codehaus。 < init>(Ljava / lang / Class;)V
$($ Runtime.java:134)
at org.codehaus.jackson.map.type.SimpleType。< init>(SimpleType.java:32)
。在org.codehaus.jackson.map.type.TypeFactory._fromClass(TypeFactory.java:254)在org.codehaus.jackson.map.type.TypeFactory._fromType
(TypeFactory.java:266)
org.codehaus.jackson.map.type.TypeFactory.type(TypeFactory.java:57)
at org.codehaus.jackson.map.ObjectMapper。< clinit>(ObjectMapper.java:49)
。在org.springframework.web.servlet.view.json.MappingJacksonJsonView<初始化>(MappingJacksonJsonView.java:59)
。在太阳在sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)
.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruc torAccessorImpl.java:57)在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45
)
在java.lang.reflect.Constructor.newInstance(Constructor.java:525)
在在com.google.appengine.tools.development.agent.runtime.Runtime.newInstance(运行时com.google.appengine.tools.development.agent.runtime.Runtime.newInstance_(Runtime.java:126)
。 Java的:在org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147 134)
)
... 48多个
.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57 )
在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
处com.google java.lang.reflect.Constructor.newInstance(Constructor.java:525)
。 appengine.tools.development.agent.runtime.Runtime.newInstance_(Runtime.java:126)
,位于com.google.appengine.tools.development.agent.runtime.Runtime.newInstance(
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
... 48 more
p $ p>
可能是什么原因?这真的很奇怪,以前的应用程序工作,并将代码提交给SVN,然后当我退房并重新运行所有我得到这个错误...
解决方案这看起来几乎肯定是由于'core'和'mapper'罐子的不兼容版本。您可能通过classpath使用了不兼容的版本。
My application is throwing the error below, although I have in my app the
jackson-core-asl-1.4.2
andjackson-mapper-asl-1.4.2
Caused by: java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.<init>(Ljava/lang/Class;)V at org.codehaus.jackson.map.type.SimpleType.<init>(SimpleType.java:32) at org.codehaus.jackson.map.type.TypeFactory._fromClass(TypeFactory.java:254) at org.codehaus.jackson.map.type.TypeFactory._fromType(TypeFactory.java:266) at org.codehaus.jackson.map.type.TypeFactory.type(TypeFactory.java:57) at org.codehaus.jackson.map.ObjectMapper.<clinit>(ObjectMapper.java:49) at org.springframework.web.servlet.view.json.MappingJacksonJsonView.<init>(MappingJacksonJsonView.java:59) 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:525) at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance_(Runtime.java:126) at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance(Runtime.java:134) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) ... 48 more .reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance_(Runtime.java:126) at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance(Runtime.java:134) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) ... 48 more
What could be the reason? It's really weird the application worked before and commited the codes to SVN then when I check-out and re-run everything I get this error...
解决方案This looks almost certainly to be due to incompatible versions of 'core' and 'mapper' jars. You probably have incompatible versions in use via classpath.
这篇关于NoSuchMethodError:org.codehaus.jackson.type.JavaType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!