Google App Engine 上的 Jersey 错误
在我的 java 应用程序中,我使用 Jersey 来提供 REST 服务。一切 工作完美,但我收到此错误,该错误消耗了大量 CPU (13830cpu_ms) 并使应用程序冻结几秒钟。
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)
知道我该如何解决这个问题吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@Drew Sears:谢谢,但错误发生在泽西岛代码中 - 不是我的,所以没有代码可显示。
最后我发现了问题:我只使用 jersey-core-1.7.jar 这样的 jersey 库。这很好,应用程序将仅使用此库运行 REST 服务,但如果我生成 JSON,它将搜索提供 JSON 数组提供程序的 jackson 库。
通过简单地添加 jackson*.jar 库,问题就消失了。
@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.