10 Replies Latest reply on Mar 16, 2005 4:18 PM by Thomas Diesler

    Webservice deployment exception -- cannot deploy

    Sal Gabier Newbie

      Hi all,

      I tried to follow the sample given in the jboss4guide (chapter 12) to create a simple web service (NOT an ejb). I create the deployment artifacts with wscompile and follow the tutorial quite carefully. When I try to deploy the war file thru eclipse (with the jboss plugin) I get the following exception below. Thanks for the help

      Sal

      java.lang.IllegalStateException: Cannot obtain WSDL definition, cause: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: The processing instruction target matching "[xX][mM][lL]" is not allowed.: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
      at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
      at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
      at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
      at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
      at org.jboss.webservice.WSDLDefinitionFactory.parse(WSDLDefinitionFactory.java:71)
      at org.jboss.webservice.metadata.WebserviceDescriptionMetaData.getWsdlDefinition(WebserviceDescriptionMetaData.java:204)
      at org.jboss.webservice.metadata.WebserviceDescriptionMetaData.updateServiceAddress(WebserviceDescriptionMetaData.java:224)
      at org.jboss.webservice.ServiceDeployer.startWebservice(ServiceDeployer.java:179)
      at org.jboss.webservice.ServiceDeployer.handleNotification(ServiceDeployer.java:111)
      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.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:138)
      at $Proxy29.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:218)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:376)
      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.GeneratedMethodAccessor46.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:177)
      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.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.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.GeneratedMethodAccessor9.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:177)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
      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: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:177)
      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:162)
      at org.jboss.Main$1.run(Main.java:423)
      at java.lang.Thread.run(Thread.java:534)

      at org.jboss.webservice.metadata.WebserviceDescriptionMetaData.getWsdlDefinition(WebserviceDescriptionMetaData.java:211)
      at org.jboss.webservice.metadata.WebserviceDescriptionMetaData.updateServiceAddress(WebserviceDescriptionMetaData.java:224)
      at org.jboss.webservice.ServiceDeployer.startWebservice(ServiceDeployer.java:179)
      at org.jboss.webservice.ServiceDeployer.handleNotification(ServiceDeployer.java:111)
      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.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:138)
      at $Proxy29.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:218)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:376)
      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.GeneratedMethodAccessor46.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:177)
      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.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.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.GeneratedMethodAccessor9.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:177)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
      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: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:177)
      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:162)
      at org.jboss.Main$1.run(Main.java:423)
      at java.lang.Thread.run(Thread.java:534)

        • 2. Re: Webservice deployment exception -- cannot deploy
          Sal Gabier Newbie

          Hi,

          I used the following config.xml file to create the webservices artifacts:

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






          ----------------------------------------------------

          the Simple.wsdl file follows
          <?xml version="1.0" encoding="UTF-8"?>

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

          <definitions name="Simple" targetNamespace="http://simpleWebService.ialock.com/" xmlns:tns="http://simpleWebService.ialock.com/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">










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

          <soap:operation soapAction=""/>

          <soap:body use="literal" namespace="http://simpleWebService.ialock.com/"/>

          <soap:body use="literal" namespace="http://simpleWebService.ialock.com/"/>


          <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
          ------------------------------------------------------

          Thanks, Sal

          • 3. Re: Webservice deployment exception -- cannot deploy
            Sal Gabier Newbie

            Whoops, let me try to post the code again. The config.xml used in with wscompile follows:

            <?xml version="1.0" encoding="UTF-8"?>
            
            <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
             <service name="Simple"
             targetNamespace="http://simpleWebService.ialock.com/"
             typeNamespace="http://simpleWebService.ialock.com/types"
             packageName="com.ialock.simpleWebService">
             <interface name="com.ialock.simpleWebService.SimpleInterface"/>
             </service>
            </configuration>


            -----------------------------------------------------------------------------
            The generated Simple.wsdl file is below:

            <?xml version="1.0" encoding="UTF-8"?>
            
            <?xml version="1.0" encoding="UTF-8"?>
            
            <definitions name="Simple" targetNamespace="http://simpleWebService.ialock.com/" xmlns:tns="http://simpleWebService.ialock.com/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
             <types/>
             <message name="SimpleInterface_getHelloWorld">
             <part name="String_1" type="xsd:string"/></message>
             <message name="SimpleInterface_getHelloWorldResponse">
             <part name="result" type="xsd:string"/></message>
             <portType name="SimpleInterface">
             <operation name="getHelloWorld" parameterOrder="String_1">
             <input message="tns:SimpleInterface_getHelloWorld"/>
             <output message="tns:SimpleInterface_getHelloWorldResponse"/></operation></portType>
             <binding name="SimpleInterfaceBinding" type="tns:SimpleInterface">
             <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
             <operation name="getHelloWorld">
             <soap:operation soapAction=""/>
             <input>
             <soap:body use="literal" namespace="http://simpleWebService.ialock.com/"/></input>
             <output>
             <soap:body use="literal" namespace="http://simpleWebService.ialock.com/"/></output></operation></binding>
             <service name="Simple">
             <port name="SimpleInterfacePort" binding="tns:SimpleInterfaceBinding">
             <soap:address location="REPLACE_WITH_ACTUAL_URL"/></port></service></definitions>
            

            ----------------------------------------------------------------------------

            Thanks, Sal

            • 4. Re: Webservice deployment exception -- cannot deploy
              Thomas Diesler Master

              If you really have two <?xml ...> declarations then thats the problem. The stack trace would indicate the same.

              • 5. Re: Webservice deployment exception -- cannot deploy
                Sal Gabier Newbie

                Thanks Thomas!

                I can't believe I missed that. I cut and pasted the contents bc of the location of the generated file and added an extra line.

                Sal

                • 6. Re: Webservice deployment exception -- cannot deploy
                  Sal Gabier Newbie

                  Hi again,

                  Once again I am trying to follow the tutorial in jboss4guide (chapter 12). I have successfuly (i think) deployed a simple webservice, and tried to create a client to test it. Here is the code i'm using for the client:

                  package com.ialock.client;
                  
                  import com.ialock.simpleWebService.*;
                  
                  import javax.xml.rpc.Service;
                  import javax.xml.rpc.ServiceFactory;
                  
                  import javax.xml.namespace.QName;
                  
                  import java.net.URL;
                  
                  /**
                   * @author Owner
                   *
                   * TODO To change the template for this generated type comment go to
                   * Window - Preferences - Java - Code Style - Code Templates
                   */
                  public class SimpleClient {
                  
                   public static void main(String[] args) throws Exception{
                  
                   String urlstr = "http://localhost:8080/SimpleWebService";
                   String argument = "This is my test :)";
                  
                  
                   System.out.println("Contacting webservice at " + urlstr);
                  
                   URL url = new URL(urlstr);
                  
                   QName qname = new QName("http://simpleWebService.ialock.com/",
                   "Simple");
                   ServiceFactory factory = null;
                   factory = ServiceFactory.newInstance();
                  
                   Service service = factory.createService(url, qname);
                  
                   SimpleInterface simple = (SimpleInterface) service.getPort(SimpleInterface.class);
                  
                   System.out.println("simple.getHelloWorld(" + argument + ")");
                   System.out.println("output:" + simple.getHelloWorld(argument));
                   }
                  }
                  


                  When I run the client, i get the following exception:

                  Contacting webservice at http://localhost:8080/SimpleWebService
                  javax.xml.rpc.ServiceException
                   at javax.xml.rpc.ServiceFactory.newInstance(ServiceFactory.java:69)
                   at com.ialock.client.SimpleClient.main(SimpleClient.java:39)
                  Exception in thread "main"


                  What's strange about this exception is that is caused by the following line:

                  factory = ServiceFactory.newInstance();


                  I don't even give any arguments to this static method. Why would this be throwing an exception?

                  Sal


                  • 7. Re: Webservice deployment exception -- cannot deploy
                    Jason Greene Master

                    A J2EE web service client is actually a J2EE application client. This means that a portion of the client is actually deployed on the server. Your standalone program then accesses the "client" by using jndi to retrieve it. Take a look at this step by step wiki, it walks you through the process using a very good example app.

                    http://www.jboss.org/wiki/Wiki.jsp?page=WSRPCClientStepByStep

                    Thanks,
                    -Jason

                    • 8. Re: Webservice deployment exception -- cannot deploy
                      Jason Greene Master

                      I forgot to explain your error. Basically you can not write a pure standalone client as you are doing. ServiceFactory is dying because it can not find the internal jbossws implementation. Change your application to use the methodology in the example and everything should work great!

                      Thanks,
                      -Jason

                      • 9. Re: Webservice deployment exception -- cannot deploy
                        Sal Gabier Newbie

                        Thanks Jason for the help. This leads me to a bigger question. I was under the impression that the reason we used webservices was to limit the binding between the client and server. I sounds to me like using jboss to write a webservice strongly binds the client and server. Shouldn't the someone be capable of writing a client for my webservice in many different languages? Am I on the wrong track here?

                        Thanks, Sal

                        • 10. Re: Webservice deployment exception -- cannot deploy
                          Thomas Diesler Master

                          JBossWS does not bind the lient to the server in any way. It offers you an implementation of the J2EE-1.4 compliant WS client programming model.

                          Your are free to use that client, or any other client you like. If you choose to go with a WS4EE client, which has many advantages in terms of deployment model and interoperability, you should follow the wiki.