2 Replies Latest reply on Oct 18, 2013 5:47 PM by Felipe Reis

    Problem with insert sessioninfo

    li thirst Newbie

      TransactionManager transactionManager = new DroolsSpringTransactionManager(aptm);

      Environment env = EnvironmentFactory.newEnvironment();

      env.set(EnvironmentName.APP_SCOPED_ENTITY_MANAGER, em);

      env.set(EnvironmentName.CMD_SCOPED_ENTITY_MANAGER, em);

      env.set("IS_JTA_TRANSACTION", false);

      env.set("IS_SHARED_ENTITY_MANAGER", true);

      env.set(EnvironmentName.TRANSACTION_MANAGER, transactionManager);

      PersistenceContextManager persistenceContextManager = new DroolsSpringJpaManager(env);

      env.set(EnvironmentName.PERSISTENCE_CONTEXT_MANAGER, persistenceContextManager);

      KnowledgeBase kbase = kbuilder.newKnowledgeBase();

      StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);

       

      Program execution to "StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);", Program throw error:

       

      14:26:38,489 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) Hibernate: insert into SessionInfo (lastModificationDate, rulesByteArray, startDate, OPTLOCK) values (?, ?, ?, ?)

      14:26:38,500 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost-127.0.0.1-8080-1) SQL Error: 1364, SQLState: HY000

      14:26:38,500 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost-127.0.0.1-8080-1) Field 'id' doesn't have a default value

      14:26:38,502 ERROR [org.drools.persistence.SingleSessionCommandService] (http-localhost-127.0.0.1-8080-1) Could not commit session: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Field 'id' doesn't have a default value

                at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1295) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:859) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_27-ea]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_27-ea]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_27-ea]

                at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_27-ea]

                at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240) [org.springframework.orm-3.1.1.RELEASE.jar:3.1.1.RELEASE]

                at $Proxy38.persist(Unknown Source)          at org.drools.persistence.jpa.JpaPersistenceContext.persist(JpaPersistenceContext.java:24) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]

                at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:153) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]

                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_27-ea]

                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [rt.jar:1.6.0_27-ea]

                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [rt.jar:1.6.0_27-ea]

                at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [rt.jar:1.6.0_27-ea]

                at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:128) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]

                at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:66) [drools-persistence-jpa-5.5.0.Final.jar:5.5.0.Final]

                at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122) [knowledge-api-5.5.0.Final.jar:5.5.0.Final]

                at com.one.util.JbpmUtil.initializeSession(JbpmUtil.java:85) [classes:]

                at com.one.jbpm.JBPMEngine.createKsession(JBPMEngine.java:40) [classes:]

                at com.one.jbpm.JBPMEngine.createProcessInstance(JBPMEngine.java:46) [classes:]

                at com.one.action.LeaveAction.create(LeaveAction.java:39) [classes:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_27-ea]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_27-ea]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_27-ea]

                at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_27-ea]

                at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252) [xwork-core-2.3.12.jar:2.3.12]

                at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) [struts2-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) [xwork-core-2.3.12.jar:2.3.12]

                at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) [struts2-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:249) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:249) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) [struts2-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91) [struts2-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252) [struts2-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) [struts2-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187) [xwork-core-2.3.12.jar:2.3.12]

                at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) [xwork-core-2.3.12.jar:2.3.12]

                at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) [struts2-core-2.3.12.jar:2.3.12]

                at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:546) [struts2-core-2.3.12.jar:2.3.12]

                at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) [struts2-core-2.3.12.jar:2.3.12]

                at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) [struts2-core-2.3.12.jar:2.3.12]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

                at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_27-ea]

      Caused by: org.hibernate.exception.GenericJDBCException: Field 'id' doesn't have a default value

                at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:52) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at $Proxy45.executeUpdate(Unknown Source)          at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:96) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:55) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2757) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3268) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:78) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:272) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:304) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:195) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:128) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:78) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:208) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:151) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:78) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:725) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:701) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:705) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:853) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]

                ... 86 more

      Caused by: java.sql.SQLException: Field 'id' doesn't have a default value

                at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074) [mysql-connector-java-5.1.22-bin.jar:]

                at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096) [mysql-connector-java-5.1.22-bin.jar:]

                at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028) [mysql-connector-java-5.1.22-bin.jar:]

                at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490) [mysql-connector-java-5.1.22-bin.jar:]

                at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651) [mysql-connector-java-5.1.22-bin.jar:]

                at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2734) [mysql-connector-java-5.1.22-bin.jar:]

                at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155) [mysql-connector-java-5.1.22-bin.jar:]

                at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2458) [mysql-connector-java-5.1.22-bin.jar:]

                at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2375) [mysql-connector-java-5.1.22-bin.jar:]

                at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2359) [mysql-connector-java-5.1.22-bin.jar:]

                at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) [commons-dbcp-1.4.jar:1.4]

                at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105) [commons-dbcp-1.4.jar:1.4]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_27-ea]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_27-ea]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_27-ea]

                at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_27-ea]

                at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

                ... 105 more

       

      Database have sessioninfo and SESSIONINFO_ID_SEQ tables.

       

      persistence.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <persistence version="2.0"

                xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

                <persistence-unit name="sh" transaction-type="RESOURCE_LOCAL">

                          <provider>org.hibernate.ejb.HibernatePersistence</provider>

                          <mapping-file>META-INF/JBPMorm.xml</mapping-file>

                          <mapping-file>META-INF/Taskorm.xml</mapping-file>

                          <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>

                          <non-jta-data-source>java:jboss/datasources/YourDatasourceName</non-jta-data-source>

                          <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

                          <class>org.drools.persistence.info.SessionInfo</class>

                          <class>org.drools.persistence.info.WorkItemInfo</class>

                          <class>org.jbpm.process.audit.ProcessInstanceLog</class>

                          <class>org.jbpm.process.audit.NodeInstanceLog</class>

                          <class>org.jbpm.process.audit.VariableInstanceLog</class>

       

                          <class>org.jbpm.task.Attachment</class>

                          <class>org.jbpm.task.Content</class>

                          <class>org.jbpm.task.BooleanExpression</class>

                          <class>org.jbpm.task.Comment</class>

                          <class>org.jbpm.task.Deadline</class>

                          <class>org.jbpm.task.Comment</class>

                          <class>org.jbpm.task.Deadline</class>

                          <class>org.jbpm.task.Delegation</class>

                          <class>org.jbpm.task.Escalation</class>

                          <class>org.jbpm.task.Group</class>

                          <class>org.jbpm.task.I18NText</class>

                          <class>org.jbpm.task.Notification</class>

                          <class>org.jbpm.task.EmailNotification</class>

                          <class>org.jbpm.task.EmailNotificationHeader</class>

                          <class>org.jbpm.task.PeopleAssignments</class>

                          <class>org.jbpm.task.Reassignment</class>

                          <class>org.jbpm.task.Status</class>

                          <class>org.jbpm.task.Task</class>

                          <class>org.jbpm.task.TaskData</class>

                          <class>org.jbpm.task.SubTasksStrategy</class>

                          <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>

                          <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>

                          <class>org.jbpm.task.User</class>

       

                          <class>com.one.model.LeaveInformation</class>

       

                          <properties>

                                    <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />

                                    <property name="hibernate.connection.autocommit" value="true" />

                                    <property name="hibernate.show_sql" value="true" />

                                    <property name="hibernate.hbm2ddl.auto" value="update" />

                          </properties>

                </persistence-unit>

      </persistence>

       

      applicationContext.xml

      <beans xmlns="http://www.springframework.org/schema/beans"

                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"

                xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"

                xsi:schemaLocation="http://www.springframework.org/schema/beans

                http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

                          http://www.springframework.org/schema/aop

                                                                  http://www.springframework.org/schema/aop/spring-aop-3.0.xsd

                                                                  http://www.springframework.org/schema/tx

                                                                  http://www.springframework.org/schema/tx/spring-tx-3.0.xsd

                                                                  ">

       

                <bean

                          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

                          <property name="locations">

                                    <list>

      <!--                                         <value>classpath:conf/property/jdbc.properties</value> -->

                                    </list>

                          </property>

                          <property name="properties">

                                    <value>custom.strategy.class=com.foo.DefaultStrategy</value>

                          </property>

                </bean>

       

                <bean id="myEmf" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> 

              <property name="dataSource" ref="baseDataSource"/> 

              <property name="persistenceUnitName" value="sh" />

              <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" /> 

          </bean> 

          <bean id="jbpmEM"

                          class="org.springframework.orm.jpa.support.SharedEntityManagerBean">

                          <property name="entityManagerFactory" ref="myEmf" />

                </bean>

       

          <bean id="myTxManager" class="org.springframework.orm.jpa.JpaTransactionManager"> 

              <property name="entityManagerFactory" ref="myEmf" /> 

          </bean> 

       

          <tx:advice id="txAdvice" transaction-manager="myTxManager"> 

              <tx:attributes> 

                  <tx:method name="*" propagation="REQUIRED" /> 

              </tx:attributes> 

          </tx:advice> 

       

          <aop:config> 

              <aop:pointcut expression="execution(* com.one.dao.*.*(..))" id="myTx1"/> 

              <aop:advisor advice-ref="txAdvice" pointcut-ref="myTx1"/> 

          </aop:config>

         

          <bean id="baseDataSource" class="org.apache.commons.dbcp.BasicDataSource">

                          <property name="driverClassName" value="com.mysql.jdbc.Driver" />

                          <property name="url" value="jdbc:mysql://localhost:3306/lian" />

                          <property name="username" value="root" />

                          <property name="password" value="" />

                </bean>