I am having big problems in fetching exception details开发者_JAVA技巧 from Remote EJBs...
I have a pipeline pattern implemented with Remote EJBs, where one EJB calls other EJBs to do certain tasks. What I can't figure out is how to get more meaningful exceptions when some problem occures.
Here is an example of a "very useful" output I typically get from the EJB container (Glassfish):
2010-11-18 12:22:36,974 DEBUG [CustomerDetectionFilter.java:48 [eef819a4debb613d0670dab35c39] - Checking customer details ...
2010-11-18 12:22:37,026 ERROR [ServiceCore.java:104] [eef819a4debb613d0670dab35c39] - nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: null; nested exception is:
javax.transaction.TransactionRolledbackException: CORBA TRANSACTION_ROLLEDBACK 9998 Maybe; nested exception is:
org.omg.CORBA.TRANSACTION_ROLLEDBACK: vmcid: 0x2000 minor code: 1806 completed: Maybe
javax.ejb.EJBException: nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: null; nested exception is:
javax.transaction.TransactionRolledbackException: CORBA TRANSACTION_ROLLEDBACK 9998 Maybe; nested exception is:
org.omg.CORBA.TRANSACTION_ROLLEDBACK: vmcid: 0x2000 minor code: 1806 completed: Maybe
at com.my.remote._CustomerDetectionFilterRemote_Wrapper.execute(com/my/remote/_CustomerDetectionFilterRemote_Wrapper.java) ~[project-common.jar:na]
So in this case I would know that this is the cause: java.rmi.RemoteException: null
... but I have no way of getting more useful information for debugging.
Can you recommend a way of excepting handling where the caller of remote EJB needs to get more details about the problem that occured? AppServer is Glassfish 2.1.
Thank you,
Bozo
There are various ways for handling exceptions. We can configure them to get most information about root cause from it.
Below link might provide useful information & topic is discussed briefly.
Best practices in EJB exception handling - http://www.ibm.com/developerworks/java/library/j-ejbexcept.html
精彩评论