[jboss-jira] [JBoss JIRA] Closed: (JBRULES-1004) Using JDK dynamic proxies without packages crashes drools

Mark Proctor (JIRA) jira-events at lists.jboss.org
Sun Jul 15 00:02:03 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBRULES-1004?page=all ]

Mark Proctor closed JBRULES-1004.
---------------------------------

    Fix Version/s:  4.0.0.MR4
       Resolution: Done
         Assignee: Mark Proctor  (was: Edson Tirelli)

> Using JDK dynamic proxies without packages crashes drools
> ---------------------------------------------------------
>
>                 Key: JBRULES-1004
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-1004
>             Project: JBoss Rules
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions:  4.0.0.MR3
>            Reporter: Chris West
>         Assigned To: Mark Proctor
>             Fix For:  4.0.0.MR4
>
>         Attachments: test.zip
>
>
> Hello,
> I'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.  My project was using CGLib to generate proxies, and they were working just fine in 3.0.6.  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.  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't fire correctly.
> So, in an attempt to create a simple program to illustrate the problem, I ran into a different problem.  The attached eclipse project illustrates this problem.
> The error is:
> java.lang.NullPointerException
>     at org.drools.reteoo.Rete$ObjectTypeConf.<init>(Rete.java:333)
>     at org.drools.reteoo.Rete.assertObject(Rete.java:152)
>     at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
>     at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)
>     at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:772)
>     at org.drools.common.AbstractWorkingMemory.insert (AbstractWorkingMemory.java:584)
>     at com.sample.DroolsTest.main(DroolsTest.java:42)
> 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.
> The suspect code beginning on line 333 is:
>             String pkgName = cls.getPackage().getName();
>             if ( "org.drools.reteoo".equals( pkgName ) || "org.drools.base".equals( pkgName ) ) {
>                 // We don't shadow internal classes
>                 this.shadowEnabled = false;
>                 return;
>             }
> The getPackage() method returns null.  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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list