1

本番環境の appengine インスタンスのサーバー ログにこの例外がスローされます。org.codehaus.jackson.jaxrsパッケージ内のいくつかのクラスからメンバーをロードできないことに関する SecurityExceptionです。誰もこれを見たことがありますか?Jersey 1.12、MimePull 1.6、および Urlrewrite 3.2.0 ライブラリを追加しました。

これらの例外は主にログを埋めますが、アプリケーションの品質には影響しないようです。これらはデバッグ用の Jetty サーバーには表示されません。

これらの他のクラスでも同様のエラーが発生します。

  • JacksonJaxbJsonProvider
  • JacksonJsonProvider
  • JSONWithPaddingProvider

web.xml からの関連スニペット

<servlet>
        <servlet-name>Jersey REST Service</servlet-name>
        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>com.sun.jersey.config.property.packages</param-name>
            <param-value>com.appname.api;org.codehaus.jackson.jaxrs</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Jersey REST Service</servlet-name>
        <url-pattern>/api/*</url-pattern>
    </servlet-mapping>

AppEngine サーバー ログで報告される例外

com.sun.jersey.core.spi.component.ProviderFactory __getComponentProvider: The provider class, class org.codehaus.jackson.jaxrs.JsonMappingExceptionMapper, could not be instantiated. Processing will continue but the class will not be utilized
java.lang.SecurityException: Unable to get members for class org.codehaus.jackson.jaxrs.JsonMappingExceptionMapper
    at com.google.appengine.runtime.Request.process-9d6a4897c964eb62(Request.java)
    at java.lang.Class.getDeclaredMethods(Class.java:253)
    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:159)
    at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:153)
    at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:251)
    at com.sun.jersey.core.spi.component.ProviderServices.getProviders(ProviderServices.java:148)
    at com.sun.jersey.server.impl.application.ExceptionMapperFactory.init(ExceptionMapperFactory.java:74)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1284)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:171)
    at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:777)
    at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:773)
    at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:773)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:768)
    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:607)
    at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:208)
    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:449)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
    at java.lang.Thread.run(Thread.java:679)
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:616)
    ... 41 more
Caused by: java.lang.NoClassDefFoundError: org/codehaus/jackson/map/JsonMappingException
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2444)
    ... 41 more
Caused by: java.lang.ClassNotFoundException: org.codehaus.jackson.map.JsonMappingException
    at com.google.appengine.runtime.Request.process-9d6a4897c964eb62(Request.java)
    ... 41 more
4

1 に答える 1

0

主な例外はClassNotFoundException、クラスorg.codehaus.jackson.map.JsonMappingExceptionが見つからなかったためです。

このクラスを含む適切な jar をプロジェクトに追加する必要があります。

于 2012-08-03T13:54:21.103 に答える