cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward Ost (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-3492) Spring OSGI Service Reference as JAXWS:endpoint implementor
Date Thu, 05 May 2011 21:03:03 GMT

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

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

I've hit a problem pointing <jaxws:endpoint> to an implementor that's provided by <osgi:reference>.

e.g. 
<jaxws:endpoint id="morticeAdapterEndpoint"
implementor="#MorticeCourseUnitService"
address="/MorticeAdapterServiceProvider">
</jaxws:endpoint>

<osgi:reference 
id="MorticeCourseUnitService" 
interface="au.edu.mq.informatics.dataswitch.poc.mortice.common.MorticeCourseUnitService">
</osgi:reference>


Here's the exception:

karaf@tesb> Exception in thread "SpringOsgiExtenderThread-16" org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'morticeAdapterEndpoint': Invocation of init method failed;
nested exception is javax.xml.ws.WebServiceException: java.lang.ClassCastException: $Proxy76
cannot be cast to org.springframework.aop.framework.Advised
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.xml.ws.WebServiceException: java.lang.ClassCastException: $Proxy76 cannot
be cast to org.springframework.aop.framework.Advised
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:350)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:239)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:509)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1544)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 14 more
Caused by: java.lang.ClassCastException: $Proxy76 cannot be cast to org.springframework.aop.framework.Advised
at org.apache.cxf.common.util.SpringAopClassHelper.getRealClassInternal(SpringAopClassHelper.java:59)
at org.apache.cxf.common.util.ClassHelper.getRealClass(ClassHelper.java:55)
at org.apache.cxf.jaxws.EndpointImpl.getImplementorClass(EndpointImpl.java:203)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:376)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:322)
... 23 more


Here's how I declare the service  (in another bundle, checked with "osgi:ls"):

<osgi:service 
ref="MorticeCourseUnitServiceImpl" 
interface="au.edu.mq.informatics.dataswitch.poc.mortice.common.MorticeCourseUnitService"/>

<bean id="MorticeCourseUnitServiceImpl" 
class="au.edu.mq.informatics.dataswitch.poc.mortice.adapter.MorticeCourseUnitServiceImpl"/>



If I point jaxws directly at the bean it works.

<jaxws:endpoint id="morticeAdapterEndpoint"
implementor="#MorticeCourseUnitService"
address="/MorticeAdapterServiceProvider">
</jaxws:endpoint>

<bean id="MorticeCourseUnitService" 
class="au.edu.mq.informatics.dataswitch.poc.mortice.adapter.MorticeCourseUnitServiceImpl"/>



If I point a bean directly at the osgi reference it works   (tested by invoking a service
method inside setMorticeCourseUnitService).
<bean class="soaphttp.MorticeCourseUnitServiceTestBean"> 
   <property name="morticeCourseUnitService" ref="MorticeCourseUnitService"></property>
</bean> 

<osgi:reference id="MorticeCourseUnitService" interface="au.edu.mq.informatics.dataswitch.poc.mortice.common.MorticeCourseUnitService">
</osgi:reference>  




> 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

Mime
View raw message