Thanks for clarifying this issue Wolfgang.<br>I will check if I can fix this issue ( I am also skeptical about it ), otherwise I will  at least generate a more proper compilation failure.<br><br>Mario<br><br><div class="gmail_quote">
On Wed, Feb 27, 2013 at 11:03 AM, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
PLEASE READ CAREFULLY, AND UNTIL THE END.<br>
<br>
These two files (foo/Foo.java, foo/foo.drl) are sufficient to<br>
reproduce the bug, i.e., a diagnostic<br>
Exception in thread &quot;main&quot; [Error: could not access field: named.NamedEntity.x]<br>
[Near : {... x == 1 ....}]<br>
             ^<br>
followed by a hefty stack dump due to an insert of a Foo.<br>
<br>
package foo;<br>
/*** not public ***/ class Foo {<br>
    private int x = 1;<br>
    public int getX(){ return x; }<br>
}<br>
<br>
package foo;<br>
rule &quot;foo getX&quot;<br>
when<br>
    Foo( x == 1 )<br>
then<br>
    System.out.println( &quot;some Foo.x == 1&quot; );<br>
end<br>
<br>
But note that the problem goes a little deeper. Remove the constraint,<br>
and the rule fires:<br>
<br>
rule &quot;some Foo&quot;<br>
when<br>
    $foo: Foo()<br>
then<br>
   System.out.println( &quot;some Foo...&quot; );  // works perfectly<br>
end<br>
<br>
But now try to print the matched Foo:<br>
<br>
rule &quot;show all Foo factss&quot;<br>
when<br>
    $foo: Foo()<br>
then<br>
   System.out.println( &quot;Foo: &quot; +  $foo );<br>
end<br>
<br>
Another dump:<br>
<br>
Exception in thread &quot;main&quot; java.lang.IllegalAccessError: tried to<br>
access class named.NamedEntity from class<br>
named.Rule_xxx_fd3f0f5f764b415691fbf49ce4def6d7DefaultConsequenceInvokerGenerated<br>
        at named.Rule_xxx_fd3f0f5f764b415691fbf49ce4def6d7DefaultConsequenceInvokerGenerated.evaluate(Unknown<br>
Source)<br>
        at named.Rule_xxx_fd3f0f5f764b415691fbf49ce4def6d7DefaultConsequenceInvoker.evaluate(Unknown<br>
Source)<br>
        at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1287)<br>
        at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1221)<br>
        at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1456)<br>
        at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:710)<br>
        at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:674)<br>
        at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:230)<br>
        at named.Main.execute(Main.java:83)<br>
<br>
I DO understand why this happens (so please DON&#39;T explain it to me).<br>
<br>
HOWEVER, IF PACKAGE VISIBILITY CANNOT BE HANDLED (and I don&#39;t think it<br>
can), IT SHOULD BE REFUTED WITH A PROPER DIAGNOSTIC.<br>
<br>
-W<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</blockquote></div><br>