[rules-users] 答复: Adhoc NullPointer exception in rule execution

Wolfgang Laun wolfgang.laun at gmail.com
Sat Mar 10 13:57:44 EST 2012


Since you ask me... It may not be "wisdom", though...

I do not use 'dialect "mvel"' in the rules I write. Here are some facts on
which this decision is based.

   - My company develops safety-relevant SW according to the standards set
   forth by a body called
CENELEC<http://en.wikipedia.org/wiki/European_Committee_for_Electrotechnical_Standardization>.
   The (for us) essential standard refutes the use of any language that hasn't
   a formal definition. I've never found such a definition for MVEL.
   - A considerable number of Drools bugs are, in fact, MVEL bugs.
   - Bug fixing of MVEL by its author is tardy (as I've been told by
   members of the Drools team), and therefore:
   - The Drools project had to adopt the strategy of issuing their own
   release of MVEL, to be bundled with Drools releases.

There's some good reasons why MVEL has been introduced into Drools, and why
it is used when and where it is used. But I wouldn't recommend it's use in
RHS of rules just to save me the trouble of writing the more verbose Java
equivalent.

Also, I'd like to point out that MVEL bug fixing has picked up as soon as
Drools team members were available to do so.

Cheers
Wolfgang


2012/3/10 Zhuo Li <milanello1998 at gmail.com>

>  Yep, Wolfgang,****
>
> ** **
>
> It¡¯s a code issue ¨C I just identified it¡­ thanks. I have another thread
> talking about NoClassDefFound exception. Would appreciate if you can share
> your wisdom there.****
>
> ** **
>
> Best****
>
> Abe****
>
> ** **
>
> *·¢¼þÈË:* rules-users-bounces at lists.jboss.org [mailto:
> rules-users-bounces at lists.jboss.org] *´ú±í *Wolfgang Laun
> *·¢ËÍʱ¼ä:* 2012Äê3ÔÂ11ÈÕ 1:06
> *ÊÕ¼þÈË:* Rules Users List
> *Ö÷Ìâ:* Re: [rules-users] Adhoc NullPointer exception in rule execution****
>
> ** **
>
> The location of the NPE is ****
>
>     at com.xxx.xxx.xxx.xxx.xxx.xxx.xxx(xxx.java:634)****
>
> and that's your code, invoked from the right hand side of rule Match.****
>
> ** **
>
> -W****
>
> ** **
>
> 2012/3/10 Zhuo Li <milanello1998 at gmail.com>****
>
> Hi, folks,****
>
>  ****
>
> I¡¯m using Drools 5.1, MVEL dialect, JDK 1.6 to build a OLTP system running
> on tomcat 6.0.28. the runtime environment is on a cloud virtual and node
> profile is relatively small. We¡¯ve noticed below run time exceptions from
> prod since it¡¯s online from day one which is impacting transaction
> processing. However it is happening adhoc-ly. Here I have 1 question:****
>
>  ****
>
> 1.       The yellow marked lines are actually java file compiled from DRL
> file. Why there is null pointer exception thrown from
> org.drools.common.DefaultAgenda.fireActivation?****
>
>  ****
>
> ERROR>2012-02-25 11:42:25,071
> com.xxx.xxx.xxx.xxx[DefaultQuartzScheduler_Worker-3]: Rules run time error:
> ****
>
> org.drools.runtime.rule.ConsequenceException: rule: Match****
>
>  ****
>
>         at
> org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
> ****
>
>         at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:916)****
>
>         at
> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:845)****
>
>         at
> org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1056)****
>
>         at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:733)
> ****
>
>         at
> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
> ****
>
>         at
> org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
> ****
>
>         at com. xxx.xxx.xxx.xxx.xxx.xxx.xxx (SessionManager.java:94)****
>
>         at com. xxx.xxx.xxx.xxx.xxx.xxx.yyy(SessionManagerJob.java:17)****
>
>         at org.quartz.core.JobRunShell.run(JobRunShell.java:202)****
>
>         at
> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
> ****
>
> Caused by: java.lang.NullPointerException****
>
>         at com.xxx.xxx.xxx.xxx.xxx.xxx.xxx(xxx.java:634)****
>
>         at com.xxx.xxx.xxx.xxx.xxx.yyy.yyy(yyy.java:227)****
>
>         at com.xxx.xxx.xxx.xxx.xxx.yyy.zzz(zzz.java:115)****
>
>         at com.xxx.xxx.xxx.xxx.xxx.yyy.ttt(ttt.java:83)****
>
>         at com.xxx.xxx.xxx.xxx.xxx.yyy.uuu(uuu.java:75)****
>
>         at com. com.xxx.xxx.xxx.xxx.xxx.yyy.vvv(vvv.java:9)****
>
>         at com. com.xxx.xxx.xxx.xxx.xxx.yyy.www(www.java:28)****
>
>         at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:906)****
>
>         ... 9 more****
>
> Best regards****
>
> Abe****
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users****
>
> ** **
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120310/15deb17c/attachment.html 


More information about the rules-users mailing list