2 Replies Latest reply on Apr 12, 2006 6:13 AM by mhilberink

    EB CMP / Exception intercepted by the container

    vthevenin

      Hello,

      I'm facing a slightly problem with EB (CMP) 2.1, JBoss 4.0.3SP1.

      I've got a SLSB that try to create an EB, but the creation failed due to a constraint violation - this is not the problem.
      The EB create() is done in a try/catch block.

      The problem is that the exception thrown is not caught by the catch() block at all, it seems like the container intercepts the error and redirect it directly to the client.

      I think it is a configuration issue, but I don't know where to search. I looked at standardjboss file to the "interceptor" section, I tried different things but it does not resolve anything.

      If you got any idea, please share ! Thanks in advance.

      Vincent.

        • 1. Re: EB CMP / Exception intercepted by the container
          vthevenin

          May be I should add some details...

          Actually, the error returned is the following:

          2006-03-08 09:44:15,691 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackException in method: public abstract void com.xxx.createXXX(java.lang.String,int,java.lang.String,java.lang.String,java.lang.String,int,java.lang.String,java.lang.String) throws java.lang.Exception,java.rmi.RemoteException, causedBy:

          This error is normal (trying to violate a DB constraint). But instead of having the raised exception being caught by my catch{} code, it is just returned to the client, which caught the exception; a log with the error is also written in jboss.log (the message above).

          To summarize, here is an illustration:

          try
          {
           newEB = ebLocalHome_.create(); // This raise an exception
           ...
          }
          catch (Exception e)
          {
           ... // This block is never reached
          }
          finally
          {
           ... // This block is reached
          }
          

          And the exception is propagated up to the caller, but never caught by any of the catch{} blocks of the call stack...

          Thank you for any help.

          Vincent.

          • 2. Re: EB CMP / Exception intercepted by the container
            mhilberink

            Hey,
            I have the same problem, I cannot catch the exception thrown by a primary key violation.

            Does anybody have a solution?