11 Replies Latest reply on Jul 12, 2005 4:00 AM by Thomas Diesler

    Jboss-4.0.2 Client

    Gayathiri R Newbie

      I have deployed the webservice in jboss-4.0.2 successfully.
      I tried to run a client using this code

      String wsdlLocation="http://192.10.10.58:8080/availablewebsites/?wsdl";
       java.net.URL target=new java.net.URL(wsdlLocation);
       AvailableWebsiteEndpointSoapBindingStub bindingStub= (AvailableWebsiteEndpointSoapBindingStub)new AvailableWebsiteEndpointServiceLocator().getAvailableWebsiteEndpoint(target);


      When i run it i m getting the following exception

      org.jboss.axis.InternalException: org.jboss.axis.ConfigurationException: org.jboss.axis.ConfigurationException: No engine configuration file - aborting!
      org.jboss.axis.ConfigurationException: No engine configuration file - aborting!
       at org.jboss.axis.configuration.FileProvider.configureEngine(FileProvider.java:222)
       at org.jboss.axis.AxisEngine.init(AxisEngine.java:150)
       at org.jboss.axis.AxisEngine.<init>(AxisEngine.java:132)
       at org.jboss.axis.client.AxisClient.<init>(AxisClient.java:88)
       at org.jboss.axis.client.Service.getAxisClient(Service.java:370)
       at org.jboss.axis.client.Service.<init>(Service.java:144)
       at org.admin.ezyield.AvailableWebsiteEndpointServiceLocator.<init>(AvailableWebsiteEndpointServiceLocator.java:10)
       at org.admin.ezyield.WebsiteClient.main(WebsiteClient.java:27)
      
      org.jboss.axis.ConfigurationException: No engine configuration file - aborting!
      org.jboss.axis.ConfigurationException: No engine configuration file - aborting!
       at org.jboss.axis.configuration.FileProvider.configureEngine(FileProvider.java:222)
       at org.jboss.axis.AxisEngine.init(AxisEngine.java:150)
       at org.jboss.axis.AxisEngine.<init>(AxisEngine.java:132)
       at org.jboss.axis.client.AxisClient.<init>(AxisClient.java:88)
       at org.jboss.axis.client.Service.getAxisClient(Service.java:370)
       at org.jboss.axis.client.Service.<init>(Service.java:144)
       at org.admin.ezyield.AvailableWebsiteEndpointServiceLocator.<init>(AvailableWebsiteEndpointServiceLocator.java:10)
       at org.admin.ezyield.WebsiteClient.main(WebsiteClient.java:27)
      
       at org.jboss.axis.configuration.FileProvider.configureEngine(FileProvider.java:222)
       at org.jboss.axis.AxisEngine.init(AxisEngine.java:150)
       at org.jboss.axis.AxisEngine.<init>(AxisEngine.java:132)
       at org.jboss.axis.client.AxisClient.<init>(AxisClient.java:88)
       at org.jboss.axis.client.Service.getAxisClient(Service.java:370)
       at org.jboss.axis.client.Service.<init>(Service.java:144)
       at org.admin.ezyield.AvailableWebsiteEndpointServiceLocator.<init>(AvailableWebsiteEndpointServiceLocator.java:10)
       at org.admin.ezyield.WebsiteClient.main(WebsiteClient.java:27)



      I have placed the configuration file properly.Pls help me



        • 1. Re: Jboss-4.0.2 Client
          Anil Saldanha Master

          What you are missing is the "axis-client-config.wsdd" file. It should be available in the jboss-ws4ee-client.jar available in the client directory of your JBoss instance. So put it on your classpath (I mean the jar file).

          Looking at your code, it looks like you are using stubs on the client side. JBossWS does not support stubs for webservices. Try to look at dynamic proxy or the DII way of doing client programming.

          • 2. Re: Jboss-4.0.2 Client
            Gayathiri R Newbie

            As you said i tried the client using the dynamic proxy method...

            ServiceFactory serviceFactory = ServiceFactory.newInstance();
             Service service = serviceFactory.createService(new URL(WSDL_LOCATION), serviceQN);
            
             AvailableWebsiteEndpoint myProxy = (AvailableWebsiteEndpoint)service.getPort(portQN, AvailableWebsiteEndpoint.class);


            I am using jboss-4.0.2,jdk1.5 but still it is trowing exceptions

            java.rmi.RemoteException: null; nested exception is:
             java.lang.NullPointerException
             at org.jboss.webservice.client.PortProxy.invoke(PortProxy.java:176)
             at $Proxy1.getAvailableWebsites(Unknown Source)
             at org.admin.ezyield.WebsiteClient.main(WebsiteClient.java:66)
            Caused by: java.lang.NullPointerException
             at java.util.Hashtable.put(Hashtable.java:396)
             at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:395)
             at org.jboss.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:262)
             at org.jboss.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:684)
             at org.jboss.axis.Message.getSOAPEnvelope(Message.java:428)
             at org.jboss.axis.Message.getContentType(Message.java:494)
             at org.jboss.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:386)
             at org.jboss.axis.transport.http.HTTPSender.invoke(HTTPSender.java:126)
             at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
             at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
             at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
             at org.jboss.webservice.client.ClientEngine.invoke(ClientEngine.java:128)
             at org.jboss.axis.client.Call.invokeEngine(Call.java:3054)
             at org.jboss.axis.client.Call.invoke(Call.java:3039)
             at org.jboss.axis.client.Call.invoke(Call.java:2629)
             at org.jboss.axis.client.Call.invoke(Call.java:2538)
             at org.jboss.axis.client.Call.invokeInternal(Call.java:1976)
             at org.jboss.axis.client.Call.invoke(Call.java:1914)
             at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:265)
             at org.jboss.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:381)
             at $Proxy0.getAvailableWebsites(Unknown Source)
             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.webservice.client.PortProxy.invoke(PortProxy.java:105)


            there is no exceptions in the server side....

            Thanks

            • 3. Re: Jboss-4.0.2 Client
              Anil Saldanha Master

              Looks like you are using XercesImpl.jar that is available with jwsdp on the client side. Try to use the one from jboss-instance/lib/endorsed. Looking at the stacktrace, seems like it is failing because some property that the sax parser is expecting is null.

              On a related note, have you deployed the service interface as part of a J2EE client? If you do not know what I am talking about, then it may be easier for you to use the DII approach.

              • 5. Re: Jboss-4.0.2 Client
                Claire Costello Newbie

                Hi guyathiri,

                JBoss 4.0.2
                JDK/JRE 1.5
                Win Adv Serv 2003

                I am using the following code which calls the service using the DII method to invoke web services. I supply a WSDL URL and it manages to create the call and get a return value for me. Perhaps if you haven't tried this approach it may work for you.

                Maybe someone can tell me *how* this code works? What model is it using? Does this code go against any JBoss operation specifics/standards?

                -Claire.

                import javax.xml.namespace.*; //QName
                import javax.xml.rpc.*; //Service, ServiceFactory
                import java.net.URL;
                import java.rmi.RemoteException;
                
                ..........
                
                URL url = new URL("http://machinename:8080/hellows-ejb/hello?wsdl");
                QName qname = new QName("urn:MyHello", "HelloService");
                ServiceFactory factory = ServiceFactory.newInstance();
                Service service = factory.createService(url, qname);
                
                Call call = (Call)service.createCall(new QName("urn:MyHello", "HelloServiceEndpoint"), "sayHello");
                String msg = (String) call.invoke(new Object[]{});
                System.out.println(msg);
                


                • 6. Re: Jboss-4.0.2 Client
                  Gayathiri R Newbie

                  Claire,
                  I tried this code ...throws this exception

                  AxisFault
                   faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
                   faultSubcode:
                   faultString: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
                   faultActor:
                   faultNode:
                   faultDetail:
                   {http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.




                  • 7. Re: Jboss-4.0.2 Client
                    Gayathiri R Newbie

                    When i compile the files and creating the wsdl there are some warning messages


                    wsdl:
                     [java] getBundle(org.jboss.axis,org.jboss.axis.i18n,resource,null,...)
                     [java] loadBundle: Ignoring MissingResourceException: Can't find bundle for base name org.jboss.axis.resource, locale en_US
                     [java] Created org.jboss.axis.i18n.resource, linked to parent null
                     [java] getBundle(org.jboss.axis,org.jboss.axis.utils,resource,null,...)
                     [java] loadBundle: Ignoring MissingResourceException: Can't find bundle for base name org.jboss.axis.utils.resource, locale en_US
                     [java] loadBundle: Ignoring MissingResourceException: Can't find bundle for base name org.jboss.axis.resource, locale en_US
                     [java] Root package not found, cross link to org.jboss.axis.i18n.resource
                     [java] Root package not found, cross link to org.jboss.axis.i18n.resource
                     [java] Attachment support is enabled? true
                     [java] Enter/Exit: JAFDataHandlerDeserializerFactory(class java.lang.String, {http://xml.apache.org/xml-soap}PlainText)
                     [java] Enter/Exit: JAFDataHandlerDeserializerFactory(class java.lang.String, {http://xml.apache.org/xml-soap}PlainText)
                     [java] Enter/Exit: JAFDataHandlerDeserializerFactory(class java.awt.Image, {http://xml.apache.org/xml-soap}Image)
                     [java] Enter/Exit: JAFDataHandlerDeserializerFactory(class javax.mail.internet.MimeMultipart, {http://xml.apache.org/xml-soap}Multipart)
                     [java] Enter/Exit: JAFDataHandlerDeserializerFactory(interface javax.xml.transform.Source, {http://xml.apache.org/xml-soap}Source)
                     [java] Enter/Exit: JAFDataHandlerDeserializerFactory(class org.jboss.axis.attachments.OctetStream, {http://xml.apache.org/xml-soap}octetstream)
                     [java] Enter/Exit: JAFDataHandlerDeserializerFactory()
                     [java] @388993setReturnType(null)
                     [java] @b8f82dsetReturnType(null)
                     [java] @b8f82d added parameter >name: {http://ezyield.admin.org}in0
                     [java] typeEntry: null
                     [java] mode: IN
                     [java] isReturn: false
                     [java] typeQName: null
                     [java] javaType: class org.admin.ezyield.Hotel
                     [java] inHeader: false
                     [java] outHeader: false
                     [java] @d2906a<total parameters:1



                    This is my build.xml
                    <target name="wsdl" depends="compile">
                     <mkdir dir="${build.classes.dir}/WEB-INF/wsdl" />
                     <java classname="org.jboss.axis.wsdl.Java2WSDL" fork="yes" dir=".">
                     <classpath path="${classpath}" />
                     <arg value="-lhttp://tapthi:8080/availablewebsites/" />
                     <arg value="-sAvailableWebsiteEndpoint" />
                     <arg value="-oWEB-INF/wsdl/AvailableWebsites.wsdl" />
                     <arg value="-uLITERAL" />
                     <arg value="org.admin.ezyield.AvailableWebsiteEndpoint" />
                     </java>
                     </target>
                     <target name="wsdltojava" depends="wsdl">
                     <mkdir dir="${build.classes.dir}/WEB-INF/wsdl" />
                     <java classname="org.jboss.axis.wsdl.WSDL2Java" fork="yes" dir="${src.dir}/main/src">
                     <classpath path="${classpath}" />
                     <arg value="-S true" />
                     <arg value="${build.classes.dir}/WEB-INF/wsdl/AvailableWebsites.wsdl" />
                     </java>
                     </target>



                    Pls help me out

                    Thanks

                    • 8. Re: Jboss-4.0.2 Client
                      Jason Greene Master

                       

                      "darranl" wrote:
                      Looks like it is this issue again: -

                      http://jira.jboss.com/jira/browse/JBWS-187


                      Darran is correct, this is JBWS-187. This issue is already fixed in the branch, thanks to his patch, and will be included in the 4.0.3 release (any day now). Note this issue seems to only affect JDK1.5.

                      -Jason


                      • 9. Re: Jboss-4.0.2 Client
                        Jason Greene Master

                         

                        "clairecostello" wrote:


                        Maybe someone can tell me *how* this code works? What model is it using? Does this code go against any JBoss operation specifics/standards?

                        -Claire.


                        You are using the DII methodology for invoking the webservice. The only problem with this is that you have to manually configure all of the type mappings. There is also no way in the JAX-RPC api to pass a jaxrpc-mapping file using DII. We do have a proprietary method in our ServiceImpl class that allows it should you need to thise, but IMO you are better off using a standard J2EE webservices client.

                        -Jason

                        • 10. Re: Jboss-4.0.2 Client
                          Gayathiri R Newbie

                          Shall i download jboss-4.0.3 today ?

                          • 11. Re: Jboss-4.0.2 Client
                            Thomas Diesler Master

                            It is not released yet, web services is complete. You can try it out from cvs

                            cvs co -r Branch_4_0 jboss-4.0