web-dev-qa-db-ja.com

java.lang.ClassNotFoundException:org.codehaus.jackson.map.JsonSerializableWithType

私はビルドパスにジャクソン2.2.3を取得しましたが、それでもこのエラーが発生します。誰もがなぜ知っていますか?

enter image description here

com.Sun.jersey.core.spi.component.ProviderFactory __getComponentProvider: The provider class, class com.Sun.jersey.json.impl.provider.entity.JSONWithPaddingProvider, could not be instantiated. Processing will continue but the class will not be utilized
Java.lang.SecurityException: Unable to get members for class com.Sun.jersey.json.impl.provider.entity.JSONWithPaddingProvider
    at com.google.appengine.runtime.Request.process-244548b7ddf4520b(Request.Java)
    at Java.lang.Class.getDeclaredMethods(Class.Java:256)
    at com.Sun.jersey.core.reflection.MethodList.getAllDeclaredMethods(MethodList.Java:70)
    at com.Sun.jersey.core.reflection.MethodList.<init>(MethodList.Java:64)
    at com.Sun.jersey.core.spi.component.ComponentConstructor.getPostConstructMethods(ComponentConstructor.Java:131)
    at com.Sun.jersey.core.spi.component.ComponentConstructor.<init>(ComponentConstructor.Java:123)
    at com.Sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.Java:165)
    at com.Sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.Java:137)
    at com.Sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.Java:256)
    at com.Sun.jersey.core.spi.component.ProviderServices.getServices(ProviderServices.Java:160)
    at com.Sun.jersey.core.spi.factory.MessageBodyFactory.initWriters(MessageBodyFactory.Java:207)
    at com.Sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.Java:163)
    at com.Sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.Java:1277)
    at com.Sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.Java:169)
    at com.Sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.Java:775)
    at com.Sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.Java:771)
    at com.Sun.jersey.spi.inject.Errors.processWithErrors(Errors.Java:193)
    at com.Sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.Java:771)
    at com.Sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.Java:766)
    at com.Sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.Java:488)
    at com.Sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.Java:318)
    at com.Sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.Java:609)
    at com.Sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.Java:210)
    at com.Sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.Java:373)
    at com.Sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.Java:556)
    at javax.servlet.GenericServlet.init(GenericServlet.Java:212)
    at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.Java:440)
    at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.Java:263)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:50)
    at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.Java:685)
    at org.mortbay.jetty.servlet.Context.startContext(Context.Java:140)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.Java:1250)
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.Java:517)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.Java:467)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.Java:50)
    at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.Java:435)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.Java:442)
    at com.google.tracing.CurrentContext.runInContext(CurrentContext.Java:186)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.Java:306)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.Java:298)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.Java:439)
    at Java.lang.Thread.run(Thread.Java:722)
Caused by: Java.lang.reflect.InvocationTargetException
    at Sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
    at Java.lang.reflect.Method.invoke(Method.Java:601)
    ... 41 more
Caused by: Java.lang.NoClassDefFoundError: org/codehaus/jackson/map/JsonSerializableWithType
    at com.google.appengine.runtime.Request.process-244548b7ddf4520b(Request.Java)
    at Java.lang.ClassLoader.defineClass1(Native Method)
    at Java.lang.ClassLoader.defineClass(ClassLoader.Java:794)
    at Java.security.SecureClassLoader.defineClass(SecureClassLoader.Java:142)
    at Java.net.URLClassLoader.defineClass(URLClassLoader.Java:449)
    at Sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
    ... 43 more
Caused by: Java.lang.ClassNotFoundException: org.codehaus.jackson.map.JsonSerializableWithType
    at com.google.appengine.runtime.Request.process-244548b7ddf4520b(Request.Java)
    ... 41 more
13

追加する必要がありますjackson-mapper-aslをクラスパスに追加します。

あなたはそれを見つけることができます ここ

17
M. Abbas

例外は、他のライブラリまたはフレームワークがJackson 1.xを使用しており、1.x jarが必要であることを示しています。ジャクソン2.xを使用しています。そのクラスはcom.fasterxml.jackson パッケージ;しかし例外として、org.codehaus.jacksonが必要です。

23
StaxMan

ビルドパスを設定した場合でも、実行時にクラスパスを追加する必要があります。 Eclipseでデプロイメントアセンブリを確認する

展開アセンブリ

3
jonghyun oh