ClassCastException: java.lang.String
maed Sep 1, 2009 3:19 PMHey all!
Since this is my first post in a forum like this (never had a problem where Google hadn't the answer right away), forgive me if I forget anything... or violate any rules. But to come to the point, my problem is the following:
I currently try to integrate JBossESB into an already existing webapplication (or is it vice versa... doesn't matter). The specs are:
* JBoss AS 4.2.3
* JBossWS 3.0.4
* JDK 5 (with update 20 I think)
* SEAM 2.1.2
* Hibernate 3
* and: JBossESB 4.6
Since I wanted to expose something as a webservice I redesigned the already existing usermanagement (login, add users, and what so ever) and used the "webservice_wsadressing" as a guide for how to configure the JBossESB part. Everything was fine, whereby I mean the testing of the webservice with SoapUI (directly and indirecly over the ESB) and even a standalone test I wrote was successful, but then I started the webapp and tried to login with a user and along came this pretty Exception:
02:33:01,437 ERROR [LoginBean] javax.xml.ws.WebServiceException: java.io.IOException: Could not transmit message javax.xml.ws.WebServiceException: java.io.IOException: Could not transmit message at org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:404) at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:314) at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:172) at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:152) at $Proxy311.login(Unknown Source) at at.fhj.itm.usermanagement.ws.UserManagementFacadeWS.login(UserManagementFacadeWS.java:63) at at.fhj.itm.usermanagement.LoginBean.login(LoginBean.java:120) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [PUT LOTS OF SEAM AND EJB3 INTERCEPTOR STUFF HERE... AND SOME HTTP APACHE HTTP THINGIES] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) at java.lang.Thread.run(Thread.java:595) Caused by: java.io.IOException: Could not transmit message at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:255) at org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:73) at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:339) at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302) ... 118 more Caused by: java.lang.ClassCastException: java.lang.String at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:233) ... 121 more
Which led me to search the web and some .pdfs for answers and solutions, but til now I haven't found one, which does the trick of vaporizing this bastardous Exception... apologies. I also looked into the source code of the JBossWS (I had to update from 3.0.3 to 3.0.4 to find the exact location (which is line: 242):
package org.jboss.ws.core.client; //... import org.jboss.remoting.Client; //... public class HTTPRemotingConnection { //... public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException { //... MessageAbstraction resMessage = null; if (oneway == true) { client.invokeOneway(reqMessage, metadata, false); } else { //Here comes the cast of death, line 242: resMessage = (MessageAbstraction)client.invoke(reqMessage, metadata); } //... } }
So I guess it is some Classpath issue with jboss-remoting... but till now I haven't found out what could possibly interfere. I would appreciate it if anyone could help me out here. I provide more information on demand.
So long!
MaEd
Before I forget:
When I use the "normal" wdsl link (http://localhost:8080/servicepath/Endpoint?wdsl --> location=http://localhost:8080/servicepath/Endpoint) the webservice works even with the webapp!
But the "esb" link (http://localhost:8080/contract.jsp?serviceCat=cat&serviceName=name&protocol=http --> location=http://localhost:8765) results in the Exception mentioned above.