JAX-RS without a shirt on WAS7

I have a JAX-RS WS application deployed on WAS 8.0 with an empty 2.4 web.xml, a class that extends "javax.ws.rs.core.Application" and 2 resources, and it works great.

I would like to deploy this application on WAS 7.0, but I get: "Error 404: SRVE0190E: file not found: / rest / source" (this is the path to the resource).

How can I deploy a JAX-RS application on WAS 7.0 without using jersey or other classes related to the application server?

thanks

+6
source share
1 answer

In WAS 7, you must define the servlet in web.xml:

<servlet> <description>JAX-RS Tools Generated - Do not modify</description> <servlet-name>JAX-RS Servlet</servlet-name> <servlet-class>com.ibm.websphere.jaxrs.server.IBMRestServlet</servlet-class> <init-param> <param-name>javax.ws.rs.Application</param-name> <param-value>YOUR APPLICATION CLASS</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>JAX-RS Servlet</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> 

In addition, WAS 7 does not communicate with JAX-RS, you must add JAX-RS banners to your web module or add it as a shared library.

+3
source

All Articles