Joseph Kampf created CAMEL-9421:
-----------------------------------

             Summary: CxfEndpoint Not using proper Service Factory when 
javax.jws.WebService is proxied
                 Key: CAMEL-9421
                 URL: https://issues.apache.org/jira/browse/CAMEL-9421
             Project: Camel
          Issue Type: Bug
          Components: camel-cxf
    Affects Versions: 2.13.3
         Environment: karaf 3.0.2
            Reporter: Joseph Kampf


Clearing out the karaf/data/cache directory and then doing a fresh deploy of 
the Bundle works fine.  

However after restarting Karaf the org.apache.cxf.jaxws.JaxWsServerFactoryBean 
is not used by the CxfEndpoint.  Instead the 
org.apache.cxf.frontend.ServerFactoryBean is used.  This causes the mapping of 
WSDL Operations to SEI methods to not work.  

This results in error messages:
2015-12-15 09:51:18,729 | WARN  | xtenderThread-42 | 
ReflectionServiceFactoryBean     | 194 - org.apache.cxf.cxf-rt-core - 2.7.11 | 
No method was found for the WSDL operation <%WSDL Operation%>

It also causes the CXF page to not list the WSDL Operations under the SOAP Port.

The reason this is happening is because the Annotations that are on the SEI 
class are proxied.  This causes the Annotation check in 
org.apache.camel.component.cxf.CxfSpringEndpoint.createServerFactoryBean() to 
seem as if the SEI does not have the javax.jws.WebService Annotation.

The Annotation is on the list of Annotations for the SEI, but they are proxied 
by sun.reflect.annotation.AnnotationInvocationHandler.

One solution I see would be to change the implementation of 
org.apache.camel.component.cxf.CxfEndpointUtils.hasAnnotation() method.  
Instead of relying on Class.getAnnoation(), instead loop through the 
Annotations on the class and not only check the Annotation class directly, but 
also try to reach into the Annotation to determine if it is a proxy of the 
Annotation in question.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to