[jboss-user] [jBPM] - Persistence config for task and session fails

Gary Struthers do-not-reply at jboss.com
Fri Aug 12 04:34:22 EDT 2011


Gary Struthers [http://community.jboss.org/people/GaryS] created the discussion

"Persistence config for task and session fails"

To view the discussion, visit: http://community.jboss.org/message/620733#620733

--------------------------------------------------------------
I have session persistence working but when I add task persistence I get errors

1    11/08 18:00:51,012[main] ERROR hibernate.impl.SessionFactoryImpl.<init> - Error in named query: ProcessInstancesWaitingForEvent
org.hibernate.hql.ast.QuerySyntaxException: ProcessInstanceInfo is not mapped [select processInstanceInfo.processInstanceId from ProcessInstanceInfo processInstanceInfo where :type in elements(processInstanceInfo.eventTypes)]
...
javax.persistence.PersistenceException: [PersistenceUnit: org.drools.task] Unable to build EntityManagerFactory
...
Caused by: org.hibernate.HibernateException: Errors in named queries: ProcessInstancesWaitingForEvent

I map to different orm.xml files
    <persistence-unit name="org.drools.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>jdbc/testDS</jta-data-source>
<mapping-file>META-INF/orm.xml</mapping-file>
...
    <persistence-unit name="org.drools.task">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>META-INF/ormtask.xml</mapping-file>


In my main method
              EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("org.drools.persistence.jpa");

        //Creates the Environment and sets its attributes
        Environment env = KnowledgeBaseFactory.newEnvironment();
        env.set(EnvironmentName.ENTITY_MANAGER_FACTORY,
                            entityManagerFactory);

In my TaskServerDaemon
        EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("org.drools.task");
        TaskService taskService = new TaskService(entityManagerFactory, SystemEventListenerFactory.getSystemEventListener());

Why doesn't this work?
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/620733#620733]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110812/8d6673d2/attachment-0001.html 


More information about the jboss-user mailing list