Error while reading wsdl file …. Exception: null
Although my SOA Suite composites deployed without any error, for some of them JDeveloper returned a “Error while reading wsdl file …. Exception: null” error when opening one of my external references to adapters within that composite. This general occurred to me after upgrading a 10g BPEL service to a 11g composite. When receiving this error, a namespace or attribute within the adapters WSDL can be incorrect, but i also found out that it can show up when the WSDL is 100% correct. This is probably due to a bug in JDeveloper Studio Edition Version 11.1.1.5.0 or 11.1.1.6.0. Here some hints where to look for in the WSDL, how to solve the issue and eventually working around the JDeveloper bug.
It is all about the namespace declarations and attributes for the <definitions> element in the WSDL of the external referenced service. It will, or should look similar to the example below.
The external reference is defined in the composite.xml, an example to SomeExternalService is given below.
First check that the value of attribute name corresponds with the base name of the WSDL. When the WSDL has the filename SomeExternalService.wsdl the attribute name should have been assigned the value SomeExternalService. Although the name attribute is optional and not related to the file name according to the W3C Note Web Services Description Language (WSDL) 1.1 it is required for external references and must match the base file name in SOA Composites.
After migration of a 10g BPEL service to a 11g composite, the targetNamespace of the adapters WSDL can be migrated to the 11g composite. So after migration the targetNamespace can end op looking like SomeExternalService.company.com. The targetNamespace of an 11g adapter however should follow the convention
When your still receive the error when opening the external reference in JDeveloper, stop JDeveloper and start it up from the command line by executing jdev from the jdeveloper\jdev\bin directory. Re-open the external reference from the composite of you SOA project. Look at the command line from where you (re-)started JDeveloper and search for a java.lang.NullPointerException. If this exception is thrown from method initAdapterWSDLNoJca of class WizardWSDLUtil.java try to change the targetNamespace of the service adapter WSDL. I discovered that this error can be caused by the length and composition of path parts in the targetNamespace. So the following perfectly valid targetNamespace of your adapters WSDL can lead to the previously mentioned error in JDeveloper when opening it.
It occurred to me that changing the targetNamespace by inserting an "A" in the project name helped me opening the adapters wizard.
And changing the "A" into an "a" can break it again.
So when getting a "Error while reading wsdl file …. Exception: null" when opening an adapter wizard in JDeveloper 11, you can work around this by temporarily changing the targetNamespace of the adapters WSDL. My experience is that the error occurs less with shorter URIs, so changing it temporarily to a much shorter URI by replacing the application-, project an adapter name to aaa/bbb/ccc will probably enable you to open the wizard again.
Tweet
It is all about the namespace declarations and attributes for the <definitions> element in the WSDL of the external referenced service. It will, or should look similar to the example below.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/http/SomeApplication/SomeProject/SomeExternalService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SomeExternalService" targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/http/SomeApplication/SomeProject/SomeExternalService">
The external reference is defined in the composite.xml, an example to SomeExternalService is given below.
<reference name="SomeExternalReference" ui:wsdlLocation="SomeExternalService.wsdl"> <interface.wsdl xmlns:ns="http://xmlns.oracle.com/sca/1.0" interface="http://xmlns.oracle.com/pcbpel/adapter/http/SomeApplication/SomeProject/SomeExternalService#wsdl.interface(SomePost)"/> <binding.ws xmlns:ns="http://xmlns.oracle.com/sca/1.0" location="SomeExternalReference" port="http://xmlns.oracle.com/pcbpel/adapter/http/SomeApplication/SomeProject/SomeExternalService#wsdl.endpoint(SomePost/SomePost)" supports="http">
First check that the value of attribute name corresponds with the base name of the WSDL. When the WSDL has the filename SomeExternalService.wsdl the attribute name should have been assigned the value SomeExternalService. Although the name attribute is optional and not related to the file name according to the W3C Note Web Services Description Language (WSDL) 1.1 it is required for external references and must match the base file name in SOA Composites.
After migration of a 10g BPEL service to a 11g composite, the targetNamespace of the adapters WSDL can be migrated to the 11g composite. So after migration the targetNamespace can end op looking like SomeExternalService.company.com. The targetNamespace of an 11g adapter however should follow the convention
http://xmlns.oracle.com/pcbpel/adapter/{adapter type}/{Application}/{Project}/{External Service}. e.g.
http://xmlns.oracle.com/pcbpel/adapter/http/SomeApplication/SomeProject/SomeExternalService. Make sure when changing the target namespace of the service adapter WSDL also to change the tns alias in the same WSDL and namespace in the assignment to the attributes interface and port of the reference and binding.ws elements of the composite.xml.
When your still receive the error when opening the external reference in JDeveloper, stop JDeveloper and start it up from the command line by executing jdev from the jdeveloper\jdev\bin directory. Re-open the external reference from the composite of you SOA project. Look at the command line from where you (re-)started JDeveloper and search for a java.lang.NullPointerException. If this exception is thrown from method initAdapterWSDLNoJca of class WizardWSDLUtil.java try to change the targetNamespace of the service adapter WSDL. I discovered that this error can be caused by the length and composition of path parts in the targetNamespace. So the following perfectly valid targetNamespace of your adapters WSDL can lead to the previously mentioned error in JDeveloper when opening it.
targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/http/SomeApplication/SomeProject/SomeExternalService"
It occurred to me that changing the targetNamespace by inserting an "A" in the project name helped me opening the adapters wizard.
targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/http/SomeApplication/ASomeProject/SomeExternalService"
And changing the "A" into an "a" can break it again.
targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/http/SomeApplication/aSomeProject/SomeExternalService"
So when getting a "Error while reading wsdl file …. Exception: null" when opening an adapter wizard in JDeveloper 11, you can work around this by temporarily changing the targetNamespace of the adapters WSDL. My experience is that the error occurs less with shorter URIs, so changing it temporarily to a much shorter URI by replacing the application-, project an adapter name to aaa/bbb/ccc will probably enable you to open the wizard again.
Tweet
blog comments powered by Disqus