BEA Logo BEA WebLogic Server Release 6.1

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

  |  

  WebLogic Server Doc Home   |     Web Services   |   Previous Topic   |   Next Topic   |   Contents   |   Index   |   View as PDF

Troubleshooting

 

The following sections describe troubleshooting topics related to WebLogic Web Services:

 


Turning on Verbose Mode

Use the weblogic.soap.verbose initial context factory property in your client application to print out the SOAP messages that pass between WebLogic Server and the client application, as well as any errors produced by WebLogic Server.

In the following example, a client application that invokes a WebLogic Web Service has the weblogic.soap.verbose initial context factory property set to true to enable verbose mode:

Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,
      "weblogic.soap.http.SoapInitialContextFactory");
h.put("weblogic.soap.verbose", "true" );

The output is printed to the shell from which you execute the client application. Use this output to troubleshoot problems you encounter while invoking a Web service.

 


java.io.FileNotFoundException

Problem

Your client application, while attempting to invoke a WebLogic Web Service, throws the java.io.FileNotFoundException exception.

Explanation

The problem could be caused by the following:

The output from a java.io.FileNotFoundException error might look like the following:

Exception in thread "main" javax.naming.NamingException: i/o failed 
java.io.FileNotFoundException: 
http://localhost:7001/weather/statelessSession.WeatherHome/statelessSession.Wea
therHome.wsdl.  
Root exception is java.io.FileNotFoundException: 
http://localhost:7001/weather/statelessSession.WeatherHome/statelessSession.Wea
therHome.wsdl
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.ja
va:574)
        at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:553)
        at weblogic.soap.WebServiceProxy.getServiceAt(WebServiceProxy.java:172)
        at weblogic.soap.http.SoapContext.lookup(SoapContext.java:64)
        at javax.naming.InitialContext.lookup(InitialContext.java:350)
        at examples.webservices.rpc.javaClient.Client.main(Client.java:34)

Suggested Solution

If this error occurs when you attempt to invoke a WebLogic Web Service, follow these steps to ensure that the Web service and its components are correctly deployed and targeted:

  1. Invoke the Administration Console in your browser. See Invoking the Administration Console for details.

  2. In the left pane, click to expand the Applications node under the Deployments node.

  3. Click on the Enterprise Application that corresponds to the WebLogic Web Service that you are attempting to invoke.

  4. In the right pane, if the Deployed check box is not selected, select it and click the Apply button.

  5. In the left pane, under the Enterprise application that corresponds to your Web service, click the Web application that contains the SOAP servlets. The default name of this Web application is web-services.

  6. In the right pane, select the Targets tab.

  7. If it is not already there, move the name of the WebLogic Server instance on which the Web application should be running from the Available to the Chosen list box. Click Apply.

  8. If you are attempting to invoke an RPC-style WebLogic Web Service, follow these steps:

    1. In the left pane, under the Enterprise application that corresponds to your Web service, click on the name of the EJB jar file.

    2. In the right pane, select the Targets tab.

    3. If it is not already there, move the name of the WebLogic Server instance on which the EJB should be running from the Available to the Chosen list box and click Apply.

      If you are attempting to invoke a message-style Web service, follow these steps:

    4. In the left pane, click to expand the JMS node under the Services node.

    5. Click to expand the Connection Factories node.

    6. In the right pane, click the name of the JMS Connection Factory that you configured for the message-style Web service that you are trying to invoke.

    7. Select the Targets tab.

    8. If it is not already there, move the name of the WebLogic Server instance for which the Connection Factory should be targeted from the Available to the Chosen list box. Click Apply.

    9. In the right pane, click to expand the Servers node under the JMS node.

    10. Click the name of the JMS server which your message-style Web service is using.

    11. In the right pane, select the Targets tab.

    12. If it is not already there, move the name of the WebLogic Server for which the JMS Server is targeted from the Available to the Chosen list box and click Apply.

 


Unable to Parse Exception

Problem

The client application receives an "Unable to Parse" exception.

Explanation

The client API used to invoke Web Services uses the WebLogic FastParser to parse the WSDL and SOAP messages from the invoked Web service. If the WSDL or SOAP message from the Web service is not well-formed, the client application might receive an Unable to Parse error.

For example, if a Web service's WSDL file is not well-formed because of an element specifying two attributes with the same name, the client application produces the following error:

