5 Replies Latest reply on Dec 13, 2004 1:03 AM by younes

    problem to deploy web services

    jason.greene

      The namespace URI in the jaxrpc mapping must match the namespace URI in your wsdl file, it should not be the URI to the webservice.

      Change

      <namespaceURI>http://de.tuberlin.web.services/ToolWebPlug</namespaceURI>
      

      to
      <namespaceURI>http://interfaces.services.web.tuberlin.de</namespaceURI>
      


      Also, you are using SOAP encoding, which is deprecated by the current standards. Why don't you use wscompile in SUN's jwsdp to generate both the WSDL and jaxrpc-mapping. Take a look at EJB service enpoint wiki page for an example of how to use wscompile.


        • 1. problem to deploy web services
          younes

          i am writing simple web service, the interface is

          import java.rmi.Remote;
          import java.rmi.RemoteException;

          /**
          * @author younes
          *
          *
          */
          public interface ToolWebPlug extends Remote {

          /**
          *
          * @param service
          * @return @throws
          * RemoteException
          */
          public String callServiceString(String service, String method,
          String[] params)
          throws RemoteException;
          }

          my jaxrpc-mapping.xml looks like this:

          <?xml version='1.0' encoding='UTF-8' ?>
          <java-wsdl-mapping
          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"
          version="1.1">
          <package-mapping>
          <package-type>de.tuberlin.web.services</package-type>
          http://de.tuberlin.web.services/ToolWebPlug
          </package-mapping>
          </java-wsdl-mapping>

          my jboss.xml :

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web.dtd">

          <jboss-web>

          <!-- Resource references -->

          <!-- EJB References -->
          <ejb-ref>
          <ejb-ref-name>MyEJBTest</ejb-ref-name>
          <jndi-name>ejb/MyEJBTest</jndi-name>
          </ejb-ref>

          </jboss-web>

          my webservices.xml :

          <?xml version='1.0' encoding='UTF-8' ?>
          <webservices
          xmlns="http://java.sun.com/xml/ns/j2ee"
          xmlns:impl="http://com.myapp/ws4ee"
          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>ToolWebPlugService</webservice-description-name>
          <wsdl-file>WEB-INF/wsdl/plugservice.wsdl</wsdl-file>
          <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
          <port-component>
          <port-component-name>ToolWebPlug</port-component-name>
          <wsdl-port>ToolWebPlug</wsdl-port>
          <service-endpoint-interface>de.tuberlin.web.services.interfaces.ToolWebPlug</service-endpoint-interface>
          <service-impl-bean>
          <servlet-link>ToolWebPlugServlet</servlet-link>
          </service-impl-bean>
          </port-component>
          </webservice-description>


          my wsdl file :

          <?xml version="1.0" encoding="UTF-8"?>
          <wsdl:definitions targetNamespace="http://interfaces.services.web.tuberlin.de"
          xmlns:impl="http://interfaces.services.web.tuberlin.de"
          xmlns:intf="http://interfaces.services.web.tuberlin.de"
          xmlns:apachesoap="http://xml.apache.org/xml-soap"
          xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns="http://schemas.xmlsoap.org/wsdl/">

          <wsdl:types>





          <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>




          </wsdl:types>

          <wsdl:message name="callServiceStringRequest">

          <wsdl:part name="in0" type="xsd:string"/>

          <wsdl:part name="in1" type="xsd:string"/>

          <wsdl:part name="in2" type="impl:ArrayOf_xsd_string"/>

          </wsdl:message>

          <wsdl:message name="callServiceStringResponse">

          <wsdl:part name="callServiceStringReturn" type="xsd:string"/>

          </wsdl:message>

          <wsdl:portType name="ToolWebPlug">

          <wsdl:operation name="callServiceString" parameterOrder="in0 in1 in2">

          <wsdl:input name="callServiceStringRequest" message="impl:callServiceStringRequest"/>

          <wsdl:output name="callServiceStringResponse" message="impl:callServiceStringResponse"/>

          </wsdl:operation>

          </wsdl:portType>

          <wsdl:binding name="ToolWebPlugSoapBinding" type="impl:ToolWebPlug">

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

          <wsdl:operation name="callServiceString">

          <wsdlsoap:operation soapAction=""/>

          <wsdl:input name="callServiceStringRequest">

          <wsdlsoap:body use="literal" namespace="http://interfaces.services.web.tuberlin.de"/>

          </wsdl:input>

          <wsdl:output name="callServiceStringResponse">

          <wsdlsoap:body use="literal" namespace="http://interfaces.services.web.tuberlin.de"/>

          </wsdl:output>

          </wsdl:operation>

          </wsdl:binding>

          <wsdl:service name="ToolWebPlugService">

          <wsdl:port name="ToolWebPlug" binding="impl:ToolWebPlugSoapBinding">

          <wsdlsoap:address location="http://localhost:8080/ws4ee/services/ToolWebPlug"/>

          </wsdl:port>

          </wsdl:service>

          </wsdl:definitions>

          wenn i try to deploy my web service jboss throws this exception:

          21:07:44,900 ERROR [ServiceDeployer] Cannot startup webservice for: simple-ws4ee.war
          org.jboss.deployment.DeploymentException: Cannot deploy webservice; - nested throwable: (RuntimeMBeanException: null Cause: java.lang.IllegalArgumentException: Cannot find package type for: {http://interfaces.services.web.tuberlin.de}ArrayOf_xsd_string)
          at org.jboss.webservice.ServiceDeployer.deployWebservices(ServiceDeployer.java:342)
          at org.jboss.webservice.ServiceDeployer.startWebservice(ServiceDeployer.java:203)
          at org.jboss.webservice.ServiceDeployer.handleNotification(ServiceDeployer.java:113)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:138)
          at $Proxy25.handleNotification(Unknown Source)
          at javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:104)
          at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:87)
          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:935)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
          at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          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:119)
          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:242)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
          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:271)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          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:242)
          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.GeneratedMethodAccessor5.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          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:242)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
          at $Proxy4.start(Unknown Source)
          at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
          at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          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:119)
          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:242)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
          at $Proxy5.deploy(Unknown Source)
          at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
          at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
          at org.jboss.Main.boot(Main.java:151)
          at org.jboss.Main$1.run(Main.java:405)
          at java.lang.Thread.run(Unknown Source)
          Caused by: RuntimeMBeanException: null Cause: java.lang.IllegalArgumentException: Cannot find package type for: {http://interfaces.services.web.tuberlin.de}ArrayOf_xsd_string
          at org.jboss.mx.interceptor.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:162)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:149)
          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:242)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
          at org.jboss.webservice.ServiceDeployer.deployWebservices(ServiceDeployer.java:333)
          ... 80 more
          Caused by: java.lang.IllegalArgumentException: Cannot find package type for: {http://interfaces.services.web.tuberlin.de}ArrayOf_xsd_string
          at org.jboss.webservice.deployment.ServiceDescription.getPackageName(ServiceDescription.java:816)
          at org.jboss.webservice.deployment.ServiceDescription.initTypeMappings(ServiceDescription.java:798)
          at org.jboss.webservice.deployment.ServiceDescription.initServiceDescription(ServiceDescription.java:114)
          at org.jboss.webservice.deployment.ServiceDescription.(ServiceDescription.java:81)
          at org.jboss.webservice.AxisService.generateDeploymentWSDD(AxisService.java:378)
          at org.jboss.webservice.AxisService.deployService(AxisService.java:242)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
          ... 85 more

          Thanks for your help.

          • 2. Re: problem to deploy web services
            younes

            Thanks jasong, it works now. I m on the way to use wscompile.

            sorry, but an other problem was produced after deploying, wenn i try to views the available services
            in http://localhost:8080/ws4ee/services

            AXIS error
            Sorry, something seems to have gone wrong... here are the details:

            Exception - org.apache.axis.InternalException: java.lang.Exception: The OperationDesc for callServiceString was not synchronized to a method of de.tuberlin.web.services.interfaces.ToolWebPlug.

            thanks


            • 3. Re: problem to deploy web services
              thomas.diesler

              You can turn on debugging on the org.apache.axis category. That should show you the internal structure of the OperationDesc - see where this does not match the methods in your service endpoint interface (SEI)

              Also, examine the generated wsdd in ${jboss.data.dir}/wsdl and check if if contatins the opertions as you expect them.

              • 4. Re: problem to deploy web services
                younes

                sorry but i could not see what s wrong. here are wsdl und wsdd under ${jboss.data.dir}


                [list=]<deployment
                xmlns='http://xml.apache.org/axis/wsdd/'
                xmlns:java='http://xml.apache.org/axis/wsdd/providers/java'
                xmlns:soap='http://schemas.xmlsoap.org/soap/encoding/'
                xmlns:xsi='http://www.w3.org/2000/10/XMLSchema-instance'
                xmlns:xsd='http://www.w3.org/2001/XMLSchema'>






                <operation name='callServiceString'
                qname='ns1:callServiceString'
                returnQName='callServiceStringReturn'
                returnType='xsd:string' xmlns:ns1='http://interfaces.services.web.tuberlin.de' >


                <parameter name='in2' qname='in2' mode='IN' type='ns1:ArrayOf_xsd_string'
                xmlns:ns1='http://interfaces.services.web.tuberlin.de' />


                <typeMapping
                qname='ns1:ArrayOf_xsd_string'
                xmlns:ns1='http://interfaces.services.web.tuberlin.de'
                type='java:de.tuberlin.web.services.ArrayOf_xsd_string'
                serializer='org.apache.axis.encoding.ser.BeanSerializerFactory'
                deserializer='org.apache.axis.encoding.ser.BeanDeserializerFactory'
                encodingStyle=''>






                the wsdl

                [list=]<?xml version="1.0" encoding="UTF-8"?>
                <wsdl:definitions targetNamespace="http://interfaces.services.web.tuberlin.de" xmlns:impl="http://interfaces.services.web.tuberlin.de" xmlns:intf="http://interfaces.services.web.tuberlin.de" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
                <wsdl:types>





                <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>




                </wsdl:types>
                <wsdl:message name="callServiceStringRequest">
                <wsdl:part name="in0" type="xsd:string"/>
                <wsdl:part name="in1" type="xsd:string"/>
                <wsdl:part name="in2" type="impl:ArrayOf_xsd_string"/>
                </wsdl:message>
                <wsdl:message name="callServiceStringResponse">
                <wsdl:part name="callServiceStringReturn" type="xsd:string"/>
                </wsdl:message>
                <wsdl:portType name="ToolWebPlug">
                <wsdl:operation name="callServiceString" parameterOrder="in0 in1 in2">
                <wsdl:input name="callServiceStringRequest" message="impl:callServiceStringRequest"/>
                <wsdl:output name="callServiceStringResponse" message="impl:callServiceStringResponse"/>
                </wsdl:operation>
                </wsdl:portType>
                <wsdl:binding name="ToolWebPlugSoapBinding" type="impl:ToolWebPlug">
                <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
                <wsdl:operation name="callServiceString">
                <wsdlsoap:operation soapAction=""/>
                <wsdl:input name="callServiceStringRequest">
                <wsdlsoap:body use="literal" namespace="http://interfaces.services.web.tuberlin.de"/>
                </wsdl:input>
                <wsdl:output name="callServiceStringResponse">
                <wsdlsoap:body use="literal" namespace="http://interfaces.services.web.tuberlin.de"/>
                </wsdl:output>
                </wsdl:operation>
                </wsdl:binding>
                <wsdl:service name="ToolWebPlugService">
                <wsdl:port name="ToolWebPlug" binding="impl:ToolWebPlugSoapBinding">
                <wsdlsoap:address location="http://localhost:8080/simple-ws4ee/exactpath/jse"/>
                </wsdl:port>
                </wsdl:service>
                </wsdl:definitions>

                the method callServiceString :

                public String callServiceString(String service, String method, String[] params)

                thanks

                • 5. Re: problem to deploy web services
                  jason.greene

                  Try wrapping your array in a javabean. Alternatively you could define a custom typemapping that uses ArraySerializer but this is for SOAP encoding only.

                  Take a look at this wiki page: WSArrayTypeMapping.

                  -Jason