Disabling the JAX-RS runtime environment
There are cases where you must disable the Java™ API for RESTful Web Services (JAX-RS) runtime environment. When disabling the JAX-RS runtime environment, JAX-RS features are not available, including base JAX-RS runtime capabilities, Enterprise JavaBeans (EJB) runtime integration, Java Contexts and Dependency Injection (JCDI) runtime integration, and Servlet 3.0 web container integration.
About this task
By disabling the JAX-RS runtime environment, any JAX-RS related processing of the application, including processing of classes with scanned JAX-RS annotations, EJB metadata, and JCDI bean enablement, is no longer performed. The JAX-RS runtime environment is not used to process requests and responses to and from the web container.
javax.ws.rs.Path
. To disable annotation scanning,
set the metadata-complete
attribute. If annotation
scanning is disabled, it is disabled for all other components outside
of JAX-RS.The explicit plug points to the IBM® JAX-RS runtime environment are the com.ibm.websphere.jaxrs.server.IBMRestServlet
servlet
class and the com.ibm.websphere.jaxrs.server.IBMRestFilter
filter
class. If you specify these classes as your servlet-class or servlet-filter
in the web module's web.xml file, the IBM JAX-RS runtime environment is
used to process requests to that servlet.
To disable the JAX-RS runtime environment from doing so, replace those classes with any other servlet or filter class that can handle expected requests to the servlet, or remove the servlet entirely from the web.xml file.
IBMRestServlet
class
with another might modify existing behavior in the application. Removing
the servlet entirely results in requests not being processed.Even
if not explicitly using the com.ibm.websphere.jaxrs.server.IBMRestServlet
or com.ibm.websphere.jaxrs.server.IBMRestFilter
classes,
the JAX-RS integration runtime environment may still process the application.
For example, if the web.xml file of a web module
is Servlet 3.0 based, and appropriate conditions are met according
to the JSR-311 specification, the JAX-RS integration runtime environment
processes scanned classes with JAX-RS annotations and may inject a
servlet that can handle requests to the JAX-RS resources in the application.
To
disable this functionality, and other functionality such as EJB and
JCDI integration, set the com.ibm.websphere.jaxrs.server.DisableIBMJAXRSEngine
custom Java virtual machine (JVM) property
on the application server with a value of true
.
Procedure
Results
You have disabled the JAX-RS runtime environment from processing your application.