我想在GAE中使用Jersey中的Web服務公開。NoClassDefFoundError在GAE中運行Jersey時
我收到以下錯誤:
[INFO] java.lang.NoClassDefFoundError: sun.misc.Unsafe is a restricted class. Please see the Google App Engine developer's guide for more details.
[INFO] at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
[INFO] at org.glassfish.jersey.internal.util.collection.ConcurrentHashMapV8.getUnsafe(ConcurrentHashMapV8.java:3502)
[INFO] at org.glassfish.jersey.internal.util.collection.ConcurrentHashMapV8.<clinit>(ConcurrentHashMapV8.java:3467)
[INFO] at org.glassfish.jersey.internal.util.collection.DataStructures.createConcurrentMap(DataStructures.java:237)
[INFO] at org.glassfish.jersey.message.internal.MessageBodyFactory.<init>(MessageBodyFactory.java:197)
這是一個已知的問題?如果是這樣,是否有解決方法?
我使用Maven和使用以下依賴澤西島添加到項目
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.3.1</version>
</dependency>
以下是部分從我的web.xml我配置哪裏球衣號碼:
<servlet>
<servlet-name>Jersey Web Application</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.mycompany.myapplication</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>