• Post Reply Bookmark Topic Watch Topic
  • New Topic

conevert axis Remote exceptions to my runtime exceptions

 
shadowek ss
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I have a ejb session bean which invokes web services and the test client which call the ejb bean (remote):
client--->EJB(remote)--->WebSevices

The EJB bean looks like this:

public class FooEjbBean implements SessionBean {
...
public String someMethod()
{
try {
return webservices.findFoo(String bar);
} catch (RemoteException ex) {
throw new WebServicesException(ex); //***1*** WebServicesException is my runtime exception
}
}
...
}

When in line ***1*** is 'throw new WebServicesException("bleee")' and the web services isn't available (the WS throws the RemoteException and I will catch it like in above code and rethrow my runtime exeception with string argument) the client dispay the following exeception stack(which is OK):
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.ServerException: RuntimeException; nested exception is:
org.my.exeception.WebServicesException:
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
....

but when i change the ***1*** line to 'throw new WebServicesException(ex)'
and the webservices isn't also available (the WS throws the RemoteException and I will catch it like in above code and rethrow my runtime exeception with Throwable object as argument) the client get strange exception stack (diffrent from the former, when I only change the argument to my runtime exception from String to Throwable):

java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.crimson.tree.ElementNode2
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:217)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:53)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
...
What to do with it? Thanks for any help.
 
shadowek ss
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have forgotten... I am using axis 1.1 and jboss 3.2.5
 
shadowek ss
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see there is no axis master there...
I have solved the problem myself. The exception throws by calling the webservice method is AxisFault (which is subclass of RemoteException) and is not serializable. That's all.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!