Jersey error on Google App Engine

社会主义新天地 提交于 2019-12-10 11:57:29

问题


In my java application I'm using Jersey for REST services. Everything works perfect, but I get this error which consumes a lot of CPU (13830cpu_ms) and freezes the app for few seconds.

com.sun.jersey.core.spi.component.ProviderFactory __getComponentProvider: The provider c     
class, class com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$App, 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.JSONArrayProvider$App
    at com.google.appengine.runtime.Request.process-d73c0d822f527031(Request.java)
    at java.lang.Class.getDeclaredMethods(Class.java:252)

Any idea how I can solve this problem?


回答1:


@Drew Sears: thanks, but the error occurs in Jersey code - not mine so there is no code to show.

Finally I found the problem: I use only the jersey libraries like jersey-core-1.7.jar. This is fine and the application will rund REST services with only this libraries, but if I generate JSON it will search for the jackson library which provides a JSON array provider.

By simple adding the jackson*.jar libs the problem is gone.



来源:https://stackoverflow.com/questions/6130328/jersey-error-on-google-app-engine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!