![]() |
![]() |
|
|
| |
Troubleshooting
The following sections describe troubleshooting topics related to WebLogic Web Services:
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.
Your client application, while attempting to invoke a WebLogic Web Service, throws the java.io.FileNotFoundException exception.
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)
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:
If you are attempting to invoke a message-style Web service, follow these steps:
The client application receives an "Unable to Parse" exception.
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)
Contact the Web service provider to ensure that the Web service produces well-formed WSDL and SOAP messages.
java.lang.NullPointerException
Your client application gets a java.lang.NullPointerException error in the methods in the weblogic.soap.wsdl.binding.* classes.
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)
Contact the Web service host and ensure that the Web service produces valid WSDL and SOAP messages.
Your client application gets a java.net.ConnectException.
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)
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.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|