Pre-requsitions:
- WebLogic Server Version: 12.2.1.0.0
- Common Java web-application deployed
- Started using Jersey client library
Issue:
Right after that /resources/ URI has been mapped/handled by (embedded) WebLogic JAX-RS/Jersey servlet handler.
WL mapping issue:
Googling shown this (pretty similar):
and
From the Oracle's docs:
*<servlet-mapping>
...If not specified, one of the following values are used, in order of precedence:
@ApplicationPath annotation value defined in the javax.ws.rs.core.Application subclass.
...
The value resources. This is the default base URI pattern for RESTful Web service applications.
...
If both the <servlet-mapping> and @ApplicationPath are specified, the <servlet-mapping> takes precedence.*
I do not need REST services and default mapping at all - just want to use Jersey client only. After trying different options I haven't succeed with any solution.
Explicitly added configuration in web.xml
(tried for both JAX-RS 1.1 and 2.0 vesrions), without implementing any endpoints, as use only Jersey client with setting <servlet-mapping>:
web.xml
<!--WebLogic Jersey Configuration-->
<servlet>
<display-name>WL Jersey Configuration</display-name>
<servlet-name>jersey</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<!--<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>-->
<init-param>
<param-name>jersey.config.wls.server.monitoring.enabled</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jersey</servlet-name>
<url-pattern>/jersey/*</url-pattern>
</servlet-mapping>
In addition updated weblogic.xml:
<wls:container-descriptor>
<wls:prefer-application-packages>
...
<wls:package-name>org.glassfish.*</wls:package-name>
<wls:package-name>com.sun.jersey.*</wls:package-name>
<wls:package-name>javax.ws.rs.*</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
It did not help. Any ideas on how to disable/override this default behaviour of WLS 12.2.1.0.0? Or maybe I've missed or doing something wrong?