Oleg,<br><br>So far I have not been successful.&nbsp; I&#39;ve just posted my thoughts to this list (under the subject &quot;The effect of not using shadow facts&quot;).&nbsp; Concerning the class names, my rules only match on an interface type implemented by the proxies, so the actual class type of the instance does not matter.
<br><br>-Chris<br><br><div><span class="gmail_quote">On 7/13/07, <b class="gmail_sendername">Oleg Yavorsky</b> &lt;<a href="mailto:oleg_yavorsky@yahoo.com">oleg_yavorsky@yahoo.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Chris,<br><br>I&#39;m thinking about using dynamic proxies in my rules too. I&#39;ll be glad to hear about your success with them. I think that there could be problem with matching of facts as they won&#39;t be of original class but of Proxy$... one. CGLIB approach doesn&#39;t have such problem as it just modifies original classes&#39; bytecode. I could be wrong, anyway.
<br><br>Oleg.<div><span class="e" id="q_113c00848daa55c4_1"><br><br><b><i>Mark Proctor &lt;<a href="mailto:mproctor@codehaus.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mproctor@codehaus.org
</a>&gt;</i></b> wrote:<blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">        That is not the only thing that determines shadowing. If you look the shadowing is actually determined here:
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( !ruleBase.getConfiguration().isShadowProxy() || cls == null || !ruleBase.getConfiguration().isShadowed( cls.getName() ) ) {<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> By default shadowing is turned on for all (none final) bjects, except stuff in the org.drools namespace, you have to set exclusion lists.too. So if your package has a null namespace it will still attempt to shadow it.
<br> <br> Mark<br> <br> Chris West wrote: <blockquote type="cite">OK, I just solved my own problem.&nbsp; My proxy had no package, since the jdk based proxy is only in a package if it has at least 1 non public interface, according to the javadoc.
<br>   <br> The suspect code beginning on line 333 is:   <br>   <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String pkgName = cls.getPackage().getName();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (
 &quot;org.drools.reteoo&quot;.equals( pkgName ) || &quot;org.drools.base&quot;.equals( pkgName ) ) {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // We don&#39;t shadow internal classes   <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.shadowEnabled = false;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>   <br> The getPackage() method returns null.&nbsp; In this case, it would be good if JBoss Rules handled the null and went on to shadow the object anyway, since it is obviously not in the org.drools packages.
<br>   <br> Now I&#39;ll continue trying to build a test case for my original problem.<br>   <br> Shall I enter a JIRA for this issue?<br>   <br> Thanks,<br> -Chris West<br>   <br>   <div><span class="gmail_quote">On 7/12/07, 
<b class="gmail_sendername">Chris
 West</b> &lt;<a href="mailto:crayzfishr@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">crayzfishr@gmail.com</a>&gt; wrote:</span>   <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>     <br> I&#39;m trying to use objects that are generated as dynamic proxies (through the java.lang.reflect.Proxy class) as facts in JBoss Rules 4.0 MR3.&nbsp; My project was using CGLib to generate proxies, and they were working just fine in 
3.0.6.&nbsp; However, when I tried 4.0, the CGLib based proxies seemed to have a final method that kept the proxies from being proxied as shadow facts.&nbsp; So I rewrote my code to try to use JDK based proxies, and version 4.0 MR3 accepts them and apparently creates shadow facts, but now my rules don&#39;t fire correctly.     
<br>     <br> So, in an attempt to create a simple program to illustrate the problem, I ran into a different problem.&nbsp; The attached eclipse project illustrates
 this problem.<br>     <br> The error is:<br>     <br> java.lang.NullPointerException     <br> &nbsp;&nbsp;&nbsp; at org.drools.reteoo.Rete$ObjectTypeConf.&lt;init&gt;(Rete.java:333)<br> &nbsp;&nbsp;&nbsp; at org.drools.reteoo.Rete.assertObject(Rete.java
:152)<br> &nbsp;&nbsp;&nbsp; at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)<br> &nbsp;&nbsp;&nbsp; at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)<br> &nbsp;&nbsp;&nbsp; at org.drools.common.AbstractWorkingMemory.insert
(AbstractWorkingMemory.java:772)<br> &nbsp;&nbsp;&nbsp; at org.drools.common.AbstractWorkingMemory.insert (AbstractWorkingMemory.java:584)<br> &nbsp;&nbsp;&nbsp; at com.sample.DroolsTest.main(DroolsTest.java:42)<br>     <br> Has anyone successfully used JDK based dynamic proxies as facts?
<br>     <br> Thanks,<br>     <span>-Chris West<br>     </span><br clear="all">   </blockquote>   </div>   <br>   <pre><hr size="4" width="90%">
 _______________________________________________ rules-users mailing list <a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a>
 <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a>   </pre> </blockquote> <br> _______________________________________________
<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote><br></span></div><span class="ad"><p> 
                </p><hr> 
Вы уже с Yahoo!?<br> 
Испытайте обновленную и улучшенную <a>Yahoo! Почту</a>!<p></p></span><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">
rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br><br></blockquote></div><br>