web-dev-qa-db-fra.com

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

J'ai obtenu Jackson 2.2.3 dans mon chemin de construction mais j'obtiens toujours cette erreur. quelqu'un sait pourquoi?

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
code511788465541441

Vous devez ajouter jackson-mapper-asl dans votre chemin de classe.

Vous pouvez le trouver ici

17
M. Abbas

L'exception indique qu'une autre bibliothèque ou infrastructure utilise Jackson 1.x et nécessite des fichiers jars 1.x. Vous utilisez Jackson 2.x, dont les classes vivent dans com.fasterxml.jackson paquet; mais par exception, ceux dans org.codehaus.jackson sont nécessaires.

23
StaxMan

Même si vous configurez le chemin de génération, vous devez ajouter un chemin de classe pendant l'exécution. Vérifier l'assemblage de déploiement dans Eclipse

Assemblée de déploiement

3
jonghyun oh