[rules-users] Persistence with Drools 5.1.0.M2
Rory Farrell
rjf at bellsouth.net
Fri Jul 16 18:07:19 EDT 2010
Hi, I'm trying to get persistence working in Drools 5.1.0.M2. I read
through the documentation and the drools-user forum posts and made some
progress but I'm stuck at:
SEVERE: Error in named query: ProcessInstancesWaitingForEvent
org.hibernate.QueryException: cannot dereference scalar collection
element: name [select processInstanceInfo.processInstanceId from
org.drools.persistence.processinstance.ProcessInstanceInfo
processInstanceInfo where :type in (processInstanceInfo.eventTypes.name)]
Here are the steps I've followed so far:
1. Read the documentation and cut and pasted the code to run and persist
a small sample ruleflow. I got the following exception:
Caused by: org.hibernate.AnnotationException: Use of @OneToMany or
@ManyToMany targeting an unmapped class:
org.drools.persistence.processinstance.ProcessInstanceInfo.variables[org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo]
2. Read through the forum and added the following lines to the
persistence.xml file:
<class>org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo</class>
<class>org.drools.persistence.processinstance.variabletypes.JPAPersistedVariable</class>
I got the following exception:
Caused by: java.lang.IllegalArgumentException: Named query not found:
ProcessInstancesWaitingForEvent
3. Read through the forum again and the only thing I found was a post
saying to make sure that the orm.xml with the named query was in the
META-INF directory in the drools-persistence-jpa.jar. I checked and the
orm.xml with the named query was in the
drools-persistence-jpa-5.1.0.M2.jar. I tried copying the orm.xml into a
META-INF directory in my classpath and I got the following exception:
SEVERE: Error in named query: ProcessInstancesWaitingForEvent
org.hibernate.QueryException: cannot dereference scalar collection
element: name [select processInstanceInfo.processInstanceId from
org.drools.persistence.processinstance.ProcessInstanceInfo
processInstanceInfo where :type in (processInstanceInfo.eventTypes.name)]
I'm stuck at this point. It looks like the orm.xml is not in sync with
the Drools 5.1.0.M2 code. I'm sure that someone must have this working.
If so, could you post the orm.xml file that you are using or give me a
pointer as to where I might be going wrong?
Regards,
Rory
More information about the rules-users
mailing list