2 Replies Latest reply on Dec 19, 2005 8:45 AM by Brenda Bell

    NullPointerException invoking web service method

    Brenda Bell Newbie

      I have searched this forum and the web as best as a newbie can and I can't seem to find a solution to my problem.

      I have successfully built and deployed a web service on JBoss 4.0.2 JDK 5.0.4. There are no errors in the logs with respect to the deployment and I can browse to the wsdl at http://localhost/ControlService?wsdl.

      My method is about as simple as it gets and has been tested independently:

      public class ControlServiceImpl
      {

      private static DateFormat m_ISO8601Format =
      new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm::ssZ" );

      /**
      * Returns the server's current local time formatted as per ISO 8601.
      *
      * @return the server time
      */
      public String getServerTime ()
      {
      return m_ISO8601Format.format( new Date( ) );
      }

      }

      I developed my client using the sample on page 528 of the JBoss 4.0 Official Guide:

      public class test
      {

      public static void main (String args[])
      {
      try
      {
      URL wsdl = new URL( "http://localhost/ControlService?wsdl");
      System.out.println( "Using wsdl " + wsdl.toString( ) );

      QName qname = new QName( "http://wsee.example.com/", "ControlService" );
      System.out.println( "Using name " + qname.toString( ) );

      ServiceFactory factory = ServiceFactory.newInstance();
      Service service = factory.createService( wsdl, qname );

      ControlServiceInterface port = (ControlServiceInterface)service.getPort( ControlServiceInterface.class );
      System.out.println( "resp=" + port.getServerTime( ) );
      }
      catch( MalformedURLException mue )
      {
      System.out.println( mue.toString( ) );
      }
      catch( ServiceException se )
      {
      System.out.println( se.toString( ) );
      }
      catch( RemoteException re )
      {
      System.out.println( re.toString( ) );
      }
      }
      }

      Note that I did modify server\default\deploy\jboss-ws4ee.sar\META-INF\jboss-service.xml to use port 80 and 443.

      When I try to invoke my service method using JAX-RPC, I get the following errors in the log:

      2005-12-18 21:38:15,533 ERROR [org.jboss.webservice.server.ServerEngine] Server error
      java.lang.NullPointerException
      at java.util.Hashtable.put(Hashtable.java:396)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(Unknown Source)
      at org.jboss.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:262)
      at org.jboss.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:684)
      at org.jboss.axis.MessagePart.getEnvelope(MessagePart.java:1103)
      at org.jboss.webservice.server.ServerEngine.invoke(ServerEngine.java:59)
      at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:905)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      2005-12-18 21:38:15,533 INFO [org.jboss.axis.transport.http.AxisServlet] Exception:
      java.lang.NullPointerException
      at java.util.Hashtable.put(Hashtable.java:396)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(Unknown Source)
      at org.jboss.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:262)
      at org.jboss.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:684)
      at org.jboss.axis.MessagePart.getEnvelope(MessagePart.java:1103)
      at org.jboss.webservice.server.ServerEngine.invoke(ServerEngine.java:59)
      at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:905)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      2005-12-18 21:38:15,533 INFO [org.jboss.axis.transport.http.AxisServlet] java.lang.NullPointerException
      2005-12-18 21:38:15,533 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/].[ControlServiceImpl]] Servlet.service() for servlet ControlServiceImpl threw exception
      java.lang.NullPointerException
      at org.jboss.axis.encoding.DeserializationContextImpl.getTypeMapping(DeserializationContextImpl.java:603)
      at org.jboss.axis.encoding.DeserializationContextImpl.getDeserializer(DeserializationContextImpl.java:563)
      at org.jboss.axis.encoding.DeserializationContextImpl.getDeserializerForType(DeserializationContextImpl.java:595)
      at org.jboss.axis.message.SOAPFaultBuilder.onStartChild(SOAPFaultBuilder.java:370)
      at org.jboss.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:1168)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:379)
      at org.jboss.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:257)
      at org.jboss.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:684)
      at org.jboss.axis.Message.getSOAPEnvelope(Message.java:428)
      at org.jboss.axis.Message.getContentType(Message.java:494)
      at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:971)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)

      Any advice as to how I can troubleshoot and/or resolve this issue would be greatly appreciated.