Google App Engine上的Jersey错误 [英] Jersey error on Google App Engine
问题描述
在我的Java应用程序中,我将Jersey用于REST服务.一切 可以完美地工作,但是我得到了这个错误,它消耗了大量的CPU (13830cpu_ms)并冻结该应用几秒钟.
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?
推荐答案
@Drew Sears:谢谢,但是该错误发生在Jersey代码中-不是我的,所以没有代码可显示.
@Drew Sears: thanks, but the error occurs in Jersey code - not mine so there is no code to show.
最后我发现了问题:我只使用jersey库,例如jersey-core-1.7.jar.很好,应用程序将仅使用此库运行REST服务,但是如果生成JSON,它将搜索提供JSON数组提供程序的jackson库.
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.
通过简单地添加jackson * .jar库,问题就消失了.
By simple adding the jackson*.jar libs the problem is gone.
这篇关于Google App Engine上的Jersey错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!