1 Reply Latest reply on Apr 9, 2010 2:00 PM by Maciej Swiderski

    ClassCastException using configuration.buildProcessEngine()

    ricardo delarosa Newbie

      Hi,

       

      I am trying to obtain a fererence to a "ProcessEngine" with the following code:

      ----------- starting code -----------

      org.jbpm.api.ProcessEngine processEngine = null ;

       

      Configuration configuration = new Configuration();
                
             // build a process engine from a configuration
             try {
                processEngine = configuration.buildProcessEngine();  /* ManejadorJBPM4.java:360 */
             }
             catch(java.lang.Exception exc) {
                exc.printStackTrace();
             }

      ----------- ending code -----------

       

      But the following error is printed on the console:

       

      17:47:29,171 ERROR [STDERR] java.lang.ClassCastException: org.jbpm.pvm.internal.
      processengine.ProcessEngineImpl cannot be cast to org.jbpm.pvm.internal.processe
      ngine.ProcessEngineImpl
      17:47:29,171 ERROR [STDERR]     at org.jbpm.pvm.internal.cfg.ConfigurationImpl.b
      uildProcessEngine(ConfigurationImpl.java:81)
      17:47:29,171 ERROR [STDERR]     at org.jbpm.api.Configuration.buildProcessEngine
      (Configuration.java:105)
      17:47:29,171 ERROR [STDERR]     at co.com.gestiontek.supercade.util.ManejadorJBP
      M4.iniciarProceso(ManejadorJBPM4.java:360)
      17:47:29,171 ERROR [STDERR]     at co.com.gestiontek.supercade.action.workflow.R
      egistroTramite.iniciarTramiteEnrolamiento(RegistroTramite.java:354)
      17:47:29,171 ERROR [STDERR]     at co.com.gestiontek.supercade.action.workflow.R
      egistroTramite.iniciarTramite(RegistroTramite.java:292)
      17:47:29,171 ERROR [STDERR]     at co.com.gestiontek.supercade.action.workflow.R
      egistroTramite.registrarTramite(RegistroTramite.java:228)

      ....

      ____________________

      Excuse me but I don't understand why there is a "ClassCastException" due to a casting from

      org.jbpm.pvm.internal.processengine.ProcessEngineImpl to the same class ?

       

      Any body knows why this exception occurs ?

      Any help is very appreciated.

       

      Ricardo De la Rosa