dcsimg
Building webservices with complex type: java.rmi.ServerException: java.rmi.MarshalException:
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, May 31, 2006 02:34 PM

Recently, I have to build a webservice so that other systems in my company can use my webservice to get customer informaion from our system. I used WSAD 5.1.2 to develop the webservice. I used a session bean to hold the methods that other systems can call. The return type is an object and is shown below(a very simplified version but will have the same error): package ws; public class Complex { private String col1; private String col2; public Complex(){} public String getCol1() { return col1; } public String getCol2() { return col2; } public void setCol1(String string) { col1 = string;    More>>

Recently, I have to build a webservice so that other systems in my company can use my webservice to get customer informaion from our system. I used WSAD 5.1.2 to develop the webservice. I used a session bean to hold the methods that other systems can call. The return type is an object and is shown below(a very simplified version but will have the same error):


package ws;

public class Complex {

private String col1;

private String col2;

public Complex(){}

public String getCol1() {

return col1;

}

public String getCol2() {

return col2;

}

public void setCol1(String string) {

col1 = string;

}

public void setCol2(String string) {

col2 = string;

}

}


There is no error when you compile it (generate deployment and RMIC code; and deploy it as web service). However, when I ran it on the Websphere V5.1 test environment and used the test client to test it. I encountered errors as shown below:


[5/31/06 14:58:07:937 EDT] 11a3749b WebServicesSe E com.ibm.ws.webservices.engine.transport.http.WebServicesServlet WSWS3227E: Error: Exception:
[5/31/06 14:58:07:967 EDT] 11a3749b WebServicesSe E com.ibm.ws.webservices.engine.transport.http.WebServicesServlet TRAS0014I: The following exception was logged WebServicesFault
faultCode: Server.generalException
faultString: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.MarshalException: Exception occurred in server thread; nested exception is:
java.io.NotSerializableException
faultActor: null
faultDetail:

java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.MarshalException: Exception occurred in server thread; nested exception is:
java.io.NotSerializableException
at com.ibm.ws.webservices.engine.WebServicesFault.makeFault(WebServicesFault.java:150)
at com.ibm.ws.webservices.engine.providers.java.JavaProvider.invoke(JavaProvider.java:294)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:212)
at com.ibm.ws.webservices.engine.handlers.WrappedHandler.invoke(WrappedHandler.java:61)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:212)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:212)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:255)
at com.ibm.ws.webservices.engine.transport.http.WebServicesServlet.doPost(WebServicesServlet.java:850)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at com.ibm.ws.webservices.engine.transport.http.WebServicesServletBase.service(WebServicesServletBase.java:341)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.MarshalException: Exception occurred in server thread; nested exception is:
java.io.NotSerializableException
at com.ibm.CORBA.iiop.UtilDelegateImpl.wrapException(UtilDelegateImpl.java:690)
at javax.rmi.CORBA.Util.wrapException(Util.java:295)
at ws._Testws_Stub.getResult(_Testws_Stub.java:260)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.ws.webservices.engine.providers.java.RPCProvider.invokeMethod(RPCProvider.java:404)
at com.ibm.ws.webservices.engine.providers.java.RPCProvider.processRequestResponse(RPCProvider.java:296)
at com.ibm.ws.webservices.engine.providers.java.RPCProvider.processMessage(RPCProvider.java:262)
at com.ibm.ws.webservices.engine.providers.java.JavaProvider.invoke(JavaProvider.java:289)
... 29 more
Caused by: java.rmi.MarshalException: Exception occurred in server thread; nested exception is:
java.io.NotSerializableException
at com.ibm.rmi.util.ProxyUtil.copyObject(ProxyUtil.java:470)
at com.ibm.CORBA.iiop.UtilDelegateImpl.copyObject(UtilDelegateImpl.java:789)
at javax.rmi.CORBA.Util.copyObject(Util.java:332)
at ws._Testws_Stub.getResult(_Testws_Stub.java:257)
... 37 more
Caused by: java.io.NotSerializableException
... 41 more
.
WebServicesFault
faultCode: Server.generalException
faultString: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.MarshalException: Exception occurred in server thread; nested exception is:
java.io.NotSerializableException
faultActor: null
faultDetail:

java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.MarshalException: Exception occurred in server thread; nested exception is:
java.io.NotSerializableException
at com.ibm.ws.webservices.engine.WebServicesFault.makeFault(WebServicesFault.java:150)
at com.ibm.ws.webservices.engine.providers.java.JavaProvider.invoke(JavaProvider.java:294)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:212)
at com.ibm.ws.webservices.engine.handlers.WrappedHandler.invoke(WrappedHandler.java:61)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:212)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:212)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:255)
at com.ibm.ws.webservices.engine.transport.http.WebServicesServlet.doPost(WebServicesServlet.java:850)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at com.ibm.ws.webservices.engine.transport.http.WebServicesServletBase.service(WebServicesServletBase.java:341)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.MarshalException: Exception occurred in server thread; nested exception is:
java.io.NotSerializableException
at com.ibm.CORBA.iiop.UtilDelegateImpl.wrapException(UtilDelegateImpl.java:690)
at javax.rmi.CORBA.Util.wrapException(Util.java:295)
at ws._Testws_Stub.getResult(_Testws_Stub.java:260)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.ws.webservices.engine.providers.java.RPCProvider.invokeMethod(RPCProvider.java:404)
at com.ibm.ws.webservices.engine.providers.java.RPCProvider.processRequestResponse(RPCProvider.java:296)
at com.ibm.ws.webservices.engine.providers.java.RPCProvider.processMessage(RPCProvider.java:262)
at com.ibm.ws.webservices.engine.providers.java.JavaProvider.invoke(JavaProvider.java:289)
... 29 more
Caused by: java.rmi.MarshalException: Exception occurred in server thread; nested exception is:
java.io.NotSerializableException
at com.ibm.rmi.util.ProxyUtil.copyObject(ProxyUtil.java:470)
at com.ibm.CORBA.iiop.UtilDelegateImpl.copyObject(UtilDelegateImpl.java:789)
at javax.rmi.CORBA.Util.copyObject(Util.java:332)
at ws._Testws_Stub.getResult(_Testws_Stub.java:257)
... 37 more
Caused by: java.io.NotSerializableException
... 41 more


The strange thing is when I exported the web service as a ear file and deployed it on Websphere application server 6.0. There is no error at all.


It is very inconvenient to do the testing as every time you have to export it and deploy it then you test it.


So, does anyone has any ideas what go wrong?


Thanks for reading this long message!


John

   <<Less
About | Sitemap | Contact