---
title: "jbpm发布时的异常"
author: "fourfire"
date: "2007-03-16T14:50:50Z"
tags: []
slug: "jbpm"
draft: false
lastmod: "2007-03-16T14:50:50Z"
id: 60350
url: "https://fourfire.iteye.com/blog/60350"
---

1 Q  
13:54:14,453 \[main] ERROR ErrorCounter : \*\** ERROR: line 3:43: expecting "set", found 't'  
13:54:14,468 \[main] ERROR ErrorCounter : \*\** ERROR: line 3:43: expecting "set", found 't'  
13:54:14,484 \[main] ERROR ErrorCounter : \*\** ERROR: line 3:48: unexpected token: t  
13:54:14,546 \[main] ERROR SessionFactoryImpl : Error in named query: SchedulerSession.deleteTimersForProcessInstance  
org.hibernate.hql.ast.QuerySyntaxError: unexpected token: t near line 3, column 48 [  
     
      delete from org.jbpm.scheduler.exe.Timer t  
      where t.processInstance = :processInstance  
     
  ]  
    at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)  
    at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:215)  
    at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)  
    at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)  
    at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:414)  
    at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:375)  
    at org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:278)  
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1054)  
    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.getGraphSession(DbPersistenceService.java:216)  
    at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:427)  
    at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:166)  
    at com.firebow.jbpm.test.DeployProcessTest.testDeployProcessDefinition(DeployProcessTest.java:46)  
    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:585)  
    at junit.framework.TestCase.runTest(TestCase.java:154)  
    at junit.framework.TestCase.runBare(TestCase.java:127)  
    at junit.framework.TestResult$1.protect(TestResult.java:106)  
    at junit.framework.TestResult.runProtected(TestResult.java:124)  
    at junit.framework.TestResult.run(TestResult.java:109)  
A：  
使用hibernate 3.2以上版本  
2 Q：  
&lt;/init&gt;

```
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:1218)
        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.getMessagingSession(DbPersistenceService.java:235)
        at org.jbpm.JbpmContext.getMessagingSession(JbpmContext.java:521)
        at org.jbpm.msg.db.DbMessageService.<init>(DbMessageService.java:49)
        at org.jbpm.msg.db.DbMessageServiceFactory.openService(DbMessageServiceFactory.java:32)
        at org.jbpm.svc.Services.getService(Services.java:136)
        at org.jbpm.svc.Services.getMessageService(Services.java:172)
        at org.jbpm.msg.command.CommandExecutorThread.executeCommand(CommandExecutorThread.java:112)
        at org.jbpm.msg.command.CommandExecutorThread.run(CommandExecutorThread.java:79)
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)</init></init>
```

A:  
hibernate.hbm.xml中加入

```
<property highlightedsearchterm="" name="&amp;lt;span class=">
xml 代码

 <property name="hibernate.cache.use_second_level_cache">false</property>  <property name="hibernate.cache.use_query_cache">false</property>   
或
<property highlightedsearchterm="" name="&amp;lt;span class=">
xml 代码

 <property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>  
或
<property highlightedsearchterm="" name="&amp;lt;span class=">
xml 代码

 <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>  
```