I struggled to get Jersey 2 to work with GAE but figured it out now.
Tested OK with GAE SDK 1.9.10
and Jersey 2.12
, including multipart/form-data
. See for instance this blog article.
In Jersey 2 you have to enable features in your web.xml
which is automatically enabled in Jersey 1. For example the snippet below enables JSP
page support and the multipart/form-data
MIME type features. (I don't think the GaeFeature
is required, but haven't tested without it).
<servlet>
<servlet-name>com.namibiaonthenet.www</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.namibiaonthenet.www</param-value>
</init-param>
<init-param>
<param-name>jersey.config.server.provider.classnames</param-name>
<param-value>
org.glassfish.jersey.server.mvc.jsp.JspMvcFeature;
org.glassfish.jersey.server.gae.GaeFeature;
org.glassfish.jersey.media.multipart.MultiPartFeature;
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
To enable the multipart/form-data
feature an additional short config. file is required in your project - for details see my and @yves' answers here.
If you still struggle, let me know in a comment to this answer.