1 Reply Latest reply on Aug 2, 2011 7:22 PM by rituraj_tiwari

    NullPointerException in JSAPI servlet

    rituraj_tiwari

      Folk,

      I have three classes that invoke JAX-RS functionality. Partial stack trace is:

       

      {code}

      10:25:28,364 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/DTalkWeb]] (MSC service thread 1-4) Servlet /DTalkWeb threw load() exception: java.lang.NullPointerException

                at org.jboss.resteasy.jsapi.ServiceRegistry.scanRegistry(ServiceRegistry.java:69) [resteasy-jsapi-2.2.1.GA.jar:]

                at org.jboss.resteasy.jsapi.ServiceRegistry.<init>(ServiceRegistry.java:63) [resteasy-jsapi-2.2.1.GA.jar:]

                at org.jboss.resteasy.jsapi.JSAPIServlet.scanResources(JSAPIServlet.java:76) [resteasy-jsapi-2.2.1.GA.jar:]

                at org.jboss.resteasy.jsapi.JSAPIServlet.init(JSAPIServlet.java:38) [resteasy-jsapi-2.2.1.GA.jar:]

       

      {code}

      The first few lines of the JAX-RS classes look like this:

       

      {code}

      @ApplicationPath( "/api" )

      @Path( "/users" )

      public class EndUserUiService extends Application

      {

          /**

           * Queries existence of a user.

           * @param sUserId

           * @return HTTP OK if user exists and NOT_FOUND if user does not exist

           * @throws NamingException

           */

          @HEAD

          @Path( "/{userid}" )

          public Response queryUserExists( @PathParam( "userid" )final String sUserId ) throws NamingException

          {

          ...

      {code}

       

      {code}

      @ApplicationPath( "/api" )

      @Path("/organizations")

      public class OrganizationUiService

      {

      ...

      }

      {code}

       

       

      {code}

      @ApplicationPath( "/api" )

      @Path( "/adresses" )

      public class AdressUiService

      {

      ...

      }

       

      {code}