Uploaded image for project: 'Mule'
  1. Mule
  2. MULE-4920

Proxying POJO with simple frontend without specifying namespace throws NPE

    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:

      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.

        Attachments

          Activity

            People

            • Assignee:
              epere4 Edu Pereda
              Reporter:
              epere4 Edu Pereda
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Aug/10