Wednesday, April 24, 2013

JDeveloper SOA Deployment Error: Unable to find a WSDL that has a definition for service

This is one of the strange errors that I encountered recently. While trying to deploy a SOA project, JDeveloper reported the following error;


Received HTTP response from the server, response code=500
Error deploying archive sca_CreditCardProcess_rev1.0.jar to partition "default" on server soa_server1 [http://bpmsrv.example.com:8001] 
HTTP error code returned [500]
Error message from server:
There was an error deploying the composite on soa_server1: Deployment Failed: Unable to find a WSDL that has a definition for service {http://xmlns.oracle.com/bpmn/bpmnProcess/CreditCardProcess}CreditCardProcess.service and port CreditCardProcessPort.  Please make sure that the port attribute for the binding defined in the composite file is correct by checking the namespace, service name, and port name.  In addition, check that the WSDL associated with the binding namespace is imported and currently reachable (check the import nodes at the top of the composite file). Finally, validate the HTTP proxy settings for the server..

Check server log for more details.
Error deploying archive sca_CreditCardProcess_rev1.0.jar to partition "default" on server soa_server1 [http://bpmsrv.example.com:8001] 
####  Deployment incomplete.  ####

The error reported in JDeveloper is very misleading and it took me significant amount of time & effort to figure out the actual root cause. This was particularly strange in my case because the code was deployed multiple times successfully without errors in my dev environment.

Root Cause:

On closer observation into the soa server logs, I noted that a webservice reference was not "reachable" by the SOA composite and hence this error. This had nothing to do with the "exposed" service, its port or definitions whatsoever.

Fix:

In my case, the referenced webservice's hostname mapping was missing in my "new" environment because of which the SOA composite was unable to find the WSDL during deployment. It is fair for JDeveloper not to complain because it usually runs on client machine/laptop where the hostname mappings might exist. The deployment error is thrown at the server side and hence the key is to analyze the SOA server logs to figure the actual issue for a fix.

Hope this will help users with similar issues.