I have a client which is trying to retrieve a service object using the
JaxWsProxyFactoryBean. I encounter the following error:
Exception in thread "main" java.lang.ClassCastException: $Proxy54 cannot be
cast to com.company.service.web.ProvisioningService
at com.company.service.web.client.Client.main(Client.java:42)
Here is my service setup:
<jaxws:endpoint id="prov"
implementor="com.company.service.web.ProvisioningService"
address="/provisioning">
<jaxws:inInterceptors>
<ref bean="wssInInterceptor"/>
<ref bean="springInInterceptor"/>
</jaxws:inInterceptors>
</jaxws:endpoint>
And relevant code from my client class:
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
// ...
factory.getInInterceptors().add( new LoggingInInterceptor() );
factory.getOutInterceptors().add( new LoggingOutInterceptor() );
factory.getOutInterceptors().add( wssOut );
factory.setServiceClass( AuthService.class );
factory.setAddress(
"http://localhost:8081/web-services/services/provisioning" );
ProvisioningService client = (ProvisioningService) factory.create();
String something = client.saySomething();
System.out.println( something );
Do I need to set <aop:scoped-proxy/> on my endpoint somewhere/somehow? How
can I access the service object since I'm apparently retrieving a proxy
instead of the actual object?
I've tried turning the <aop:aspectj-autoproxy> proxy-target-class attribute
to false and true, as well as removing the tag altogether. I really just
don't understand how this is supposed to work. Any thoughts?
Thank you!
- Dave
--
View this message in context:
http://www.nabble.com/ClassCastException-with-JAX-WS-proxies--tp20903183p20903183.html
Sent from the cxf-user mailing list archive at Nabble.com.