I was looking that in the trunk but I don&#39;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> &lt;dependency&gt;<br>
            &lt;groupId&gt;org.drools&lt;/groupId&gt;<br>            &lt;artifactId&gt;drools-persistence-jpa&lt;/artifactId&gt;<br>            &lt;version&gt;5.1.0.SNAPSHOT&lt;/version&gt;<br>           <br>           <br>
        &lt;/dependency&gt;<br><br>        &lt;dependency&gt;<br>            &lt;groupId&gt;org.drools&lt;/groupId&gt;<br>            &lt;artifactId&gt;drools-workitems&lt;/artifactId&gt;<br>            &lt;version&gt;5.1.0.SNAPSHOT&lt;/version&gt;<br>
        &lt;/dependency&gt;<br><br>and in my META-INF directory I have the following orm.xml file:<br><br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;entity-mappings xmlns=&quot;<a href="http://java.sun.com/xml/ns/persistence/orm">http://java.sun.com/xml/ns/persistence/orm</a>&quot;<br>
               xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot;<br>               xsi:schemaLocation=&quot;<a href="http://java.sun.com/xml/ns/persistence/orm">http://java.sun.com/xml/ns/persistence/orm</a> orm_1_0.xsd&quot;<br>
               version=&quot;1.0&quot;&gt;  <br>      &lt;named-query name=&quot;ProcessInstancesWaitingForEvent&quot;&gt;<br>          &lt;query&gt;<br>select <br>    processInstanceInfo.processInstanceId<br>from <br>    ProcessInstanceInfo processInstanceInfo<br>
where<br>    :type in elements(processInstanceInfo.eventTypes)<br>          &lt;/query&gt;<br>      &lt;/named-query&gt;<br>       &lt;!--named-query name=&quot;VariableInstancesInfoByProcessId&quot;&gt;<br>          &lt;query&gt;<br>
select<br>    v<br>from<br>    VariableInstanceInfo v<br>where<br>    <a href="http://v.processInstanceInfo.id">v.processInstanceInfo.id</a> = :processId<br>          &lt;/query&gt;<br>      &lt;/named-query--&gt;<br>&lt;/entity-mappings&gt;<br>
<br><br>Greetings.<br><br><div class="gmail_quote">On Fri, Jul 16, 2010 at 7:07 PM, Rory Farrell <span dir="ltr">&lt;<a href="mailto:rjf@bellsouth.net">rjf@bellsouth.net</a>&gt;</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&#39;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&#39;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&#39;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>
&lt;class&gt;org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo&lt;/class&gt;<br>
&lt;class&gt;org.drools.persistence.processinstance.variabletypes.JPAPersistedVariable&lt;/class&gt;<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&#39;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&#39;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 &quot;Salaboy&quot; Mauricio -<br>