3 Replies Latest reply on Feb 14, 2006 1:13 PM by Thomas Diesler

    Cannot startup webservice:  NullPointerException

    Barry Davies Newbie

      Our team currently performs enterprise java development using IBM Rational Application Developer 6.0 and deploys under IBM WebSphere 5.1, but a recent decision to incorporate more webservices has given us a green light to look at alternatives to WebSphere. I have been a casual fan of JBoss for years, and I am hoping that we can use IBM's tools (at least in the interum) to create the web services code and just deploy to that JBoss in fairly pain-free fashion. Persuant to this, I am trying to take a proof of concept project (of sorts) that I created leaning heavily on IBM's web service creation tools (and that I know works under WebSphere 5.1) and deploy it to JBoss. When I try this, I am receiving the following log entries and stack trace:

      15:40:12,912 INFO [EARDeployer] Init J2EE application: file:/C:/Program Files/jboss-4.0.3SP1/server/default/deploy/WS-Pv0.1.0.ear
      15:40:13,209 WARN [JBossEntityResolver] Trying to resolve systemId as a non-file URL: http://www.ibm.com/webservices/dtd/j2ee_web_services_1_0.dtd
      15:40:16,038 INFO [TomcatDeployer] deploy, ctxPath=/Producer, warUrl=.../tmp/deploy/tmp29192WS-Pv0.1.0.ear-contents/WSProducerWeb-exp.war/
      15:40:16,194 ERROR [ServiceDeployer] Cannot startup webservice for: WSProducerWeb.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:207)
       at org.jboss.webservice.ServiceDeployer.handleNotification(ServiceDeployer.java:110)
      .
      .
      .
      (etc)
      


      I saw some previous posts about an incorrect webservice port configuration, but I am sincerely hoping that IBM tools don't generate invalid configuration with respect to the standards. Here's my webservices.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE webservices PUBLIC "-//IBM Corporation, Inc.//DTD J2EE Web services 1.0//EN"
       "http://www.ibm.com/webservices/dtd/j2ee_web_services_1_0.dtd">
      <webservices>
       <webservice-description>
       <webservice-description-name>MyFirstWebServiceBeanService</webservice-description-name>
       <wsdl-file>WEB-INF/wsdl/MyFirstWebServiceBean.wsdl</wsdl-file>
       <jaxrpc-mapping-file>WEB-INF/MyFirstWebServiceBean_mapping.xml</jaxrpc-mapping-file>
       <port-component>
       <port-component-name>MyFirstWebServiceBean</port-component-name>
       <wsdl-port>
       <namespaceURI>http://producer.webservice.fdc.com</namespaceURI>
       <localpart>MyFirstWebServiceBean</localpart>
       </wsdl-port>
       <service-endpoint-interface>com.fdc.webservice.producer.MyFirstWebServiceBean</service-endpoint-interface>
       <service-impl-bean>
       <servlet-link>com_fdc_webservice_producer_MyFirstWebServiceBean</servlet-link>
       </service-impl-bean>
       </port-component>
       </webservice-description>
      </webservices>
      


      Does anyone know what the issue might be in this circumstance? Could it be that RAD6.0 doesn't generate standard descriptors? If so, I think I may be S.O.L....

        • 1. Re: Cannot startup webservice:  NullPointerException
          Thomas Diesler Master

          It is indeed not J2EE-1.4 compliant. It uses the old j2ee_web_services_1_0.dtd

          A correct webservice.xml looks like this. Note the difference in wsdl-port

          <webservices xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:impl="http://org.jboss.test.webservice/jbws358"
           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>HelloService</webservice-description-name>
           <wsdl-file>META-INF/wsdl/HelloService.wsdl</wsdl-file>
           <jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
           <port-component>
           <port-component-name>HelloPort</port-component-name>
           <wsdl-port>impl:HelloPort</wsdl-port>
           <service-endpoint-interface>org.jboss.test.webservice.jbws358.Hello</service-endpoint-interface>
           <service-impl-bean>
           <ejb-link>HelloBean</ejb-link>
           </service-impl-bean>
           </port-component>
           </webservice-description>
          </webservices>
          


          • 2. Re: Cannot startup webservice:  NullPointerException
            Barry Davies Newbie

            Thanks for your response!

            My app is actually coded against J2EE 1.3, and I've confirmed that all standard deployment descriptors reflect this. Does JBoss support previous versions of J2EE with regards to webservices? Or does that require further configuration? I would have guessed that JBoss would recognize my EAR as J2EE 1.3, and enforced compatibility with that in mind...

            • 3. Re: Cannot startup webservice:  NullPointerException
              Thomas Diesler Master

              Portable web services started with J2EE-1.4 - we support that.