Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.2.4 (EE only), 2.2.5 (EE only), 3.0.0-M4
-
Fix Version/s: 2.2.6 (EE only)
-
Component/s: Modules: CXF
-
Labels:None
-
User impact:Low
-
Similar Issues:None
Description
When an endpoint is configured like this:
<cxf:inbound-endpoint address="http://localhost:8088/TestProxy" synchronous="true" proxy="true" endpointName="TestPOJOComponentPort" serviceName="TestPOJOComponent" wsdlLocation="./TestProxyImpl.wsdl" />
If the namespace parameter is not specified, then a NullPointerException is thrown at ProxyServiceConfiguration.getEndpointName() line: 49:
return new QName(getServiceNamespace(), ((Port) definition.getService( getServiceFactory().getServiceQName()).getPorts().values().iterator().next()).getName());
This is because definition.getService(getServiceFactory().getServiceQName()) is returning null.
The workaround is to just supply the namespace parameter, like this:
<cxf:inbound-endpoint address="http://localhost:8088/TestProxy" synchronous="true" proxy="true" endpointName="TestPOJOComponentPort" serviceName="TestPOJOComponent" namespace="http://esi.support.mulesoft.com/" wsdlLocation="./TestProxyImpl.wsdl" />
As the NPE is not a friendly error message, we should supply a better error message when the Service cannot be found in the definition. That error message should suggest looking if the namespace parameter is properly configured.
This is done for 2.2.x.
http://fisheye.codehaus.org/changelog/mule/?cs=17736
Improved the error handling when invalid or missing namespace attribute on endpoint. It used to throw a NullPointerException. Now it throws a ComponentNotFoundRuntimeException with more clear error message.
Example of error message:
org.mule.transport.cxf.support.ComponentNotFoundRuntimeException: Component "{{{http://support.cxf.transport.mule.org/}TestPOJOComponent}}" not found while searching in definition. Check if the namespace attribute in your endpoint is missing or has an invalid value. Probable service matches: "[{http://someOtherPackage.support.cxf.transport.mule/}TestPOJOComponent]". All services for the definition: [{http://someOtherPackage.support.cxf.transport.mule/}TestPOJOComponent]