[rules-users] Problem Setting globals in drools session
Greg Barton
greg_barton at yahoo.com
Tue Jul 6 15:42:49 EDT 2010
Let's keep this on the list. Also, since your reply text is at the end of the email I'll repaste it below:
--- On Tue, 7/6/10, djerir smail <1983djerir at gmail.com> wrote:
> > Thank you for your
> response,my application is deployed in Mobicents slee AS, I
> think it uses multiple classloaders .how can I fix that
> please
> >
I've never used Mobicents before so I don't have the first clue, but a quick google on "mobicents classloader" returns this as the first result:
http://markmail.org/message/z3sy5gtaghxc3366
>From that link: "Working with classpaths/URLs would result the same class to be loaded in multiple classloaders, and then you would have linkage errors when passing from one component to other..." Sounds familiar. :) There should be some solution in Mobicents for passing objects between components such that they share a common class.
--- On Tue, 7/6/10, djerir smail <1983djerir at gmail.com> wrote:
> From: djerir smail <1983djerir at gmail.com>
> Subject: Re: [rules-users] Problem Setting globals in drools session
> To: "Greg Barton" <greg_barton at yahoo.com>
> Date: Tuesday, July 6, 2010, 2:25 PM
> Greg Barton a écrit :
> > Does your application use multiple classloaders? It's
> possible for two instances with the same class definition to
> not have "equal" classes if the class is loaded twice from
> different classloaders.
> >
> > --- On Mon, 7/5/10, djerir smail <1983djerir at gmail.com>
> wrote:
> >
> >
> >> From: djerir smail <1983djerir at gmail.com>
> >> Subject: [rules-users] Problem Setting globals in
> drools session
> >> To: "Rules Users List" <rules-users at lists.jboss.org>
> >> Date: Monday, July 5, 2010, 2:38 PM
> >> Hello everybody,
> >>
> >> When I try to sett my globals I get this
> error
> >>
> >> 2010-07-05 21:26:04,531 ERROR [STDERR]
> >> java.lang.RuntimeException: Illegal class for
> global. Expected
> >> [ulb.mfe.srabre.ra.BREINTERFACE], found
> [ulb.mfe.srabre.ra.BREINTERFACE].
> >>
> >> Can anyone explain to me what does this error mean
> please
> >> .
> >>
> >> MY DRL FILE
> >>
> >> package ulb.mfe.srabre.rule
> >>
> >> import ulb.mfe.srabre.ra.BREINTERFACE;
> >> import ulb.mfe.srabre.ra.DROOLSSLEEAgent;
> >>
> >> global ulb.mfe.srabre.ra.BREINTERFACE
> BRERAInterface;
> >> global ulb.mfe.srabre.ra.DROOLSSLEEAgent
> DROOLSSLEEAgent;
> >>
> >> rule "MaxBtsAlarmrule"
> >> dialect "mvel"
> >>
> >> when
> >>
> >> $B : BREINTERFACE()
> >> then
> >> System.out.println(" HELLO
> ");
> >> end
> >>
> >>
> >>
> >>
> >> my code
> >>
> >>
> >> public void Insert(Object fact) {
> >> try{
> KnowledgeSessionConfiguration
> >> sessConfig =
> KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
> >>
> sessConfig.setOption(ClockTypeOption.get("pseudo"));
> >>
> StatefulKnowledgeSession
> >> session =
> knowledgeBase.newStatefulKnowledgeSession();
> >>
> session.setGlobal("BRERAInterface", this.breinter);
> >>
> session.setGlobal("DROOLSSLEEAgent", this.droolssleeAgent);
> >>
> session.insert(this.breinter);
> >>
> System.out.println("Fact is now
> >> inserted");
> >>
> session.fireAllRules();
> >> } catch (Throwable t) {
> >>
> logger.info("sml couldn't set
> >> up a session");
> >>
> t.printStackTrace();
> >> }
> >> }
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >>
> >
> >
> > Thank you for your
> response,my application is deployed in Mobicents slee AS, I
> think it uses multiple classloaders .how can I fix that
> please
> >
>
>
More information about the rules-users
mailing list