2 Replies Latest reply on Nov 28, 2005 5:44 AM by Thomas Diesler

    Web Service Deployment: NullPointerException

    Craig Caulfield Newbie


      I'm trying to deploy a simple web service to JBoss 4.0.2 on Windows XP but I'm getting the following NullPointerException. I've been checking that my web.xml, webservices.xml, and wsdl are all linked properly and all seems OK.

      Has anyone come across this before?



      16:07:55,000 ERROR [ServiceDeployer] Cannot startup webservice for: GetStatus.war
      java.lang.NullPointerException
      at org.jboss.webservice.metadata.WebserviceDescriptionMetaData.replaceAddressLocations(WebserviceDescriptionMetaData.java:274)
      at org.jboss.webservice.metadata.WebserviceDescriptionMetaData.updateServiceAddress(WebserviceDescriptionMetaData.java:253)
      at org.jboss.webservice.ServiceDeployer.startWebservice(ServiceDeployer.java:211)
      at org.jboss.webservice.ServiceDeployer.handleNotification(ServiceDeployer.java:112)
      at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:138)
      at $Proxy30.handleNotification(Unknown Source)
      at org.jboss.mx.util.JBossNotificationBroadcasterSupport.handleNotification(JBossNotificationBroadcasterSupport.java:112)
      at org.jboss.mx.util.JBossNotificationBroadcasterSupport.sendNotification(JBossNotificationBroadcasterSupport.java:95)
      at org.jboss.deployment.SubDeployerSupport.emitNotification(SubDeployerSupport.java:238)
      at org.jboss.deployment.SubDeployerSupport.start(SubDeployerSupport.java:206)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:410)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
      at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:501)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:418)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:434)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:315)
      at org.jboss.Main.boot(Main.java:195)
      at org.jboss.Main$1.run(Main.java:463)
      at java.lang.Thread.run(Thread.java:595)
      16:07:55,046 INFO [TomcatDeployer] undeploy, ctxPath=/GetStatus, warUrl=file:/C:/jboss-4.0.2/server/default/tmp/deploy/tmp29579GetStatus-exp.war/
      16:07:55,093 WARN [ServiceDeployer] Cannot undeploy webservice: java.lang.IllegalStateException: Cannot find port component info for: GetStatus.war#speck-webservices
      16:07:55,468 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=file:/C:/jboss-4.0.2/server/default/deploy/jmx-console.war/
      16:07:56,421 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
      16:07:56,828 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
      16:07:56,859 INFO [JkMain] Jk running ID=0 time=0/94 config=null
      16:07:56,890 INFO [Server] JBoss (MX MicroKernel) [4.0.2 (build: CVSTag=JBoss_4_0_2 date=200505022023)] Started in 37s:422ms



      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions name="GetStatusWSDL" targetNamespace="http://speck.net.au/wsdl"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:tns="http://speck.net.au/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sp="http://speck.net.au/wsdl"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/">
      <wsdl:message name="outgoingResponse">
      <wsdl:part name="status" type="xsd:string"/>
      <wsdl:part name="totalSale" type="xsd:decimal"/>
      <wsdl:part name="saleCategory" type="xsd:string"/>
      </wsdl:message>
      <wsdl:message name="incomingRequest">
      <wsdl:part name="branch" type="xsd:string"/>
      <wsdl:part name="SaleNumber" type="xsd:integer"/>
      <wsdl:part name="companyNo" type="xsd:string"/>
      </wsdl:message>
      <wsdl:message name="fault">
      <wsdl:part name="saleFault" type="xsd:string">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">This fault will be thrown in
      cases where a sale/branch comination cant be found...</wsdl:documentation>
      </wsdl:part>
      </wsdl:message>
      <wsdl:portType name="StatusInterface">
      <wsdl:operation name="getStatus">
      <wsdl:input message="tns:incomingRequest"/>
      <wsdl:output message="tns:outgoingResponse"/>
      <wsdl:fault name="saleFault" message="tns:fault"/>
      </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="speck-webservicesSOAPbinding" type="tns:StatusInterface">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="getStatus">
      <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Retrieves the status and
      other details about a sale.</wsdl:documentation>
      <soap:operation soapAction="http://speck.org/wsdl/getStatus"/>
      <wsdl:input>
      <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="http://speck.net.au/wsdl"/>
      </wsdl:input>
      <wsdl:output>
      <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="http://speck.net.au/wsdl"/>
      </wsdl:output>
      <wsdl:fault name="saleFault">
      <soap:fault name="saleFault"/>
      </wsdl:fault>
      </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="StatusWebService">
      <wsdl:port name="speck-webservices" binding="tns:speck-webservicesSOAPbinding">
      <soap:address location="anything"/>
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>



      <?xml version="1.0" encoding="UTF-8"?>

      <webservice-description>
      <webservice-description-name>StatusWebService</webservice-description-name>
      <wsdl-file>WEB-INF/wsdl/GetStatus.wsdl</wsdl-file>
      <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
      <port-component>
      <port-component-name>speck-webservices</port-component-name>
      <wsdl-port>
      http://speck.net.au/wsdl
      speck-webservices
      </wsdl-port>
      <service-endpoint-interface>net.speck.StatusInterface</service-endpoint-interface>
      <service-impl-bean>
      <servlet-link>GetStatus</servlet-link>
      </service-impl-bean>
      </port-component>
      </webservice-description>



      <?xml version="1.0" encoding="UTF-8"?>
      <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">
      <display-name>GetStatus</display-name>

      <servlet-name>GetStatus</servlet-name>
      <servlet-class>net.speck.GetStatus</servlet-class>

      <servlet-mapping>
      <servlet-name>GetStatus</servlet-name>
      <url-pattern>/GetStatus</url-pattern>
      </servlet-mapping>
      <resource-ref>
      <res-ref-name>MySqlDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      <res-sharing-scope>Shareable</res-sharing-scope>
      </resource-ref>
      </web-app>


        • 1. Re: Web Service Deployment: NullPointerException
          Thomas Diesler Master

          The <wsdl-port> is invalid

          <wsdl-port>
          http://speck.net.au/wsdl
          speck-webservices
          </wsdl-port>


          it should be something like this

          <webservices
           xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:impl="http://test.jboss.org/ws4eesimple"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
           version="1.1">
          
           <webservice-description>
           <webservice-description-name>HelloWsService</webservice-description-name>
           <wsdl-file>WEB-INF/wsdl/HelloService.wsdl</wsdl-file>
           <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
           <port-component>
           <port-component-name>ValidURL</port-component-name>
           <wsdl-port>impl:ValidURLPort</wsdl-port>
           <service-endpoint-interface>org.jboss.test.webservice.ws4eesimple.HelloWs</service-endpoint-interface>
           <service-impl-bean>
           <servlet-link>HelloJavaBean</servlet-link>
           </service-impl-bean>
           </port-component>
           </webservice-description>
          </webservices>
          



          • 2. Re: Web Service Deployment: NullPointerException
            Thomas Diesler Master

            Did you not get an error log on deployment?