Jersey 1.1 Style Servlet-Mapping Ignored and Unable to Start WLS 12.2.1 with "CDI definition failure:java.lang.NullPointerException"

(Doc ID 2149796.1)

Last updated on NOVEMBER 09, 2017

Applies to:

Oracle WebLogic Server - Version 12.2.1.0.0 and later
Information in this document applies to any platform.

Symptoms

When attempting to deploy a Jersey 1.1 application in WebLogic Server 12.2.1, it was discovered that the servlet-mapping for com.sun.jersey.spi.container.servlet.ServletContainer is ignored and an "weblogic.management.DeploymentException: CDI definition failure:java.lang.NullPointerException" occurs when starting WLS. 

 For example, with:

<servlet>
<display-name>My Jersey Application</display-name>
<servlet-name>MyJerseyApp</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>samples.helloworld</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>MyJerseyApp</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>

In 12.1.3 the URI is '/weblogicupgrade/rest/test/helloworld'

In 12.2.1 the URI is '/weblogicupgrade/resources/test/helloworld'

 

Per doc, https://docs.oracle.com/middleware/1221/wls/RESTF/jersey-back-comp.htm#RESTF385, servlet-mapping should take priority. A lower priority is the default 'resources' URI.

Changes

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms