[rules-users] Rule, import with wildcards and variable / patternBinding

Edson Tirelli ed.tirelli at gmail.com
Tue Oct 25 12:22:59 EDT 2011


   Per,

   This looks like a bug. Can you please open a JIRA for it with the
information on this e-mail?

   Thank you,
      Edson

2011/10/25 Per Sterner <pelle711 at yahoo.de>

> Hello,
>
> Yesterday I wanted to upgrade my drools version to 5.3 (from 5.1). I got
> the exception "java.lang.NoClassDefFoundError:
> de/pelle7/testpackage/event/myEvent (wrong name:
> de/pelle7/testpackage/event/MyEvent)" while adding my resources.
> I removed the import wildcards and the error disappeard.
>
> Finally I found the problem:
> I used the patternBinding 'myEvent' and there is a class called
> 'MyEvent' and I used an wildcard import where the class 'MyEvent' is
> located.
>
> Example code:
> "
> package de.pelle7.testrules.impl.drools
>
> import de.pelle7.testpackage.event.*
>
> rule "Test rule 1"
> dialect "java"
> salience 50
> when
>     myEvent : MyEvent( )
>     myEvent2 : MyEvent( data == myEvent.data ) <-- here the Exception
> is thrown
> then
>     System.err.println("Output");
> end
> "
> My solution is that I replaced all my pattern bindings with the suffix
> '$' which is more convenient.
>
>
> Perhaps it would be nice to produce an rule-compilation error. with a
> line notice.
>
> Regard,
>
>   Per Sterner
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111025/e519eb88/attachment.html 


More information about the rules-users mailing list