0 Replies Latest reply on Aug 1, 2011 9:24 PM by ha ha

    JBPM4:deploy zip file as process definition,but throw a Exception:org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update...

    ha ha Newbie

      Hi!

       

      1.my app environment:

      jbpm4+hibernate3+mysql5+tomcat6

       

      2.jbpm.hibernate.cfg.xml:


      <hibernate-configuration>
        <session-factory>
      
           <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
           <property name="hibernate.connection.url">jdbc:mysql://127.0.0.1/jbpm4</property>
           <property name="hibernate.connection.username">root</property>
           <property name="hibernate.connection.password"></property>
           <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
           <property name="hibernate.hbm2ddl.auto">update</property>
           <property name="hibernate.format_sql">true</property>
      
           <mapping resource="jbpm.repository.hbm.xml" />
           <mapping resource="jbpm.execution.hbm.xml" />
           <mapping resource="jbpm.history.hbm.xml" />
           <mapping resource="jbpm.task.hbm.xml" />
           <mapping resource="jbpm.identity.hbm.xml" />
      
        </session-factory>
      </hibernate-configuration>
      

       

      3.the test code:


      public void test1() throws FileNotFoundException {
              ProcessEngine pe = Configuration.getProcessEngine();
      
              RepositoryService repositoryService = pe.getRepositoryService();
      
              File f = new File("F:\\leave.zip");
              FileInputStream stream = new FileInputStream(f);
      
              ZipInputStream zis = new ZipInputStream(stream);
      
              //the under line throw a exception
              repositoryService.createDeployment().addResourcesFromZipInputStream(zis).deploy();
      }
      

       

      4.exception:

      严重: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '·?c} F?\"FD,b*fn±>??os?Dg?¨??y‘??-bD?\"?b??????ù4I??GZ7?E? 1\"b “??[ “?>$???Lò&#127;?' at line 1

      2011-7-31 9:48:45 org.hibernate.event.def.AbstractFlushingEventListener performExecutions

      严重: Could not synchronize database state with session

      org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update

           at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)

           at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

           at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)

           at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:114)

           at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:109)

           at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:244)

           at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2252)

           at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2688)

           at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)

           at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)

           at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)

           at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)

           at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)

           at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)

           at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996)

           at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1141)

           at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)

           at org.jbpm.pvm.internal.query.AbstractQuery.execute(AbstractQuery.java:96)

           at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.execute(ProcessDefinitionQueryImpl.java:65)

           at org.jbpm.pvm.internal.query.AbstractQuery.untypedList(AbstractQuery.java:71)

           at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.list(ProcessDefinitionQueryImpl.java:141)

           at org.jbpm.pvm.internal.repository.ProcessDeployer.checkKey(ProcessDeployer.java:134)

           at org.jbpm.pvm.internal.repository.ProcessDeployer.deploy(ProcessDeployer.java:93)

           at org.jbpm.pvm.internal.repository.DeployerManager.deploy(DeployerManager.java:46)

           at org.jbpm.pvm.internal.repository.RepositorySessionImpl.deploy(RepositorySessionImpl.java:61)

           at org.jbpm.pvm.internal.cmd.DeployCmd.execute(DeployCmd.java:47)

           at org.jbpm.pvm.internal.cmd.DeployCmd.execute(DeployCmd.java:33)

           at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)

           at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)

           at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)

           at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)

           at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)

           at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)

           at org.jbpm.pvm.internal.repository.DeploymentImpl.deploy(DeploymentImpl.java:91)

           at org.apache.jsp.deploy_jsp._jspService(deploy_jsp.java:67)

           at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

           at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

           at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)

           at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

           at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

           at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

           at java.lang.Thread.run(Thread.java:619)

      Caused by: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '·?c} F?\"FD,b*fn±>??os?Dg?¨??y‘??-bD?\"?b??????ù4I??GZ7?E? 1\"b “??[ “?>$???Lò&#127;?' at line 1

           at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1269)

           at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:955)

           at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)

           at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)

           ... 50 more

       

      Thanks

       

      sen