I am trying to expose a web service using Jersey in GAE.
I am getting the following error:
[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)
Is this a known issue? If so, is there a workaround?
I am using Maven and used the following dependency to add Jersey to the project
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.3.1</version>
</dependency>
Following is the part from my web.xml where I configured Jersey:
<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>