2 Replies Latest reply on Jul 10, 2013 1:35 AM by Maciej Swiderski

    problem in making a simple human task

    Amin Hosseiny Marani Newbie

      i try to do something that this url mentioned it...but unfortunatley these exception come to me!

       

      my code

      public class ProcessTest {
      
                public static final void main(String[] args) {
                          try {
                                    startUp();
                                    KnowledgeBase kbase = readKnowledgeBase();
      
      
        line 31:                StatefulKnowledgeSession ksession = JBPMHelper.newStatefulKnowledgeSession(kbase);
      
      
                                    ksession.startProcess("human_process");
                                    System.out.println("Process started ...");
      
      
      
                          } catch (Throwable t) {
                                    t.printStackTrace();
                          }
                }
      
                private static KnowledgeBase readKnowledgeBase() throws Exception {
                          KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
                          kbuilder.add(ResourceFactory.newClassPathResource("sample2.bpmn"), ResourceType.BPMN2);
                          return kbuilder.newKnowledgeBase();
                }
      
        private static void startUp()
                {
                          JBPMHelper.startH2Server();
                          JBPMHelper.setupDataSource();
      
                }
      
      

       

      the exceptions :

      javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory

                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)

                at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)

                at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)

                at org.jbpm.test.JBPMHelper.loadStatefulKnowledgeSession(JBPMHelper.java:138)

                at org.jbpm.test.JBPMHelper.newStatefulKnowledgeSession(JBPMHelper.java:127)

                at com.sample.ProcessTest.main(ProcessTest.java:31)

      Caused by: org.hibernate.HibernateException: Could not obtain BTM transaction manager instance

                at org.hibernate.transaction.BTMTransactionManagerLookup.getTransactionManager(BTMTransactionManagerLookup.java:50)

                at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:367)

                at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)

                at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)

                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)

                ... 5 more

      Caused by: java.lang.reflect.InvocationTargetException

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.hibernate.transaction.BTMTransactionManagerLookup.getTransactionManager(BTMTransactionManagerLookup.java:47)

                ... 9 more

      Caused by: bitronix.tm.utils.InitializationException: cannot open disk journal

                at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:75)

                at bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:62)

                ... 14 more

      Caused by: java.io.IOException: transaction log file btm2.tlog is locked. Is another instance already running?

                at bitronix.tm.journal.TransactionLogAppender.<init>(TransactionLogAppender.java:72)

                at bitronix.tm.journal.DiskJournal.open(DiskJournal.java:152)

                at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:62)

                ... 15 more