I was looking that in the trunk but I don't see nothing strange about persistence there..<br>I can host a project that has the persistence configuration work if you want.<br><br>but my maven deps are: <br> <dependency><br>
<groupId>org.drools</groupId><br> <artifactId>drools-persistence-jpa</artifactId><br> <version>5.1.0.SNAPSHOT</version><br> <br> <br>
</dependency><br><br> <dependency><br> <groupId>org.drools</groupId><br> <artifactId>drools-workitems</artifactId><br> <version>5.1.0.SNAPSHOT</version><br>
</dependency><br><br>and in my META-INF directory I have the following orm.xml file:<br><br><?xml version="1.0" encoding="UTF-8"?><br><entity-mappings xmlns="<a href="http://java.sun.com/xml/ns/persistence/orm">http://java.sun.com/xml/ns/persistence/orm</a>"<br>
xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"<br> xsi:schemaLocation="<a href="http://java.sun.com/xml/ns/persistence/orm">http://java.sun.com/xml/ns/persistence/orm</a> orm_1_0.xsd"<br>
version="1.0"> <br> <named-query name="ProcessInstancesWaitingForEvent"><br> <query><br>select <br> processInstanceInfo.processInstanceId<br>from <br> ProcessInstanceInfo processInstanceInfo<br>
where<br> :type in elements(processInstanceInfo.eventTypes)<br> </query><br> </named-query><br> <!--named-query name="VariableInstancesInfoByProcessId"><br> <query><br>
select<br> v<br>from<br> VariableInstanceInfo v<br>where<br> <a href="http://v.processInstanceInfo.id">v.processInstanceInfo.id</a> = :processId<br> </query><br> </named-query--><br></entity-mappings><br>
<br><br>Greetings.<br><br><div class="gmail_quote">On Fri, Jul 16, 2010 at 7:07 PM, Rory Farrell <span dir="ltr"><<a href="mailto:rjf@bellsouth.net">rjf@bellsouth.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi, I'm trying to get persistence working in Drools 5.1.0.M2. I read<br>
through the documentation and the drools-user forum posts and made some<br>
progress but I'm stuck at:<br>
<br>
SEVERE: Error in named query: ProcessInstancesWaitingForEvent<br>
org.hibernate.QueryException: cannot dereference scalar collection<br>
element: name [select processInstanceInfo.processInstanceId from<br>
org.drools.persistence.processinstance.ProcessInstanceInfo<br>
processInstanceInfo where :type in (<a href="http://processInstanceInfo.eventTypes.name" target="_blank">processInstanceInfo.eventTypes.name</a>)]<br>
<br>
Here are the steps I've followed so far:<br>
<br>
1. Read the documentation and cut and pasted the code to run and persist<br>
a small sample ruleflow. I got the following exception:<br>
<br>
Caused by: org.hibernate.AnnotationException: Use of @OneToMany or<br>
@ManyToMany targeting an unmapped class:<br>
org.drools.persistence.processinstance.ProcessInstanceInfo.variables[org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo]<br>
<br>
2. Read through the forum and added the following lines to the<br>
persistence.xml file:<br>
<br>
<class>org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo</class><br>
<class>org.drools.persistence.processinstance.variabletypes.JPAPersistedVariable</class><br>
<br>
I got the following exception:<br>
<br>
Caused by: java.lang.IllegalArgumentException: Named query not found:<br>
ProcessInstancesWaitingForEvent<br>
<br>
3. Read through the forum again and the only thing I found was a post<br>
saying to make sure that the orm.xml with the named query was in the<br>
META-INF directory in the drools-persistence-jpa.jar. I checked and the<br>
orm.xml with the named query was in the<br>
drools-persistence-jpa-5.1.0.M2.jar. I tried copying the orm.xml into a<br>
META-INF directory in my classpath and I got the following exception:<br>
<br>
SEVERE: Error in named query: ProcessInstancesWaitingForEvent<br>
org.hibernate.QueryException: cannot dereference scalar collection<br>
element: name [select processInstanceInfo.processInstanceId from<br>
org.drools.persistence.processinstance.ProcessInstanceInfo<br>
processInstanceInfo where :type in (<a href="http://processInstanceInfo.eventTypes.name" target="_blank">processInstanceInfo.eventTypes.name</a>)]<br>
<br>
I'm stuck at this point. It looks like the orm.xml is not in sync with<br>
the Drools 5.1.0.M2 code. I'm sure that someone must have this working.<br>
If so, could you post the orm.xml file that you are using or give me a<br>
pointer as to where I might be going wrong?<br>
<br>
Regards,<br>
Rory<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br> - CTO @ <a href="http://www.plugtree.com">http://www.plugtree.com</a> <br> - MyJourney @ <a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a><br> - Co-Founder @ <a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a><br>
<br> - Salatino "Salaboy" Mauricio -<br>