[ 
https://issues.apache.org/jira/browse/CXF-3492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13029569#comment-13029569
 ] 

Edward Ost commented on CXF-3492:
---------------------------------

Sorry to be going on a goose chase here, but I wasn't able to reproduce that 
successful test  (I'm pretty certain it was actually running a previous build). 

I've set up and attached a fresh project to demonstrate the issue in isolation 
(and run against a clean TESB4 container and MVN repository).  This was tested 
on talend-esb-4.0-prerelease-kit-2 against the CXF bundle 2.4.0-SNAPSHOT 
(included) and also against an upgraded CXF 2.4.0 bundle.

I couldn't find a Maven source dependencies for 2.4.0-SNAPSHOT to debug 
against, so I've used 2.4.0 to determine the following:

When using a spring OSGI reference as the JAXWS implementor, e.g.

<osgi:reference 
id="TestService" 
interface="au.edu.mq.dataswitch.poc.TestService">
</osgi:reference>
<jaxws:endpoint id="testEndpoint"
implementor="#TestService"
implementorClass="au.edu.mq.dataswitch.poc.TestService"
address="/TestServiceProvider">
</jaxws:endpoint>

It's dying in 
JaxWsServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean).create() 
line: 180:

            if (serviceBean != null) {
                initializeAnnotationInterceptors(server.getEndpoint(),
                                                 
ClassHelper.getRealClass(getServiceBean()));
            } else if (getServiceClass() != null) {
                initializeAnnotationInterceptors(server.getEndpoint(), 
getServiceClass());
            }

The code here ignores the "implementorClass" on the JAXWS tag (which populates 
ServerFactoryBean.getServiceClass()) and tries to determine the underlying 
class via "ClassHelper.getRealClass".  (which fails because ClassHelper throws 
a ClassCastException internally because it tries to cast an opaque proxy 
(spring OSGI proxy) to org.springframework.aop.framework.Advised).

I'm guessing the above if/else block may be incorrect, and possibly should be:

            if (getServiceClass() != null) {
                initializeAnnotationInterceptors(server.getEndpoint(), 
getServiceClass());
            } else if (serviceBean != null) {
                initializeAnnotationInterceptors(server.getEndpoint(),
                                                 
ClassHelper.getRealClass(getServiceBean()));
            }


Would you mind passing this on for investigation?

The attached tar ball should just build with "mvn install", then "install 
mvn:au.edu.mq.dataswitch.poc/jaxws-osgi-test/1.0-SNAPSHOT", except that it's 
built against CXF 2.4.0.

If running against talend-esb-4.0-prerelease-kit-2.tar.gz, can either
(a) change in pom.xml to <cxf.version>2.4.0-SNAPSHOT</cxf.version> , or 
(b) uninstall default CXF bundle and use "features:addurl 
mvn:org.apache.cxf.karaf/apache-cxf/2.4.0/xml/features", "features:install 
cxf-bundle/2.4.0"


> Spring OSGI Service Reference as JAXWS:endpoint implementor
> -----------------------------------------------------------
>
>                 Key: CXF-3492
>                 URL: https://issues.apache.org/jira/browse/CXF-3492
>             Project: CXF
>          Issue Type: Bug
>          Components: OSGi
>    Affects Versions: 2.4
>            Reporter: Edward Ost
>
> Problem pointing <jaxws:endpoint> to an implementor that's provided by 
> <osgi:reference>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to