1 2 Previous Next 26 Replies Latest reply on Jan 23, 2007 2:56 AM by Vlad Tepesch

    Exception on scheduler launch

    Vlad Tepesch Newbie

      Hello

      First of all, sorry for my English, it's not my native language.

      Now, the problem :

      I'm using JBPM 3.1.2 with a JBoss 4.0 and I try to make a project on an Eclispe I haven't setup myself (so I don't really know wich plug in is installed).

      When I try to laucnch the JBPM's Scheduler (using this code in my web.xml)

      <servlet>
       <servlet-name>JbpmThreadsServlet</servlet-name>
       <servlet-class>org.jbpm.web.JbpmThreadsServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet-mapping>
       <servlet-name>JbpmThreadsServlet</servlet-name>
       <url-pattern>/threads</url-pattern>
       </servlet-mapping>


      I receive exceptions on JBoss starting. (In fact, the exceptions appears in loop, so I think JBoss as start, and it's the scheduler which launch the Exception)

      The exception threw is :

      java.sql.SQLException: Can't call rollback when autocommit=true
       at com.mysql.jdbc.Connection.rollback(Connection.java:4729)
       at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcRollback(BaseWrapperManagedConnection.java:535)
       at org.jboss.resource.adapter.jdbc.WrappedConnection.rollback(WrappedConnection.java:460)
       at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:183)
       at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:162)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:154)
       at org.jbpm.svc.Services.close(Services.java:211)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at org.jbpm.msg.command.CommandExecutorThread.executeCommand(CommandExecutorThread.java:139)
       at org.jbpm.msg.command.CommandExecutorThread.run(CommandExecutorThread.java:79)
      14:29:08,137 INFO [STDOUT] org.jbpm.persistence.JbpmPersistenceException: couldn't rollback hibernate session
      14:29:08,137 INFO [STDOUT] at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:156)
      14:29:08,137 INFO [STDOUT] at org.jbpm.svc.Services.close(Services.java:211)
      14:29:08,137 INFO [STDOUT] at org.jbpm.JbpmContext.close(JbpmContext.java:139)
      14:29:08,137 INFO [STDOUT] at org.jbpm.msg.command.CommandExecutorThread.executeCommand(CommandExecutorThread.java:139)
      14:29:08,137 INFO [STDOUT] at org.jbpm.msg.command.CommandExecutorThread.run(CommandExecutorThread.java:79)
      14:29:08,137 INFO [STDOUT] Caused by: org.hibernate.TransactionException: JDBC rollback failed
      14:29:08,137 INFO [STDOUT] at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:170)
      14:29:08,137 INFO [STDOUT] at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:154)
      14:29:08,137 INFO [STDOUT] ... 4 more
      14:29:08,137 INFO [STDOUT] Caused by: java.sql.SQLException: Can't call rollback when autocommit=true
      14:29:08,137 INFO [STDOUT] at com.mysql.jdbc.Connection.rollback(Connection.java:4729)
      14:29:08,137 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcRollback(BaseWrapperManagedConnection.java:535)
      14:29:08,137 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrappedConnection.rollback(WrappedConnection.java:460)
      14:29:08,137 INFO [STDOUT] at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:183)
      14:29:08,137 INFO [STDOUT] at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:162)
      14:29:08,137 INFO [STDOUT] ... 5 more
      14:29:08,137 ERROR [Services] problem closing service 'persistence'
      org.jbpm.persistence.JbpmPersistenceException: couldn't rollback hibernate session
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:156)
       at org.jbpm.svc.Services.close(Services.java:211)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at org.jbpm.msg.command.CommandExecutorThread.executeCommand(CommandExecutorThread.java:139)
       at org.jbpm.msg.command.CommandExecutorThread.run(CommandExecutorThread.java:79)
      Caused by: org.hibernate.TransactionException: JDBC rollback failed
       at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:170)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:154)
       ... 4 more
      Caused by: java.sql.SQLException: Can't call rollback when autocommit=true
       at com.mysql.jdbc.Connection.rollback(Connection.java:4729)
       at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcRollback(BaseWrapperManagedConnection.java:535)
       at org.jboss.resource.adapter.jdbc.WrappedConnection.rollback(WrappedConnection.java:460)
       at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:183)
       at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:162)
       ... 5 more
      14:29:08,137 ERROR [CommandExecutorThread] org.jbpm.JbpmException: problem closing services {persistence=org.jbpm.persistence.JbpmPersistenceException: couldn't rollback hibernate session}
      14:29:08,137 ERROR [SchedulerSession] org.hibernate.MappingException: Named query not known: SchedulerSession.findTimersByDueDate
      14:29:08,137 INFO [SchedulerThread] runtime exception while executing timers
      org.jbpm.JbpmException: couldn't find timers from the database
       at org.jbpm.db.SchedulerSession.findTimersByDueDate(SchedulerSession.java:88)
       at org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread.java:106)
       at org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70)
      Caused by: org.hibernate.MappingException: Named query not known: SchedulerSession.findTimersByDueDate
       at org.hibernate.impl.AbstractSessionImpl.getNamedQuery(AbstractSessionImpl.java:70)
       at org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1260)
       at org.jbpm.db.SchedulerSession.findTimersByDueDate(SchedulerSession.java:82)
       ... 2 more
      14:29:13,129 ERROR [SchedulerSession] org.hibernate.MappingException: Named query not known: SchedulerSession.findTimersByDueDate
      14:29:13,129 ERROR [JDBCTransaction] JDBC rollback failed
      java.sql.SQLException: Can't call rollback when autocommit=true
       at com.mysql.jdbc.Connection.rollback(Connection.java:4729)
       at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcRollback(BaseWrapperManagedConnection.java:535)
       at org.jboss.resource.adapter.jdbc.WrappedConnection.rollback(WrappedConnection.java:460)
       at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:183)
       at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:162)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:154)
       at org.jbpm.svc.Services.close(Services.java:211)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at org.jbpm.msg.command.CommandExecutorThread.executeCommand(CommandExecutorThread.java:139)
       at org.jbpm.msg.command.CommandExecutorThread.run(CommandExecutorThread.java:79)
      14:29:13,160 INFO [SchedulerThread] runtime exception while executing timers
      org.jbpm.JbpmException: couldn't find timers from the database
       at org.jbpm.db.SchedulerSession.findTimersByDueDate(SchedulerSession.java:88)
       at org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread.java:106)
       at org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70)
      Caused by: org.hibernate.MappingException: Named query not known: SchedulerSession.findTimersByDueDate
       at org.hibernate.impl.AbstractSessionImpl.getNamedQuery(AbstractSessionImpl.java:70)
       at org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1260)
       at org.jbpm.db.SchedulerSession.findTimersByDueDate(SchedulerSession.java:82)
       ... 2 more


      I try to search about this on google and I find some patchs at :

      -http://fisheye.jboss.org/viewrep/JBPM/jbpm.3/jpdl/jar/src/main/java/org/jbpm/persistence/db/DbPersistenceService.java?r1=1.4&r2=1.5
      -http://jira.jboss.com/jira/secure/attachment/12312800/jbpm_session_already_closed_exception.patch

      So, I patch my JBPM, rebuild the jar with ant but I always have this exceptions.

      Did someone have a clue that can help me to find why this Exceptions is throwing ? (Or maybee just a method to set autocommit to false into a datasource file with the mysql driver ^^)

      Thanks and goodbye

        • 1. Re: Exception on scheduler launch
          Vlad Tepesch Newbie

          Up please.

          I don't find anything about this in the documentation. Nobody have seen this problem before? My request is badly formed? My English is difficult to understand?

          As I say, even a way of reflexion should be enought to find why the scheduler act like this.

          • 2. Re: Exception on scheduler launch
            Chris OBrien Novice

            Your big problem is that it can't find the timers from the database.

            14:29:08,137 ERROR [SchedulerSession] org.hibernate.MappingException: Named query not known: SchedulerSession.findTimersByDueDate
            14:29:08,137 INFO [SchedulerThread] runtime exception while executing timers
            org.jbpm.JbpmException: couldn't find timers from the database
             at org.jbpm.db.SchedulerSession.findTimersByDueDate(SchedulerSession.java:88)
             at org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread.java:106)
             at org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70)
            Caused by: org.hibernate.MappingException: Named query not known: SchedulerSession.findTimersByDueDate
             at org.hibernate.impl.AbstractSessionImpl.getNamedQuery(AbstractSessionImpl.java:70)
             at org.hibernate.impl.SessionImpl.getNamedQuery(SessionImpl.java:1260)
             at org.jbpm.db.SchedulerSession.findTimersByDueDate(SchedulerSession.java:82)
             ... 2 more


            Do you have all of the jBPM hbm.xml mappings in your project?

            • 3. Re: Exception on scheduler launch
              Vlad Tepesch Newbie

              I believed this problem comes from the SQL Exception throws first.

              I don't have any hbm.xml files in my project, but I will search about them on google. It's maybee he key of the problem :)

              Thanks, and if you know a good site that can speed up my search, I'm OK to use it ;)

              • 4. Re: Exception on scheduler launch
                Chris OBrien Novice

                jBPM already includes it's own .hbm.xml files.

                Its probably trying to rollback when it fails getting the timer query, and then bombs in rollback.

                Search this forum, and the jBPM user guide to make sure your environment is setup properly.

                • 5. Re: Exception on scheduler launch
                  Vlad Tepesch Newbie

                  I'm searching the documentation, but I don't manage to find how I can see if my environment is setup properly :(

                  Can you be more explicit?

                  • 6. Re: Exception on scheduler launch
                    Vlad Tepesch Newbie

                    It's maybee early for an up, but I have this problem since weeks now, and I don't manage to find any solution.

                    • 7. Re: Exception on scheduler launch
                      Vlad Tepesch Newbie

                      Gasp, I cannot edit my message. Sorry, I will make a second one :

                      A friend show me some features of Eclipse, and I manage to find that the problem seems to come from this codeline from findTimersByDueDate() into org.jbpm.db.SchedulerSession :

                      Iterator iterator = session.getNamedQuery("SchedulerSession.findTimersByDueDate").iterate();


                      Should it come from an hibernate misconfiguration? Or worth, a damaged mysql schema. How can I test my mysql schema?

                      • 8. Re: Exception on scheduler launch
                        Chris OBrien Novice

                        SchedulerSession.findTimersByDueDate is a named query inside hibernate.queries.hbm.xml

                        It is important that the hbm.xml taht jBPM uses has the following in it:

                        <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml" />


                        • 9. Re: Exception on scheduler launch
                          Vlad Tepesch Newbie

                          I don't understand of wich hbm.xml you talk. I don't have any file with that name.

                          I only have hibernate.cfg.xml and jbpm.fg.xml

                          Should I create hbm.xml and add the line you indicate?

                          • 10. Re: Exception on scheduler launch
                            Chris OBrien Novice

                            I'm sorry, I meant that the hibernate.cfg.xml needs to have that mapping line in it

                            • 11. Re: Exception on scheduler launch
                              Vlad Tepesch Newbie

                              Hum, it seems we make a big step because there is still the same exception, but now, he first display this :

                              QuerySplitter] no persistent classes found for query class:
                              
                               select ti
                               from org.jbpm.scheduler.exe.Timer as ti
                               where ti.exception is null
                               and ti.isSuspended != true
                               order by ti.dueDate asc
                              
                              
                              16:09:35,047 INFO [STDOUT] java.lang.IllegalArgumentException: not a Hibernate iterator


                              But this classes (org.jbpm.scheduler.exe.Timer) exists. I see another hbm.xml into org.jbpm.scheduler.exe.timer, must I had it to in mapping of hibernate.cfg.xml?

                              • 12. Re: Exception on scheduler launch
                                Chris OBrien Novice

                                your hibernate.cfg.xml needs to have all the mappings for jbpm.

                                Look inside the jbpm-3.1.2\src\config.files directory, that hibernate.cfg.xml needs to be referenced by jBPM. ALl the mappings defined in that cfg.xml need to be in your system.

                                The jBPM JAR should have that file already inside of it, I believe.

                                • 13. Re: Exception on scheduler launch
                                  Chris OBrien Novice

                                  We actually have two separate hibernate.cfg.xml (the other is called jbpm.hibernate.cfg.xml) You could just jam the contents of them both together into one, or load up your SessionFactory/Configuration programmatically to read both config files.

                                  Either way you need the jbpm mappings.

                                  • 14. Re: Exception on scheduler launch
                                    Vlad Tepesch Newbie

                                    Great, it's seems to be that.

                                    I think my hibernate.cfg.xml overide the default hibernate.cfg.xml of jbpm :)

                                    The exception change, and I think it's the end of the problem.

                                    runtime exception while executing timers
                                    org.hibernate.HibernateException: Could not instantiate cache implementation
                                     at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:64)
                                     at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:214)
                                     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)
                                     at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:90)
                                     at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:74)
                                     at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:78)
                                     at org.jbpm.persistence.db.DbPersistenceService.getSchedulerSession(DbPersistenceService.java:244)
                                     at org.jbpm.JbpmContext.getSchedulerSession(JbpmContext.java:529)
                                     at org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread.java:103)
                                     at org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70)
                                    Caused by: org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
                                     at org.hibernate.cache.NoCacheProvider.buildCache(NoCacheProvider.java:21)
                                     at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:61)
                                     ... 9 more


                                    I will try to find it (but you can still respond, your knowledge seems more structured than those I found :) ) Thanks for all, it's so pleasant, even if the scheduler don't yet work, to see all this mapping collection success message :)

                                    1 2 Previous Next