dev@jersey.java.net

Re: [Jersey] NullPointerException in DefaultResourceConfig

From: Anthony, Clark (Mission Systems) <"Anthony,>
Date: Thu, 4 Sep 2008 14:33:22 -0500

I was attempting to use the "com.sun.jersey.config.property.packages"
param that is recommended for Weblogic 9.2. I set it in Netbeans, but it
turned out there was a disconnect between the visual editor and the
actual xml, so it was not present. Therefore the default
ClassPathResourceConfig was used. Not entirely sure why the null came
through, but it did every time I tried to deploy.

Ensuring that the property was actually set in the web.xml allowed me to
continue.

I was deploying directly from the admin console on a freshly installed
Weblogic instance. This was my web.xml that failed:

<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <servlet>
        <servlet-name>TrackAdapter</servlet-name>
 
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</se
rvlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>TrackAdapter</servlet-name>
        <url-pattern>/TrackAdapter/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>