1 Reply Latest reply on Feb 24, 2005 8:12 AM by Thomas Diesler

    unable to deploy web service..null pointer

    vista alta Newbie

      Hi,

      I am trying to deploy a java end point service.

      I am getting the following exception

      12:12:57,921 ERROR [ServiceDeployer] Cannot startup webservice for: JBOSSWEB.war
      java.lang.NullPointerException
      at org.jboss.webservice.metadata.WebserviceDescriptionMetaData.replaceAddressLocations(WebserviceDescriptionMetaData.
      java:256)
      at org.jboss.webservice.metadata.WebserviceDescriptionMetaData.updateServiceAddress(WebserviceDescriptionMetaData.jav
      a:229)
      at org.jboss.webservice.ServiceDeployer.startWebservice(ServiceDeployer.java:181)
      at org.jboss.webservice.ServiceDeployer.handleNotification(ServiceDeployer.java:113)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:138)
      at $Proxy28.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.start(SubDeployerSupport.java:178)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:378)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:944)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:718)
      at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
      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:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:175)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:305)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:481)
      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.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
      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:642)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:416)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
      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:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:175)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:944)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:718)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:702)
      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:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
      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:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:175)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:413)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:310)
      at org.jboss.Main.boot(Main.java:151)
      at org.jboss.Main$1.run(Main.java:405)
      at java.lang.Thread.run(Thread.java:534)


      I have generated the jaxrpc-mapping.xml and wsdl(LoginService.wsdl) using the following cmd

      wscompile -cp output/classes -gen:server -f:rpcliteral -f:explicitcontext -keep -mapping jaxrpc-mapping config.xml

      this is the genrated jaxrpc-mapping

      <?xml version="1.0" encoding="UTF-8"?>
      <java-wsdl-mapping version="1.1" 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://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
      <package-mapping>
      <package-type>com</package-type>
      http://org.jboss.test.webservice/samples/types
      </package-mapping>
      <package-mapping>
      <package-type>com</package-type>
      http://org.jboss.test.webservice/samples
      </package-mapping>
      <java-xml-type-mapping>
      <java-type>com.LoginInfo</java-type>
      <root-type-qname xmlns:typeNS="http://org.jboss.test.webservice/samples/types">typeNS:LoginInfo</root-type-qname>
      <qname-scope>complexType</qname-scope>
      <variable-mapping>
      <java-variable-name>loginName</java-variable-name>
      <xml-element-name>loginName</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>password</java-variable-name>
      <xml-element-name>password</xml-element-name>
      </variable-mapping>
      </java-xml-type-mapping>
      <java-xml-type-mapping>
      <java-type>com.Role</java-type>
      <root-type-qname xmlns:typeNS="http://org.jboss.test.webservice/samples/types">typeNS:Role</root-type-qname>
      <qname-scope>complexType</qname-scope>
      <variable-mapping>
      <java-variable-name>mRole</java-variable-name>
      <data-member/>
      <xml-element-name>mRole</xml-element-name>
      </variable-mapping>
      <variable-mapping>
      <java-variable-name>role</java-variable-name>
      <xml-element-name>role</xml-element-name>
      </variable-mapping>
      </java-xml-type-mapping>
      <service-interface-mapping>
      <service-interface>com.LoginService</service-interface>
      <wsdl-service-name xmlns:serviceNS="http://org.jboss.test.webservice/samples">serviceNS:LoginService</wsdl-service-name>
      <port-mapping>
      <port-name>LoginManagerIntPort</port-name>
      <java-port-name>LoginManagerIntPort</java-port-name>
      </port-mapping>
      </service-interface-mapping>
      <service-endpoint-interface-mapping>
      <service-endpoint-interface>com.LoginManagerInt</service-endpoint-interface>
      <wsdl-port-type xmlns:portTypeNS="http://org.jboss.test.webservice/samples">portTypeNS:LoginManagerInt</wsdl-port-type>
      <wsdl-binding xmlns:bindingNS="http://org.jboss.test.webservice/samples">bindingNS:LoginManagerIntBinding</wsdl-binding>
      <service-endpoint-method-mapping>
      <java-method-name>checkLogin</java-method-name>
      <wsdl-operation>checkLogin</wsdl-operation>
      <method-param-parts-mapping>
      <param-position>0</param-position>
      <param-type>com.LoginInfo</param-type>
      <wsdl-message-mapping>
      <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.test.webservice/samples">wsdlMsgNS:LoginManagerInt_checkLogin</wsdl-message>
      <wsdl-message-part-name>LoginInfo_1</wsdl-message-part-name>
      <parameter-mode>IN</parameter-mode>
      </wsdl-message-mapping>
      </method-param-parts-mapping>
      <wsdl-return-value-mapping>
      <method-return-value>com.Role</method-return-value>
      <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.test.webservice/samples">wsdlMsgNS:LoginManagerInt_checkLoginResponse</wsdl-message>
      <wsdl-message-part-name>result</wsdl-message-part-name>
      </wsdl-return-value-mapping>
      </service-endpoint-method-mapping>
      </service-endpoint-interface-mapping>
      </java-wsdl-mapping>

      My webservices.xml(hand coded ) is

      <?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">


      <webservice-description>
      <webservice-description-name>LoginManagerWSService</webservice-description-name>
      <wsdl-file>WEB-INF/wsdl/LoginService.wsdl</wsdl-file>
      <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
      <port-component>
      <port-component-name>LoginManagerInt</port-component-name>
      <wsdl-port>
      http://com
      LoginManagerInt
      </wsdl-port>
      <service-endpoint-interface>com.LoginManagerInt</service-endpoint-interface>
      <service-impl-bean>
      <servlet-link>com_LoginManagerWS</servlet-link>
      </service-impl-bean>
      </port-component>
      </webservice-description>


      The generated WSDL file is

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

      <definitions name="LoginService" targetNamespace="http://org.jboss.test.webservice/samples" xmlns:tns="http://org.jboss.test.webservice/samples" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://org.jboss.test.webservice/samples/types" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

      <schema targetNamespace="http://org.jboss.test.webservice/samples/types" xmlns:tns="http://org.jboss.test.webservice/samples/types" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">

















      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>

      <soap:operation soapAction=""/>

      <soap:body use="literal" namespace="http://org.jboss.test.webservice/samples"/>

      <soap:body use="literal" namespace="http://org.jboss.test.webservice/samples"/>


      <soap:address location="REPLACE_WITH_ACTUAL_URL"/>

      I am trying to deploy this web service on JBOSS 4.0.1RC1.

      What am I missing here ? I am stuck with this.

      Please help.

      Thanks