You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by thanmalv <th...@yahoo.com> on 2011/03/23 16:37:23 UTC
CXF client and WAS 7 issue classcast exception
Hi,
I am trying to run a CXF client in WAS 7. The client runs fine but I start
getting classcast excetion as soon as I try to use the
ClientProxy.getClient(mycxfclient) so that I can apply some policies in
regard to setting the connection and recieve timeout or setting the
authentication data etc.
below is the sample code:
Client cl = ClientProxy.getClient(rs);
HTTPConduit http = (HTTPConduit) cl.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(120000);
httpClientPolicy.setReceiveTimeout(120000);
httpClientPolicy.setAllowChunking(false);
http.setClient(httpClientPolicy);
Here is the partial excetion trace:
Exception data: java.lang.ClassCastException:
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler incompatible with
org.apache.cxf.frontend.ClientProxy
at org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:93)
I have deployed successfully couple of CXF services on WAS 7. This is my
first instance trying to consume the CXF CLIENT which is trying to hit
another web service deployed somewhere else. As I mentioned even that works
fine as long as I don't try to use the ClinetProxy. In the code above my
Client cl is actually org.apache.cxf.frontend.Client and ClientProxy is
org.apache.cxf.frontend.ClientProxy.
I am gettig stuck on this one and will really appreciate if someoen can
share some insight. As I indicated I have deployed some CXF servives
successfully on WAS 7 after using the DisableIBMJAXWSEngine: true technique.
But this problem is happening when I trying to run a CXF client in my code
and when I try to get the Client thry ClientProxy.getClient call.
--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-client-and-WAS-7-issue-classcast-exception-tp4258948p4258948.html
Sent from the cxf-issues mailing list archive at Nabble.com.
Re: CXF client and WAS 7 issue classcast exception
Posted by thanmalv <th...@yahoo.com>.
I also want to highlight the fact that same code runs fine under jUNIT test
running in my RAD. I only see this issue when I am trying to run the
application on WAS server itself.
--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-client-and-WAS-7-issue-classcast-exception-tp4258948p4258957.html
Sent from the cxf-issues mailing list archive at Nabble.com.
AW: CXF client and WAS 7 issue classcast exception
Posted by Oliver Wulff <ow...@talend.com>.
Do you use fix pack 7 of websphere 7?
It's important to have child first configured and to disable the ibm jaxws engine.
http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/twbs_thirdparty.html
Oliver
________________________________________
Von: Daniel Kulp [dkulp@apache.org]
Gesendet: Freitag, 15. April 2011 19:00
An: issues@cxf.apache.org; dev@cxf.apache.org
Betreff: Re: CXF client and WAS 7 issue classcast exception
My suggestion when using CXF in J2EE app servers would be to NOT use the
generated Service class to create the proxy and instead use the
JaxWsProxyFactoryBean. It's really not hard to use and would pretty much
make sure that CXF is completely picked up instead of whatever the App server
decides you should use.
Dan
On Thursday 14 April 2011 11:50:19 PM nick wrote:
> My code and exception is almost identical as yours.
> I am trying to create client using CXF(2.2.10) client front end in WAS 7.0.
> The code works just fine in WAS 6.1.
>
> Client client = ClientProxy.getClient(soapPort)
> HTTPConduit http = (HTTPConduit) client.getConduit();
>
> I have same exception as yours
> java.lang.ClassCastException:
> org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler incompatible with
> org.apache.cxf.frontend.ClientProxy
> org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:93)
>
> We know the WAS7.0 restricts the usage of application modules that use
> both IBM's JAX-WS and external JAX-WS (CXF in this case). So we know it's
> class loading module.
> I've tried using 'DisableIBMJAXWSEngine' properties and
> 'Ignore-Scanning-Archieves' (so the server not to scan
> org.apache.axis2.jar from the WAS 7.0 plugins).
> I've also tried to change class loader order to 'parent last' on server
> lever and web module (.war).
>
> I still get same exception. Really appreciate your help.
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/CXF-client-and-WAS-7-issue-classcast-excep
> tion-tp4258948p4304711.html Sent from the cxf-issues mailing list archive
> at Nabble.com.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com
AW: CXF client and WAS 7 issue classcast exception
Posted by Oliver Wulff <ow...@talend.com>.
Do you use fix pack 7 of websphere 7?
It's important to have child first configured and to disable the ibm jaxws engine.
http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/twbs_thirdparty.html
Oliver
________________________________________
Von: Daniel Kulp [dkulp@apache.org]
Gesendet: Freitag, 15. April 2011 19:00
An: issues@cxf.apache.org; dev@cxf.apache.org
Betreff: Re: CXF client and WAS 7 issue classcast exception
My suggestion when using CXF in J2EE app servers would be to NOT use the
generated Service class to create the proxy and instead use the
JaxWsProxyFactoryBean. It's really not hard to use and would pretty much
make sure that CXF is completely picked up instead of whatever the App server
decides you should use.
Dan
On Thursday 14 April 2011 11:50:19 PM nick wrote:
> My code and exception is almost identical as yours.
> I am trying to create client using CXF(2.2.10) client front end in WAS 7.0.
> The code works just fine in WAS 6.1.
>
> Client client = ClientProxy.getClient(soapPort)
> HTTPConduit http = (HTTPConduit) client.getConduit();
>
> I have same exception as yours
> java.lang.ClassCastException:
> org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler incompatible with
> org.apache.cxf.frontend.ClientProxy
> org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:93)
>
> We know the WAS7.0 restricts the usage of application modules that use
> both IBM's JAX-WS and external JAX-WS (CXF in this case). So we know it's
> class loading module.
> I've tried using 'DisableIBMJAXWSEngine' properties and
> 'Ignore-Scanning-Archieves' (so the server not to scan
> org.apache.axis2.jar from the WAS 7.0 plugins).
> I've also tried to change class loader order to 'parent last' on server
> lever and web module (.war).
>
> I still get same exception. Really appreciate your help.
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/CXF-client-and-WAS-7-issue-classcast-excep
> tion-tp4258948p4304711.html Sent from the cxf-issues mailing list archive
> at Nabble.com.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com
Re: CXF client and WAS 7 issue classcast exception
Posted by Daniel Kulp <dk...@apache.org>.
My suggestion when using CXF in J2EE app servers would be to NOT use the
generated Service class to create the proxy and instead use the
JaxWsProxyFactoryBean. It's really not hard to use and would pretty much
make sure that CXF is completely picked up instead of whatever the App server
decides you should use.
Dan
On Thursday 14 April 2011 11:50:19 PM nick wrote:
> My code and exception is almost identical as yours.
> I am trying to create client using CXF(2.2.10) client front end in WAS 7.0.
> The code works just fine in WAS 6.1.
>
> Client client = ClientProxy.getClient(soapPort)
> HTTPConduit http = (HTTPConduit) client.getConduit();
>
> I have same exception as yours
> java.lang.ClassCastException:
> org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler incompatible with
> org.apache.cxf.frontend.ClientProxy
> org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:93)
>
> We know the WAS7.0 restricts the usage of application modules that use
> both IBM's JAX-WS and external JAX-WS (CXF in this case). So we know it's
> class loading module.
> I've tried using 'DisableIBMJAXWSEngine' properties and
> 'Ignore-Scanning-Archieves' (so the server not to scan
> org.apache.axis2.jar from the WAS 7.0 plugins).
> I've also tried to change class loader order to 'parent last' on server
> lever and web module (.war).
>
> I still get same exception. Really appreciate your help.
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/CXF-client-and-WAS-7-issue-classcast-excep
> tion-tp4258948p4304711.html Sent from the cxf-issues mailing list archive
> at Nabble.com.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com
Re: CXF client and WAS 7 issue classcast exception
Posted by Daniel Kulp <dk...@apache.org>.
My suggestion when using CXF in J2EE app servers would be to NOT use the
generated Service class to create the proxy and instead use the
JaxWsProxyFactoryBean. It's really not hard to use and would pretty much
make sure that CXF is completely picked up instead of whatever the App server
decides you should use.
Dan
On Thursday 14 April 2011 11:50:19 PM nick wrote:
> My code and exception is almost identical as yours.
> I am trying to create client using CXF(2.2.10) client front end in WAS 7.0.
> The code works just fine in WAS 6.1.
>
> Client client = ClientProxy.getClient(soapPort)
> HTTPConduit http = (HTTPConduit) client.getConduit();
>
> I have same exception as yours
> java.lang.ClassCastException:
> org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler incompatible with
> org.apache.cxf.frontend.ClientProxy
> org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:93)
>
> We know the WAS7.0 restricts the usage of application modules that use
> both IBM's JAX-WS and external JAX-WS (CXF in this case). So we know it's
> class loading module.
> I've tried using 'DisableIBMJAXWSEngine' properties and
> 'Ignore-Scanning-Archieves' (so the server not to scan
> org.apache.axis2.jar from the WAS 7.0 plugins).
> I've also tried to change class loader order to 'parent last' on server
> lever and web module (.war).
>
> I still get same exception. Really appreciate your help.
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/CXF-client-and-WAS-7-issue-classcast-excep
> tion-tp4258948p4304711.html Sent from the cxf-issues mailing list archive
> at Nabble.com.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com
Re: CXF client and WAS 7 issue classcast exception
Posted by nick <da...@yahoo.com>.
My code and exception is almost identical as yours.
I am trying to create client using CXF(2.2.10) client front end in WAS 7.0.
The code works just fine in WAS 6.1.
Client client = ClientProxy.getClient(soapPort)
HTTPConduit http = (HTTPConduit) client.getConduit();
I have same exception as yours
java.lang.ClassCastException:
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler incompatible with
org.apache.cxf.frontend.ClientProxy
org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:93)
We know the WAS7.0 restricts the usage of application modules that use
both IBM's JAX-WS and external JAX-WS (CXF in this case). So we know it's
class loading module.
I've tried using 'DisableIBMJAXWSEngine' properties and
'Ignore-Scanning-Archieves' (so the server not to scan org.apache.axis2.jar
from the WAS 7.0 plugins).
I've also tried to change class loader order to 'parent last' on server
lever and web module (.war).
I still get same exception. Really appreciate your help.
--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-client-and-WAS-7-issue-classcast-exception-tp4258948p4304711.html
Sent from the cxf-issues mailing list archive at Nabble.com.
Re: CXF client and WAS 7 issue classcast exception
Posted by nick <da...@yahoo.com>.
Hi thanmalv,
I run into exactly same problem as you have and know it's class loader
problem. I've tried to set class loader order 'parent last' but not help.
Can you help telling what you did?
Thanks a lot.
Nick.
--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-client-and-WAS-7-issue-classcast-exception-tp4258948p4303906.html
Sent from the cxf-issues mailing list archive at Nabble.com.
Re: CXF client and WAS 7 issue classcast exception
Posted by thanmalv <th...@yahoo.com>.
This issue is resolved. It was related to class loading. Once I resolved that
it worked.
--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-client-and-WAS-7-issue-classcast-exception-tp4258948p4262746.html
Sent from the cxf-issues mailing list archive at Nabble.com.