This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Services and the fly likes Reflection Problem in SOAP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Reflection Problem in SOAP" Watch "Reflection Problem in SOAP" New topic
Author

Reflection Problem in SOAP

stephenm
Greenhorn

Joined: Apr 16, 2002
Posts: 1
I'm new to SOAP and currently running Apache SOAP on Tomcat with JBoss. I've created a simple SOAP service with a stateless session bean using the StatelessEJBProvider. The session bean returns an instance of my test class: Junk. "Junk", itself is just a simple class that holds two strings.

Everything appears to be deployed successfully, but I'm finding an infuriating reflection exception when I attempt to invoke the service from my client.

I get the following exception:

[Default] In TemplateProvider.invoke()
[Default] Exception Caught upon method invocation attempt: null
[Default] java.lang.reflect.InvocationTargetException:
[Default] java.lang.ClassCastException: mytestclasses.Junk
[Default] at $Proxy16.getJunk(Unknown Source)
[Default] at java.lang.reflect.Method.invoke(Native Method)
[Default] at org.apache.soap.providers.StatelessEJBProvider.invoke(Unknown Source)
[Default] at org.apache.soap.server.http.RPCRouterServlet.doPost(Unknown Source)
[Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
[Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[Default] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
[Default] at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
[Default] at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
[Default] at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
[Default] at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
[Default] at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
[Default] at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
[Default] at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
[Default] at org.apache.catalina.valves.CertificatesValve.invoke(Unknown Source)
[Default] at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
[Default] at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
[Default] at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
[Default] at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
[Default] at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
[Default] at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
[Default] at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
[Default] at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
[Default] at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
[Default] at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
[Default] at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
[Default] at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
[Default] at org.apache.catalina.connector.http.HttpProcessor.process(Unknown Source)
[Default] at org.apache.catalina.connector.http.HttpProcessor.run(Unknown Source)
[Default] at java.lang.Thread.run(Unknown Source)

After delving into the SOAP source code, I've isolated my problem to a single line of code.

Bean result = new Bean (m.getReturnType (), m.invoke (remoteObjRef, args));

Specifically, the issue seems to revolve around m.invoke (remoteObjRef, args). I've verified that the remoteObjRef is not a null value and I've also verified that every line of code in the session bean executes without error right up to the return of the Junk object.

Any help or direction is appreciated.

Thanks in advance,

Stephen
sanjiv agrawal
Greenhorn

Joined: Feb 03, 2003
Posts: 1
if you have found the solution to this problem please let me know
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reflection Problem in SOAP