JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-4920

Proxying POJO with simple frontend without specifying namespace throws NPE

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major 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.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
Edu Pereda added a comment - 28/Jun/10 11:02 AM

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]

Show
Edu Pereda added a comment - 28/Jun/10 11:02 AM 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]
Hide
Permalink
Edu Pereda added a comment - 28/Jun/10 01:34 PM

Integrated to mule-3.x
http://fisheye.codehaus.org/changelog/mule/?cs=17739

Closing the issue.

Show
Edu Pereda added a comment - 28/Jun/10 01:34 PM Integrated to mule-3.x http://fisheye.codehaus.org/changelog/mule/?cs=17739 Closing the issue.

People

  • Assignee:
    Edu Pereda
    Reporter:
    Edu Pereda
Vote (0)
Watch (0)

Dates

  • Created:
    26/Jun/10 08:21 PM
    Updated:
    24/Aug/10 12:19 PM
    Resolved:
    28/Jun/10 01:34 PM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.