Re: [rules-users] Problem Setting globals in drools session
by Greg Barton
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(a)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(a)gmail.com> wrote:
> From: djerir smail <1983djerir(a)gmail.com>
> Subject: Re: [rules-users] Problem Setting globals in drools session
> To: "Greg Barton" <greg_barton(a)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(a)gmail.com>
> wrote:
> >
> >
> >> From: djerir smail <1983djerir(a)gmail.com>
> >> Subject: [rules-users] Problem Setting globals in
> drools session
> >> To: "Rules Users List" <rules-users(a)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(a)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
> >
>
>
16 years
Re: [rules-users] rules-users Digest, Vol 44, Issue 15
by Greg Barton
I think isolating it in a test case is the best way. Like Edson said, this is a simple use case, proven trouble free many times over by many drools users. Isolating the test case will either show you where the funky behavior is happening on your side, or provide a comprehensible regression test for the drools devs to use.
GreG
On Jul 6, 2010, at 12:34 PM, "Axelrod, Nelson" <naxelrod(a)jcvi.org> wrote:
Hi Greg,
I've tried to adjust/increase the JVMP heap memory but that does not
help solve this problem. I've set the VM option
-XX:+HeapDumpOnOutOfMemoryError. No heap dump files are generated, so I
assume that is not the problem either.
I can isolate this problem within a test case and add a bug report to
Drools JIRA. Any other ideas as to how else this could occur, or how to
troubleshoot this further? It is really disconcerting.
Thanks,
Nelson
------------------------------
Message: 3
Date: Tue, 6 Jul 2010 09:05:16 -0700 (PDT)
From: Greg Barton <greg_barton(a)yahoo.com>
Subject: Re: [rules-users] How is this possible?
To: Rules Users List <rules-users(a)lists.jboss.org>
Cc: "Richter, Alexander" <ARichter(a)jcvi.org>,
"<rules-users(a)lists.jboss.org>" <rules-users(a)lists.jboss.org>
Message-ID: <376326.67572.qm(a)web81506.mail.mud.yahoo.com>
Content-Type: text/plain; charset="utf-8"
Does the amount of heap allocated affect it? I'm wondering if there's a
hidden OutOfMemoryError happening. (Which, if you're catching Throwable
anywhere, is a possibility. Use the HeapDumpOnOutOfMemoryError VM flag
to diagnose this.) And this should be easy to reproduce in your unit
tests: just insert many unrelated objects into working memory during
the test. In fact you could construct tests thst show the same code
succeeding without the excess objects then failing with them. That
would be essential if you think this is a core drools problem and want
it fixed.
GreG
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
16 years
Re: [rules-users] rules-users Digest, Vol 44, Issue 15
by Axelrod, Nelson
Hi Greg,
I've tried to adjust/increase the JVMP heap memory but that does not
help solve this problem. I've set the VM option
-XX:+HeapDumpOnOutOfMemoryError. No heap dump files are generated, so I
assume that is not the problem either.
I can isolate this problem within a test case and add a bug report to
Drools JIRA. Any other ideas as to how else this could occur, or how to
troubleshoot this further? It is really disconcerting.
Thanks,
Nelson
------------------------------
Message: 3
Date: Tue, 6 Jul 2010 09:05:16 -0700 (PDT)
From: Greg Barton <greg_barton(a)yahoo.com>
Subject: Re: [rules-users] How is this possible?
To: Rules Users List <rules-users(a)lists.jboss.org>
Cc: "Richter, Alexander" <ARichter(a)jcvi.org>,
"<rules-users(a)lists.jboss.org>" <rules-users(a)lists.jboss.org>
Message-ID: <376326.67572.qm(a)web81506.mail.mud.yahoo.com>
Content-Type: text/plain; charset="utf-8"
Does the amount of heap allocated affect it? I'm wondering if there's a
hidden OutOfMemoryError happening. (Which, if you're catching Throwable
anywhere, is a possibility. Use the HeapDumpOnOutOfMemoryError VM flag
to diagnose this.) And this should be easy to reproduce in your unit
tests: just insert many unrelated objects into working memory during
the test. In fact you could construct tests thst show the same code
succeeding without the excess objects then failing with them. That
would be essential if you think this is a core drools problem and want
it fixed.
GreG
16 years
How is this possible?
by Axelrod, Nelson
Hi,
We're having some troubling problems that can be best explained by the
following two rules. Based on the facts inserted into the stateful
knowledge session, we expected both rules to fire for an Hmm Hit to
TIGR00549, but only the "Test" rule fires. Can anyone explain how this
could possibly occur? There are no other rules added to the knowledge
base. This was tested using Drools 5.0 on Windows XP and Linux
environments.
rule "HMM Hit"
when
hit : HmmHit( aboveTrustedHit == true )
p : FeatureProperty( id == hit.hitId )
f : Feature ( featureId == hit.queryId, properties not
contains p )
then
if (hit.getHitId().equals("TIGR00549")) {
System.err.println("HMM Hit rule: " + hit.getHitId() +
" " + hit.getQueryId());
}
end
rule "Test"
when
hit : HmmHit( aboveTrustedHit == true, hitId == "TIGR00549")
p : FeatureProperty( id == hit.hitId )
f : Feature ( featureId == hit.queryId, properties not
contains p )
then
System.err.println("Test rule: " + hit.getHitId() + " " +
hit.getQueryId());
end
Notably, this error is dependent on the amount and/or order of facts
loaded into the knowledge session although we're talking < 20k facts
total. We have repeatedly found problems when running system-level
tests of our production rules that do not appear when we run our unit
tests, with issues such as this one that only show up after loading some
number of facts that are unrelated to the particular fact in question.
It's difficult to debug because we can see that fact handles that
satisfy the when conditions are in the knowledge session (i.e. the same
facts that fulfill the Test rule), but we do not have any obvious way to
debug why the expected HMM Hit rule does not fire.
Nelson
16 years
Re: [rules-users] How is this possible?
by Greg Barton
Does the amount of heap allocated affect it? I'm wondering if there's a hidden OutOfMemoryError happening. (Which, if you're catching Throwable anywhere, is a possibility. Use the HeapDumpOnOutOfMemoryError VM flag to diagnose this.) And this should be easy to reproduce in your unit tests: just insert many unrelated objects into working memory during the test. In fact you could construct tests thst show the same code succeeding without the excess objects then failing with them. That would be essential if you think this is a core drools problem and want it fixed.
GreG
On Jul 6, 2010, at 10:28 AM, "Axelrod, Nelson" <naxelrod(a)jcvi.org> wrote:
Hi,
We’re having some troubling problems that can be best explained by the following two rules. Based on the facts inserted into the stateful knowledge session, we expected both rules to fire for an Hmm Hit to TIGR00549, but only the “Test” rule fires. Can anyone explain how this could possibly occur? There are no other rules added to the knowledge base. This was tested using Drools 5.0 on Windows XP and Linux environments.
rule "HMM Hit"
when
hit : HmmHit( aboveTrustedHit == true )
p : FeatureProperty( id == hit.hitId )
f : Feature ( featureId == hit.queryId, properties not contains p )
then
if (hit.getHitId().equals("TIGR00549")) {
System.err.println("HMM Hit rule: " + hit.getHitId() + " " + hit.getQueryId());
}
end
rule "Test"
when
hit : HmmHit( aboveTrustedHit == true, hitId == "TIGR00549")
p : FeatureProperty( id == hit.hitId )
f : Feature ( featureId == hit.queryId, properties not contains p )
then
System.err.println("Test rule: " + hit.getHitId() + " " + hit.getQueryId());
end
Notably, this error is dependent on the amount and/or order of facts loaded into the knowledge session although we’re talking < 20k facts total. We have repeatedly found problems when running system-level tests of our production rules that do not appear when we run our unit tests, with issues such as this one that only show up after loading some number of facts that are unrelated to the particular fact in question. It’s difficult to debug because we can see that fact handles that satisfy the when conditions are in the knowledge session (i.e. the same facts that fulfill the Test rule), but we do not have any obvious way to debug why the expected HMM Hit rule does not fire.
Nelson
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
16 years
Re: [rules-users] Problem Setting globals in drools session
by Greg Barton
Having it twice in the classpath would make no diffence (at least with the default java classloader) as only the first one in the path is used. Having multiple copies of a class in the classpath is generally not a good idea because it leads to confusion, but it would not cause this behavior. (multiple classloaders would, though)
GreG
On Jul 6, 2010, at 2:33 AM, "PAYET, Manuel" <manuel.payet(a)capgemini.com> wrote:
Looks like you have twice in your classpath the class ulb.mfe.srabre.ra.BREINTERFACE :)
If I were you, I'd check that...
-----Message d'origine-----
De : rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] De la part de djerir smail
Envoyé : lundi 5 juillet 2010 21:39
À : Rules Users List
Objet : [rules-users] Problem Setting globals in drools session
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(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message
in error, please notify the sender immediately and delete all copies of this message.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
16 years
Problem Setting globals in drools session
by djerir smail
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();
}
}
16 years
Configure Guvnor to use MySQL
by james corrigan
Hi All,
I am trying to configure Guvnor to use MySQL instead of the Derby DB Guvnor
comes with, i have searched google but there are no clear solutions can
anyone help me do this? Thank you.
Kind Regards,
James.
16 years