0 Replies Latest reply on Jul 28, 2009 2:58 PM by jbpm_user369

    jbpm, jpa, hibernate mapping issues

      Hello,

      we are building a project using JPA. As we're using Jbpm for handling the business workflow, it is necessary to keep the relevant hibernate mappings for jbpm.

      When the following is declared in the project persistence.xml:


      <?xml version="1.0" encoding="UTF-8"?>
      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
       version="1.0" 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_1_0.xsd">
       <persistence-unit name="prospect_persistence"
       transaction-type="RESOURCE_LOCAL">
      
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
      
      
      
       <mapping-file>org/jbpm/db/hibernate.queries.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/def/Node.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/node/StartState.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/node/EndState.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/node/ProcessState.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/node/Decision.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/node/Fork.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/node/Join.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/node/MailNode.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/node/State.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/def/ProcessDefinition.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/def/Transition.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/def/Event.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/def/Action.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/def/SuperState.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/def/ExceptionHandler.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/instantiation/Delegation.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/node/TaskNode.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/def/ContextDefinition.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/def/VariableAccess.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/bytes/ByteArray.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/module/def/ModuleDefinition.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/file/def/FileDefinition.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/taskmgmt/def/Swimlane.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/taskmgmt/def/Task.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/taskmgmt/def/TaskController.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/scheduler/def/CreateTimerAction.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/scheduler/def/CancelTimerAction.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/exe/Comment.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/exe/ProcessInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/exe/Token.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/exe/RuntimeAction.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/module/exe/ModuleInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/exe/ContextInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/exe/TokenVariableMap.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/exe/VariableInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/log/VariableCreateLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/log/VariableLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/context/log/VariableUpdateLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/job/Job.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/job/Timer.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/job/ExecuteNodeJob.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/taskmgmt/exe/PooledActor.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/action/Script.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/logging/log/MessageLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/logging/log/CompositeLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/log/ActionLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/logging/log/ProcessLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/log/NodeLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/log/SignalLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/log/TransitionLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/graph/log/ProcessStateLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/taskmgmt/log/TaskLog.hbm.xml</mapping-file>
       <mapping-file>org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml</mapping-file>
      
       <properties>
       <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
      
      
      
       <property name="hibernate.ejb.event.post-insert"
       value="org.jboss.envers.event.VersionsEventListener" />
       <property name="hibernate.ejb.event.post-update"
       value="org.jboss.envers.event.VersionsEventListener" />
       <property name="hibernate.ejb.event.post-delete"
       value="org.jboss.envers.event.VersionsEventListener" />
       <property name="hibernate.ejb.event.pre-collection-update"
       value="org.jboss.envers.event.VersionsEventListener" />
       <property name="hibernate.ejb.event.pre-collection-remove"
       value="org.jboss.envers.event.VersionsEventListener" />
       <property name="hibernate.ejb.event.post-collection-recreate"
       value="org.jboss.envers.event.VersionsEventListener" />
       </properties>
      
      
      
       </persistence-unit>
      </persistence>


      we get the following exception:
      ####<Jul 28, 2009 9:53:35 PM EEST> <Warning> <Deployer> <athka628apc> <AdminServer> <[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1248807215726> <BEA-149078> <Stack trace for message 149004
      weblogic.application.ModuleException:
       at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:393)
       at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
       at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
       at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
       at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
       at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
       at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
       at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
       at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
       at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
       at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:16)
       at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
       at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
       at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
       at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
       at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
       at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
       at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
       at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
       at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
       at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
       at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
       at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
       at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
       at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
       at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
      org.hibernate.HibernateException: Errors in named queries: JobSession.getFirstDueJob, TaskMgmtSession.findPooledTaskInstancesByActorId, GraphSession.selectLogsForTokens, GraphSession.findActiveNodesByProcessInstance, GraphSession.findAllRunningProcessInstances, GraphSession.findTokensForProcessInstance, JobSession.resumeJobs, TaskMgmtSession.findTaskInstancesByActorId, TaskMgmtSession.findTaskInstancesByTokenId, GraphSession.NumberOfActiveProcessInstances, JobSession.getTimersByName, JobSession.findExclusiveJobs, GraphSession.findLatestProcessDefinitionQuery, GraphSession.findAllProcessInstancesForADefinition, TaskMgmtSession.findTaskInstancesByActorIds, LoggingSession.findLogsByToken, GraphSession.findAllRunningProcessInstancesWithProcessName, JobSession.getFirstDueJobExlcMonitoredJobs, TaskMgmtSession.findTaskForNode, TaskMgmtSession.findTaskInstancesByProcessInstance, TaskMgmtSession.findOpenTasksOfProcessInstance, GraphSession.findTokensForProcessInNode, GraphSession.findAllProcessInstancesWithProcessName, TaskMgmtSession.findTaskInstancesByIds, JobSession.getFirstAcquirableJob, GraphSession.findAllProcessDefinitions, GraphSession.findAllProcessDefinitionVersions, JobSession.deleteExecuteNodeJobsForProcessInstance, GraphSession.findAllSwimlaneNames, GraphSession.findProcessDefinitionByNameAndVersion, GraphSession.calculateAverageTimeByNode, GraphSession.deleteTaskInstancesById, GraphSession.findTaskInstanceIdsForProcessInstance, GraphSession.deleteJobsForProcessInstance, GraphSession.findProcessInstanceByKey, GraphSession.findAllProcessInstances, JobSession.deleteTimersForProcessInstance, GraphSession.AllProcessNames, TaskMgmtSession.findPooledTaskInstancesByActorIds, JobSession.suspendJobs, GraphSession.NumberOfDeployedProcesses, GraphSession.findSubProcessInstances, GraphSession.findAllTokensOfProcessInstance
       at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:365)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
       at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
       at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
       at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:330)
       at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:123)
       at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:331)
       at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:111)
       at weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:58)
       at weblogic.servlet.internal.WebAppModule.setupPersistenceUnitRegistry(WebAppModule.java:1658)
       at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:383)
       at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
       at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
       at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
       at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
       at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
       at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
       at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
       at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
       at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
       at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:16)
       at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
       at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
       at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
       at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
       at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
       at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
       at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
       at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
       at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
       at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
       at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
       at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
       at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
       at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
       at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
      >
      


      Am I missing something in the syntax of the persistence.xml?
      Any ideas on why this problem comes up?

      Thanks