EJBException is nested into RemoteException!!?


EJB programming & troubleshooting: EJBException is nested into RemoteException!!?

  1. EJBException is nested into RemoteException!!? (4 messages)

    Hi everybody,

    We are using weblogic 5.1 SP12.
    Architecture of our application is as follows:
    Jsp -> java bean -> sessionbean -> database.

    In case of any Exception the session bean throws the EJBEception. This EJBException could also be business logic exceptions. This exception is then catched in to java beans, which extract the message from the exception, and sends it to JSP for display.

    This has been working fine for two years until few days back. We recently upgraded the weblogic service pack to sp12 from sp10.

    Now the problem is when session bean throws the EJBException, it comes in a java bean as RemoteException.
    EJBException comes nested into RemoteException. Here our logic of extracting actual messages fails.

    This same code is running perfectly well in another server, physically different machine with same configuration weblogic 5.1 sp12.

    Our method signature in Remote Interface throws RemoteEception and EJBException both.

    Any body has any clue?

  2. I believe that every exception thrown by a remote object should be wrapped inside a RemoteException, huh?
  3. But how we can take out EJBException out of Remote Exception, since it's nested within RemoteException.
  4. Use detail field, nested exception to hold wrapped remote exception e.g.

    catch(RemoteException ejbR) {
     if(ejbR.detail != null) {
  5. Using weblogic 6.1 I throw my own exceptions and catch the same exceptions as I throw. However if I do not declare the exception I am throwing in the Remote interface I believe the EJB spec says it should wrap that exception in a remote exception. I also believe older versions for EJB always wrap exceptions in remote exceptions.