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
15 years, 5 months
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
15 years, 5 months
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();
}
}
15 years, 5 months
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.
15 years, 5 months
Failed to look up JNDI DataSource with name 'jdbc/testDS1'
by Julie Wilson
Hey there,
I am very much a newbie to Drools, and I have been following the sample
Application setup in the Drools Jboss Rules 5.0 developers guide.
However, I am having some very very annoying problems with my
persistence setup. My application is giving the following error, and
then appears to use a default database jdbc:h2:mem:mydb,
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'entityManagerFactory' defined in class path resource
[applicationContext.xml]: Invocation of init method failed; nested
exception is
org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureExcept
ion: Failed to look up JNDI DataSource with name 'jdbc/testDS1'; nested
exception is javax.naming.NameNotFoundException: Name jdbc is not bound
in this Context
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjec
t(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g
etSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(
AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab
stractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.pre
InstantiateSingletons(DefaultListableBeanFactory.java:423)
at
org.springframework.context.support.AbstractApplicationContext.finishBea
nFactoryInitialization(AbstractApplicationContext.java:728)
at
org.springframework.context.support.AbstractApplicationContext.refresh(A
bstractApplicationContext.java:380)
at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationCon
text(FrameworkServlet.java:402)
at
org.springframework.web.servlet.FrameworkServlet.initWebApplicationConte
xt(FrameworkServlet.java:316)
at
org.springframework.web.servlet.FrameworkServlet.initServletBean(Framewo
rkServlet.java:282)
at
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.jav
a:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav
a:1173)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j
ava:4187)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4496
)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:519)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by:
org.springframework.jdbc.datasource.lookup.DataSourceLookupFailureExcept
ion: Failed to look up JNDI DataSource with name 'jdbc/testDS1'; nested
exception is javax.naming.NameNotFoundException: Name jdbc is not bound
in this Context
at
org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup.getDataS
ource(JndiDataSourceLookup.java:47)
at
org.springframework.orm.jpa.persistenceunit.PersistenceUnitReader.parseP
ersistenceUnitInfo(PersistenceUnitReader.java:281)
at
org.springframework.orm.jpa.persistenceunit.PersistenceUnitReader.parseD
ocument(PersistenceUnitReader.java:215)
at
org.springframework.orm.jpa.persistenceunit.PersistenceUnitReader.readPe
rsistenceUnitInfos(PersistenceUnitReader.java:139)
at
org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManage
r.readPersistenceUnitInfos(DefaultPersistenceUnitManager.java:303)
at
org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManage
r.preparePersistenceUnitInfos(DefaultPersistenceUnitManager.java:275)
at
org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManage
r.afterPropertiesSet(DefaultPersistenceUnitManager.java:260)
at
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.creat
eNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:
192)
at
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterProper
tiesSet(AbstractEntityManagerFactoryBean.java:291)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac
tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 34 more
Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in
this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at
org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:15
5)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
at
org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.ja
va:104)
at
org.springframework.jdbc.datasource.lookup.JndiDataSourceLookup.getDataS
ource(JndiDataSourceLookup.java:44)
... 44 more
I have searched every forum I can find online to see if I can find the
solution to this proble, but so far I have not had any joy. The setup I
have following the book to the finest detail, and my transaction manager
has been set up using the
http://docs.codehaus.org/display/BTM/Tomcat13 site. Please can
somebody advise me on where I could be going wrong? Is there something
in the book that I am missing? I have put the h2-1.0.77.jar in both my
classpath and in the lib directory of Tomcat6.
Thanks in advance,
Julie
Julie Wilson
Java Developer
Technology
Direct dial: +44 (0) 1442 829879
Email: Julie.Wilson(a)grg.com
www.grassroots.uk.com <http://www.grassroots.uk.com/>
Grass Roots
Logo<http://www.grassroots.uk.com/bdr-emp2/gruk/img/logo-gr-inspiring.jp
g>
________________________________
Grass Roots * * Belfast * * Switchboard +44 (0) 1442 829400
________________________________
Grass Roots is proud to feature in the 2007, 2008, 2009 and 2010 lists
of Sunday Times best 100 companies to work for in the UK.
Registered Name: The Grass Roots Group UK Limited Place of
Incorporation: England & Wales Registered No.: 4155659
Registered Office: Pennyroyal Court, Station Road, Tring, Herts. HP23
5QY
Please consider the environment - do you really need to print this
email?
This e-mail message including any attachment(s) is intended for the addressee only and may be confidential. If you are not the intended
addressee, we request that you notify us immediately and delete this e-mail including any attachment(s), without copying, forwarding,
disclosing or using this (these) in any other way.
15 years, 5 months
Drools.pom file missing in maven repo?
by Savga, Ilie
Hi,
while trying to build the drools-examples project (its last version, currently available for download) using the corresponding pom file I got a FileNotFindException. The cause was that the file
http://repo1.maven.org/maven2/org/drools/drools/5.0.1/drools-5.0.1.pom
was not in the maven repository anymore. In fact, the whole drools directory is not present there. Was it moved somewhere else or deleted altogether? If the latter, what would be the best (easiest) way to proceed in order to get the project built?
Thanks a lot in advance!
Best regards,
Ilie
15 years, 5 months
Getting fix for JBRULES-2375
by Norman C
Hi All,
I'm working with Drools Fusion and have run into the deadlock issue in
https://jira.jboss.org/browse/JBRULES-2375 (Drools hangs when events are
retracted). This bug indicates it is fixed in 5.1.0.CR1. How can I get this
fix, or alternatively, where in the SVN repository can I look at the code fix so
I can create a custom version of 5.0.1 with this fix?
Thanks in advance for your help.
Norman
15 years, 5 months