Exception in thread "main" javax.naming.NamingException: unable to parse 
org.xml.sax.SAXException: Attributes may not have the same name, more than
one xmlns:tns.  
Root exception is org.xml.sax.SAXException: Attributes may not have the same name, 
more than one xmlns:tns
        at
weblogic.xml.babel.baseparser.SAXElementFactory.createAttributes(SAXEleme
ntFactory.java:42)
        at
weblogic.xml.babel.baseparser.StreamElementFactory.createStartElementEven
t(StreamElementFactory.java:39)
        at
weblogic.xml.babel.parsers.StreamParser.streamParseSome(StreamParser.java:113)
        at
weblogic.xml.babel.parsers.BabelXMLEventStream.parseSome(BabelXMLEventStr
eam.java:46)
        at
weblogicx.xml.stream.XMLEventStreamBase.hasNext(XMLEventStreamBase.java:135)
        at
weblogicx.xml.stream.XMLEventStreamBase.hasStartElement(XMLEventStreamBase.java
:241)
        at 
weblogicx.xml.stream.XMLEventStreamBase.startElement(XMLEventStreamBase.java:23
4)
        at weblogic.soap.wsdl.binding.Definition.parse(Definition.java:121)
        at weblogic.soap.WebServiceProxy.getServiceAt(WebServiceProxy.java:171)
        at weblogic.soap.http.SoapContext.lookup(SoapContext.java:64)
        at javax.naming.InitialContext.lookup(InitialContext.java:350)
        at examples.webservices.rpc.javaClient.Client.main(Client.java:34)

Suggested Solution

Contact the Web service provider to ensure that the Web service produces well-formed WSDL and SOAP messages.

 


java.lang.NullPointerException

Problem

Your client application gets a java.lang.NullPointerException error in the methods in the weblogic.soap.wsdl.binding.* classes.

Explanation

One possible explanation is that the Web service's WSDL or SOAP messages, although possibly well-formed, are not valid.

For example, if the Web service's WSDL references an inputs element rather than the correct input, then the client application produces the following error:

was expecting 'input|output' but got:inputs
was expecting 'operation|input|output' but got:inputs
Exception in thread "main" java.lang.NullPointerException
        at weblogic.soap.wsdl.binding.Operation.getInputName(Operation.java:35)
        at
weblogic.soap.wsdl.binding.BindingOperation.populate(BindingOperation.jav
a:49)
        at weblogic.soap.wsdl.binding.Binding.populate(Binding.java:48)
        at weblogic.soap.wsdl.binding.Definition.populate(Definition.java:116)
        at weblogic.soap.WebServiceProxy.getServiceAt(WebServiceProxy.java:174)
        at weblogic.soap.http.SoapContext.lookup(SoapContext.java:64)
        at javax.naming.InitialContext.lookup(InitialContext.java:350)
        at examples.webservices.rpc.javaClient.Client.main(Client.java:34)

Suggested Solution

Contact the Web service host and ensure that the Web service produces valid WSDL and SOAP messages.

 


java.net.ConnectException

Problem

Your client application gets a java.net.ConnectException.

Explanation

One possible explanation is that the Web service is unreachable. In particular:

For example, if the client application attempts to invoke a WebLogic Web Service from a WebLogic Server instance that is currently not running, the application receives the following error:

Exception in thread "main" javax.naming.NamingException: i/o failed 
java.net.ConnectException: Connection refused: connect.  
Root exception is java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(FancyJulietImpl.java:320)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
        at java.net.PlainSocketImpl.connect(FancySchmancyBeverleyImpl.java:120)
        at java.net.Socket.<init>(Socket.java:273)
        at java.net.Socket.<init>(Socket.java:100)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:50)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:331)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:517)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:277)
        at sun.net.www.http.HttpClient.New(HttpClient.java:289)
        at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:408)
        at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.ja
va:501)
        at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:553)
        at weblogic.soap.WebServiceProxy.getServiceAt(WebServiceProxy.java:172)
        at weblogic.soap.http.SoapContext.lookup(SoapContext.java:64)
        at javax.naming.InitialContext.lookup(InitialContext.java:350)
        at examples.webservices.rpc.javaClient.Client.main(Client.java:34)

Suggested Solution

Either restart WebLogic Server, or contact the Web service host and ensure that the Web service is reachable.

For information about starting WebLogic Server, see WebLogic Server Administration Guide.

 

back to top previous page next page