Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1805

verbose exception when ejbCreate throws other than CreateException

XMLWordPrintable

      When an EJB in ejbCreate throws an Exception different from CreateException, the stacktrace doesn't get printed in the log because in class org.jboss.ejb.plugins.AbstractInstancePool the exception thrown isn't wrapped in the EJBException (ex == null):

      (line 174)
      // Wrap e in an Exception if needed
      Exception ex = null;
      if( (e instanceof Exception) == false )

      { ex = new UndeclaredThrowableException(e); }

      throw new EJBException("Could not instantiate bean", ex);

      The solution is very simple:

      @@ -176,6 +176,8 @@
      if( (e instanceof Exception) == false )

      { ex = new UndeclaredThrowableException(e); + }

      else

      { + ex = (Exception)e; }

      throw new EJBException("Could not instantiate bean", ex);
      }

            csuconic@redhat.com Clebert Suconic
            icruz_jira Isaac Cruz (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: