[rules-users] [Flow 5.0] named query not found: ProcessInstancesWaitingForEvent

Nol de Wit noldewit at gmail.com
Fri Mar 26 05:09:43 EDT 2010


[Drools Flow 5.0, mySql, running a flow from within Eclipse]

Hi All,

Trying to set up Persistence I moved back from 5.1.M1 to 5.0, hoping
for an easier ride. I've got a bit further, but still have errors
while running my flow.

Without Persistence my model executes fine. I've added persistence
much like the way it is explained in chapter 5 of the introduction.

My flow still executes, and in the sessioninfo table get's a record
after the execution. However, at the end of the execution there is an
exception, saying a named query is not found
(ProcessInstancesWaitingForEvent), see below. Since these mostly
reside in mapped classes, I realised that one table in de DB doesn't
have a mapping class in the persisence.xml definition. That table is
'processinstanceinfo_eventtypes'. Could that be the cause of this? If
not, what could be?

Below the stack, and part of my persistence.xml.

26-mrt-2010 9:40:54 bitronix.tm.journal.DiskJournal open
WARNING: active log file is unclean, previous server crash ?
26-mrt-2010 9:40:54 bitronix.tm.recovery.Recoverer run
INFO: recovery committed 0 dangling transaction(s) and rolled back 0
aborted transaction(s) on 1 resource(s) [jdbc/processInstanceDS]
Hibernate: insert into SessionInfo (dirty, lastModificationDate,
rulesByteArray, startDate) values (?, ?, ?, ?)
Fri Mar 26 09:40:59 CET 2010 DEBUG: Executing XA statement: XA START
0x3137322e31362e3230342e32320000012799a1a43700000000,0x3137322e31362e3230342e32320000012799a1a47600000002,0x42746e78
Fri Mar 26 09:40:59 CET 2010 DEBUG: Executing XA statement: XA END
0x3137322e31362e3230342e32320000012799a1a43700000000,0x3137322e31362e3230342e32320000012799a1a47600000002,0x42746e78
Fri Mar 26 09:40:59 CET 2010 DEBUG: Executing XA statement: XA COMMIT
0x3137322e31362e3230342e32320000012799a1a43700000000,0x3137322e31362e3230342e32320000012799a1a47600000002,0x42746e78
ONE PHASE
Hibernate: insert into ProcessInstanceInfo (lastModificationDate,
lastReadDate, processId, processInstanceByteArray, startDate, state,
OPTLOCK) values (?, ?, ?, ?, ?, ?, ?)
Fri Mar 26 09:40:59 CET 2010 DEBUG: Executing XA statement: XA START
0x3137322e31362e3230342e32320000012799a1a4e300000007,0x3137322e31362e3230342e32320000012799a1a51200000009,0x42746e78
bepaal scenario voor regel:
Hibernate: insert into ProcessInstanceInfo (lastModificationDate,
lastReadDate, processId, processInstanceByteArray, startDate, state,
OPTLOCK) values (?, ?, ?, ?, ?, ?, ?)
stuurdata ophalen voor rapportage BWB
bepaal scenario voor regel:
execute scenario 99 voor regel: BBI1
bepaal scenario voor regel:
execute scenario 99 voor regel: BBI2
bepaal scenario voor regel:
execute scenario 99 voor regel: BBI3
bepaal scenario voor regel:
execute scenario 99 voor regel: BBI4
java.lang.IllegalArgumentException: Named query not found:
ProcessInstancesWaitingForEvent
	at org.hibernate.ejb.AbstractEntityManagerImpl.createNamedQuery(AbstractEntityManagerImpl.java:108)
	at org.drools.persistence.processinstance.JPASignalManager.getProcessInstancesForEvent(JPASignalManager.java:50)
	at org.drools.persistence.processinstance.JPASignalManager.signalEvent(JPASignalManager.java:29)
	at org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.setState(WorkflowProcessInstanceImpl.java:191)
	at org.drools.workflow.instance.node.EndNodeInstance.internalTrigger(EndNodeInstance.java:56)
	at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:111)
	at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:141)
	at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:128)



 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence
  version="1.0"
  xsi:schemaLocation=
    "http://java.sun.com/xml/ns/persistence
     http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
     http://java.sun.com/xml/ns/persistence/orm
     http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
  xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://java.sun.com/xml/ns/persistence">

  <persistence-unit name="nl.dnb.avb.drools.jpa">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>jdbc/processInstanceDS</jta-data-source>

    <class>org.drools.persistence.session.SessionInfo</class>
    <class>org.drools.persistence.processinstance.ProcessInstanceInfo</class>
    <class>org.drools.persistence.processinstance.ProcessInstanceEventInfo</class>
    <class>org.drools.persistence.processinstance.WorkItemInfo</class>

    <properties>
      <!--  property name="hibernate.dialect"
value="org.hibernate.dialect.H2Dialect"/ -->
      <property name="hibernate.dialect"
value="org.hibernate.dialect.MySQLDialect"/>
      <property name="hibernate.max_fetch_depth" value="3"/>
      <property name="hibernate.hbm2ddl.auto" value="update"/>
      <property name="hibernate.show_sql" value="true"/>
      <property name="hibernate.transaction.manager_lookup_class"
                value="org.hibernate.transaction.BTMTransactionManagerLookup"/>

    </properties>
  </persistence-unit>
</persistence>



More information about the rules-users mailing list