Confusing IllegalArgumentException when address attribute isn't specified on 
CXF endpoint.
------------------------------------------------------------------------------------------

                 Key: CAMEL-3181
                 URL: https://issues.apache.org/activemq/browse/CAMEL-3181
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-cxf
    Affects Versions: 2.4.0
         Environment: all
            Reporter: Adrian Trenaman


If you create CXF endpoint, like this, without the address attribute, 

{code:xml}
        <cxf:cxfEndpoint 
                id="greeting" 
                wsdlURL="greeting.wsdl"
                serviceClass="tutorial.hanbo.webservice.Greeting"
                >
        </cxf:cxfEndpoint>
{code} 

... then you get a really confusing error when you deploy the endpoint in 
ServiceMix: the error is 

{code}
Caused by: java.lang.IllegalArgumentException: endpointUri is not specified and 
org.apache.camel.component.cxf.CxfSpringEndpoint 
does not implement createEndpointUri() to create a default value
        at 
org.apache.camel.impl.DefaultEndpoint.getEndpointUri(DefaultEndpoint.java:83)
        at 
org.apache.camel.management.DefaultManagementLifecycleStrategy.onEndpointAdd(DefaultManagementLifecycleStrategy.java:205)
        at 
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:386)
{code} 

We find that if you explicitly set the address then the problem goes away (see 
below)

{code:xml} 
        <cxf:cxfEndpoint 
                id="greeting" 
                wsdlURL="greeting.wsdl"
                
address="http://localhost:9000/GreeterContext/SOAPMessageService";
                serviceClass="tutorial.hanbo.webservice.Greeting"
                >
        </cxf:cxfEndpoint>
{code} 

On camel-cxf web page, the 'address' attribute is not mentioned anywhere in the 
table of URI properties, so you might be lead to believe that it's not 
necessary. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to