5 Replies Latest reply on Aug 18, 2005 1:25 PM by aguizar

    How to handle Exception using ExceptionHandler?

    ashwin_4421

      Hi ,
      I have the following requirement:
      1.An actionHandler will throw an SblException
      2.After the exception is created, a mail has to be sent to an user using another ActionHandler.

      My process defintion contains:




      <exception-handler exception-class='com.sample.action.SblException>

      </exception-handler>



      SblAction can throw an SblException and then the MailerAction should send out an email-notification.

      But the control never seems to rreach the MailerAction class.
      Ami i missing something?
      Thanks
      Ashwin

        • 1. Re: How to handle Exception using ExceptionHandler?
          ashwin_4421

          I also encouter the following error:
          19:39:41,677 INFO [STDOUT] Caused by: java.lang.RuntimeException: class not found 'com.sample.action.SblException'
          19:39:41,677 INFO [STDOUT] at org.jbpm.instantiation.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:18)
          19:39:41,677 INFO [STDOUT] at org.jbpm.graph.def.ExceptionHandler.matches(ExceptionHandler.java:23)
          19:39:41,677 INFO [STDOUT] at org.jbpm.graph.def.GraphElement.findExceptionHandler(GraphElement.java:311)
          19:39:41,677 INFO [STDOUT] at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:276)
          19:39:41,677 INFO [STDOUT] ... 44 more
          19:39:41,677 INFO [STDOUT] Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: com.sample.action.SblException
          19:39:41,677 INFO [STDOUT] at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:198)
          19:39:41,677 INFO [STDOUT] at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:464)
          19:39:41,677 INFO [STDOUT] at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:374)
          19:39:41,677 INFO [STDOUT] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
          19:39:41,677 INFO [STDOUT] at org.jbpm.instantiation.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:16)

          • 2. Re: How to handle Exception using ExceptionHandler?
            ashwin_4421

            My Process Defintion contains:



            <exception-handler exception-class="com.sample.action.SblException">

            </exception-handler>

            • 3. Re: How to handle Exception using ExceptionHandler?
              ashwin_4421

              The complete defintion is not getting pasted. so here i go again



              <exception-handler exception-class="com.sample.action.SblException">


              </exception-handler>

              • 4. Re: How to handle Exception using ExceptionHandler?
                ashwin_4421

                The inner contents is not getting pasted:
                I'll paste it part by part


                • 5. Re: How to handle Exception using ExceptionHandler?
                  aguizar

                  The ExceptionHandler class does not use the process class loader when it loads the exception-class to verify it is assignable from the thrown exception. As a workaround, try placing the exception class in the classpath and remove it from the process archive.

                  Could you open a Jira issue? http://jira.jboss.org/jira/browse/JBPM