6 Replies Latest reply on Jun 3, 2005 5:29 AM by semundseth

    run-ws task does not work! - wrong URL!

      If you're trying to execute the "run-ws" command via ANT, it won't work.. to get it working, edit the file "WSClient.java" located in "<your-path>\j2eetutorial14\examples\bank\src\com\jboss\ebank" directory

      Change the line:
      URL url = new URL("http://localhost:8080/bankws-ejb/TellerService?wsdl");

      to:
      URL url = new URL("http://localhost:8080/bankws-ejb/TellerService?wsdl");

      compile and deploy the webservice again:

      ant -f jboss-build.xml compile
      ant -f jboss-build.xml package-ws
      ant -f jboss-build.xml deploy-ws

      And now it should work :-)

      Good luck :-)

        • 1. Re: run-ws task does not work! - wrong URL!

          UPSSS!!

          My bad.. I started of with at copy-paste error...ieekkk...

          the line is originally:

          URL url = new URL("http://localhost:8080/ws4ee/services/TellerService?wsdl");

          But should be:

          URL url = new URL("http://localhost:8080/bankws-ejb/TellerService?wsdl");

          sorry!...




          • 2. Re: run-ws task does not work! - wrong URL!
            msargent

            I tried this but I am still getting an error. Can you take a look at the error below and see if this is similar to what you were getting. Thanks,

            C:\Java\j2eetutorial14\examples\bank>ant -f jboss-build.xml run-ws
            Buildfile: jboss-build.xml

            run-ws:
            [java] Customer: 200, url: http://localhost:8080/bankws-ejb/TellerService?wsdl qname: {http://ebank.jboss.com}TellerService, fa
            ctory: org.jboss.webservice.client.ServiceFactoryImpl@13a317a, service: org.jboss.webservice.client.ServiceImpl@186768e, endpoint: o
            rg.jboss.webservice.client.CallImpl@d19bc8
            [java] trying endpoint.getAccountBalance(5008)
            [java] 2005-02-03 17:42:53,963 ERROR org.jboss.webservice.client.PortProxy[main] - Port error
            [java] java.lang.NullPointerException
            [java] Exception in thread "main" java.rmi.RemoteException: null; nested exception is:
            [java] at java.util.Hashtable.put(Hashtable.java:396)
            [java] java.lang.NullPointerException
            [java] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:395)
            [java] at org.jboss.webservice.client.PortProxy.invoke(PortProxy.java:125)
            [java] at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:260)
            [java] at $Proxy0.getAccountBalance(Unknown Source)
            [java] at org.apache.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:654)
            [java] at com.jboss.ebank.WSClient.main(WSClient.java:42)
            [java] at org.apache.axis.Message.getSOAPEnvelope(Message.java:430)
            [java] Caused by: java.lang.NullPointerException
            [java] at org.apache.axis.Message.getContentType(Message.java:496)
            [java] at java.util.Hashtable.put(Hashtable.java:396)
            [java] at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:386)
            [java] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:395)
            [java] at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:126)
            [java] at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:260)
            [java] at org.apache.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:654)
            [java] at org.apache.axis.Message.getSOAPEnvelope(Message.java:430)
            [java] at org.apache.axis.Message.getContentType(Message.java:496)
            [java] at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:386)
            [java] at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:126)
            [java] at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
            [java] at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:160)
            [java] at org.apache.axis.SimpleChain.invoke(SimpleChain.java:123)
            [java] at org.jboss.webservice.client.ClientEngine.invoke(ClientEngine.java:126)
            [java] at org.apache.axis.client.Call.invokeEngine(Call.java:3032)
            [java] at org.apache.axis.client.Call.invoke(Call.java:3017)
            [java] at org.apache.axis.client.Call.invoke(Call.java:2611)
            [java] at org.apache.axis.client.Call.invoke(Call.java:2516)
            [java] at org.apache.axis.client.Call.invokeInternal(Call.java:1968)
            [java] at org.apache.axis.client.Call.invoke(Call.java:1909)
            [java] at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:175)
            [java] at org.apache.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:373)
            [java] at $Proxy0.getAccountBalance(Unknown Source)
            [java] at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
            [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            [java] at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:160)
            [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            [java] at org.apache.axis.SimpleChain.invoke(SimpleChain.java:123)
            [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            [java] at org.jboss.webservice.client.ClientEngine.invoke(ClientEngine.java:126)
            [java] at java.lang.reflect.Method.invoke(Method.java:585)
            [java] at org.apache.axis.client.Call.invokeEngine(Call.java:3032)
            [java] at org.jboss.webservice.client.PortProxy.invoke(PortProxy.java:93)
            [java] at org.apache.axis.client.Call.invoke(Call.java:3017)
            [java] ... 2 more
            [java] at org.apache.axis.client.Call.invoke(Call.java:2611)
            [java] at org.apache.axis.client.Call.invoke(Call.java:2516)
            [java] at org.apache.axis.client.Call.invokeInternal(Call.java:1968)
            [java] at org.apache.axis.client.Call.invoke(Call.java:1909)
            [java] at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:175)
            [java] at org.apache.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:373)
            [java] at $Proxy0.getAccountBalance(Unknown Source)
            [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            [java] at java.lang.reflect.Method.invoke(Method.java:585)
            [java] at org.jboss.webservice.client.PortProxy.invoke(PortProxy.java:93)
            [java] at $Proxy0.getAccountBalance(Unknown Source)
            [java] at com.jboss.ebank.WSClient.main(WSClient.java:42)
            [java] Java Result: 1

            • 3. Re: run-ws task does not work! - wrong URL!

              Hi!

              It's not the same error I got before the fix, but I will try to test it again this weekend...

              I'll get back to you as soon as possible :-)

              • 4. Re: run-ws task does not work! - wrong URL!
                semundseth

                Hi henrikrathje,
                I ran into the same problem.
                Did you solve the problem?

                Regards
                Håvard

                • 5. Re: run-ws task does not work! - wrong URL!

                  Hi Håvard

                  I'm sorry but I could not create that problem! It's been a while so unfortunately i don't have the examples running anymore :-(

                  But the error seems to sugest that the port on which the service is trying to connect is eiher not answering or is not available? Maybe you have another process running on that port?
                  Maybe you could try to change the port number in the code, and see if that solves anything... but you probably already tried that?

                  IF I get the time I will try if I can reconstruct the problem during the weekend, but I can't promise that I get it done... I'm pretty hung up at work at the moment.. yes, also working weekends at the moment :-/

                  Hope you solve the problem... if not, and if I havent posted anything, then try to post another reply... I will continue to wath this topic :-)

                  Good luck
                  Henrik Rathje

                  • 6. Re: run-ws task does not work! - wrong URL!
                    semundseth

                    Hi henrikrathje,
                    Thanx for responding.
                    -Yes I have done various checks on the port where the webservice is running.
                    And I think I got no other processes running on that port?other than the JBoss server.
                    Is it smart to change the port number for the webservice, since my JBoss server is running on port number 8080??
                    I would really appreciate your help since I am stuck at the moment.
                    When I try to run the ant task ?run-ws? I get the following exception:

                    run-ws:
                     [java] Customer: 200
                     [java] 10:59:52,128 ERROR [PortProxy] Port error
                     [java] java.lang.NullPointerException
                     [java] at java.util.Hashtable.put(Unknown Source)
                     [java] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(Unknown Source)
                     [java] at org.jboss.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:262)
                     [java] at org.jboss.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:684)
                     [java] at org.jboss.axis.Message.getSOAPEnvelope(Message.java:428)
                     [java] at org.jboss.axis.Message.getContentType(Message.java:494)
                     [java] at org.jboss.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:386)
                     [java] at org.jboss.axis.transport.http.HTTPSender.invoke(HTTPSender.java:126)
                     [java] at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
                     [java] at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
                     [java] at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
                     [java] at org.jboss.webservice.client.ClientEngine.invoke(ClientEngine.java:128)
                     [java] at org.jboss.axis.client.Call.invokeEngine(Call.java:3054)
                     [java] at org.jboss.axis.client.Call.invoke(Call.java:3039)
                     [java] at org.jboss.axis.client.Call.invoke(Call.java:2629)
                     [java] at org.jboss.axis.client.Call.invoke(Call.java:2538)
                     [java] at org.jboss.axis.client.Call.invokeInternal(Call.java:1976)
                     [java] at org.jboss.axis.client.Call.invoke(Call.java:1914)
                     [java] at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:265)
                     [java] at org.jboss.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:381)
                     [java] at $Proxy0.getAccountsOfCustomer(Unknown Source)
                     [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     [java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                     [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                     [java] at java.lang.reflect.Method.invoke(Unknown Source)
                     [java] at org.jboss.webservice.client.PortProxy.invoke(PortProxy.java:105)
                     [java] at $Proxy1.getAccountsOfCustomer(Unknown Source)
                     [java] at com.jboss.ebank.WSClient.main(WSClient.java:32)
                     [java] Exception in thread "main" java.rmi.RemoteException: null; nested exception is:
                     [java] java.lang.NullPointerException
                     [java] at org.jboss.webservice.client.PortProxy.invoke(PortProxy.java:176)
                     [java] at $Proxy1.getAccountsOfCustomer(Unknown Source)
                     [java] at com.jboss.ebank.WSClient.main(WSClient.java:32)
                     [java] Caused by: java.lang.NullPointerException
                     [java] at java.util.Hashtable.put(Unknown Source)
                     [java] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(Unknown Source)
                     [java] at org.jboss.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:262)
                     [java] at org.jboss.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:684)
                     [java] at org.jboss.axis.Message.getSOAPEnvelope(Message.java:428)
                     [java] at org.jboss.axis.Message.getContentType(Message.java:494)
                     [java] at org.jboss.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:386)
                     [java] at org.jboss.axis.transport.http.HTTPSender.invoke(HTTPSender.java:126)
                     [java] at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
                     [java] at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
                     [java] at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
                     [java] at org.jboss.webservice.client.ClientEngine.invoke(ClientEngine.java:128)
                     [java] at org.jboss.axis.client.Call.invokeEngine(Call.java:3054)
                     [java] at org.jboss.axis.client.Call.invoke(Call.java:3039)
                     [java] at org.jboss.axis.client.Call.invoke(Call.java:2629)
                     [java] at org.jboss.axis.client.Call.invoke(Call.java:2538)
                     [java] at org.jboss.axis.client.Call.invokeInternal(Call.java:1976)
                     [java] at org.jboss.axis.client.Call.invoke(Call.java:1914)
                     [java] at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:265)
                     [java] at org.jboss.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:381)
                     [java] at $Proxy0.getAccountsOfCustomer(Unknown Source)
                     [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     [java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                     [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                     [java] at java.lang.reflect.Method.invoke(Unknown Source)
                     [java] at org.jboss.webservice.client.PortProxy.invoke(PortProxy.java:105)
                     [java] ... 2 more
                     [java] Java Result: 1
                    BUILD SUCCESSFUL
                    Total time: 8 seconds
                    


                    I also noticed that the JBoss server prompt:

                    [JavaWsdlMapping] Cannot find jaxrpc-mapping for type: {http://ebank.jboss.com}AccountList
                    


                    When the webservice is deployed. Also noticed that the guide uses String arrays
                    (String [] in WSClient and AccountList) but AccountList type in the code.
                    Do you think this also may affect on how the client program interact with the webservice?


                    (I?m running JBoss-4.0.2, SDK/JRE 1.5.0_02 and J2EE 1.4 Libraries)
                    I could provide you with my source if that?s any help?
                    Once again thanx for your time.

                    Cheers
                    Håvard