Drools Fusion in JEE environment
by IK81
Hi all,
i am planning to use the Drools engine in the stream mode within an JEE
application server. I have to process events of different users which can
define their own rules. So I plan to instantiate a stateful session for each
user and populate them with the user's rules. However, I am concerned how to
manage the firing of the rules - which might be delayed by some time because
of some rule statements (fire rule after having event A and no event B
within 3 minutes). Spawning a thread for each session and calling
fireUntilHalt is not an option in my opinion.
I've found a solution where somebody uses a scheduler within the container
to call fireAllRules at certain domain-specific intervals (e.g., every 10
seconds). I am wondering if there is a more clever approach. I am thinking
of providing a callback that can be used by Drools to notify when it has to
be "waked-up" again to fire the delayed rule.
Best regards,
Ingo
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Fusion-in-JEE-environment-tp4025...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
Iterating string objects inside Arraylist
by Ganesh R.
I am a novice in Drools, sorry if this question is trivial and has already been discussed. I couldn't find the direct method for implementing the below behavior.
I have a class like this.
public class Account {
public int balance;
public String id;
public List<String> types;
// getter setters
}
I am trying to check the following:
Accounts having balance greater than $100 and types containing both Savings and Checking.
// Creating sample Facts in Java main
Account account = new Account();
account.setBalance(100);
account.setId("A1");
List<String> temp = new ArrayList<String>();
temp.add("Savings");
temp.add("Checking");
account.setTypes(temp);
// Creating rules
rule "Sample"
when
bat : Account(balance == 100)
then
if (bat.getTypes().contains("Savings") && bat.getTypes().contains("Checking")){
System.out.println("I got this");
}
end
Is there more proficient ways to do this?? like checking the contents of the arraylist (types as per the above example) in rule i.e. in "when" instead of doing it in "then" ??
Much appreciate your answers.
Thank you!
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are not
to copy, disclose, or distribute this e-mail or its contents to any other person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
every reasonable precaution to minimize this risk, but is not liable for any damage
you may sustain as a result of any virus in this e-mail. You should carry out your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
12 years, 7 months
VRP with multi-stream and heterogeneous fleet?
by Colin Sheppard
Hello all, I'm totally new to optaplanner / drools and would like to know
if the following is possible within the framework (I'd mostly likely use
version 6).
I have a VRP where we'd like to consider multiple waste streams
simultaneously (i.e. trash, recycling, food waste, and yard waste). We'd
also like to consider a fleet of split bin trucks (capable of collecting 2
streams at a time but with reduced capacity), single bin trucks, or a
mixture of split and single bin.
So the model would need to allow for a mixture of vehicle types, for nodes
to be visited more than once, and for simultaneous collection to occur in
the case of split bin trucks.
Does this sound like a feasible problem to implement? Would you anticipate
any major or intractable challenges?
Thanks for your advice, I hope I get the chance to start using optaplanner!
Colin Sheppard
--
Colin Sheppard
Research Engineer,
Schatz Energy Research Center
colin(a)humboldt.edu
707.633.8633
12 years, 7 months
Internet Explorer Compatibility
by rjr201
Hi,
I'm working for a client who wishes to use Guvnor with Internet Explorer.
I've tried Guvnor 5.5.0.Final with IE8 and IE9. However, I get an error when
trying to access a rule in the guided editor.
I read in another post
(http://drools.46999.n3.nabble.com/guvnor-5-5-problems-on-Internet-Explore...)
that there are problems with 5.5.0 in IE, that may have been fixed in the
current 5.5.x branch.
I have built the latest code on the branch, but seem to have even more
problems (it doesn't even let me get to the initial Guvnor landing page).
Does anyone have any experience/insight in getting Guvnor working in IE? Or
at least know what version of Guvnor does work in IE? Or just any advice on
this issue at all I would be grateful..
Thanks in advance,
Rich.
--
View this message in context: http://drools.46999.n3.nabble.com/Internet-Explorer-Compatibility-tp40249...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
Re: [rules-users] rules-users Digest, Vol 80, Issue 34
by pritha.ghosh@wipro.com
I have only one rule employeemaprule
________________________________________
From: rules-users-bounces(a)lists.jboss.org [rules-users-bounces(a)lists.jboss.org] on behalf of rules-users-request(a)lists.jboss.org [rules-users-request(a)lists.jboss.org]
Sent: Wednesday, July 17, 2013 8:13 PM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 80, Issue 34
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. Re: help on drools guvnor (rjr201)
2. Re: DRL always posting the format as txt instead of model.drl
(learnbrms)
3. Re: rules-users Digest, Vol 80, Issue 33 - help on drools
guvnor (pritha.ghosh(a)wipro.com)
4. Re: rules-users Digest, Vol 80, Issue 33 - help on drools
guvnor (rjr201)
5. Re: Problems with the Mrs Manners Benchmark (Mark Proctor)
----------------------------------------------------------------------
Message: 1
Date: Wed, 17 Jul 2013 06:28:45 -0700 (PDT)
From: rjr201 <rich.j.riley(a)gmail.com>
Subject: Re: [rules-users] help on drools guvnor
To: rules-users(a)lists.jboss.org
Message-ID: <1374067725846-4024977.post(a)n3.nabble.com>
Content-Type: text/plain; charset=us-ascii
What are your rules?
--
View this message in context: http://drools.46999.n3.nabble.com/rules-users-help-on-drools-guvnor-tp402...
Sent from the Drools: User forum mailing list archive at Nabble.com.
------------------------------
Message: 2
Date: Wed, 17 Jul 2013 06:32:18 -0700 (PDT)
From: learnbrms <srivats.rayaprolu(a)gmail.com>
Subject: Re: [rules-users] DRL always posting the format as txt
instead of model.drl
To: rules-users(a)lists.jboss.org
Message-ID: <1374067938811-4024978.post(a)n3.nabble.com>
Content-Type: text/plain; charset=us-ascii
Can anyone please advise to my above problem ?
Thanks,
Sri
--
View this message in context: http://drools.46999.n3.nabble.com/DRL-always-posting-the-format-as-txt-in...
Sent from the Drools: User forum mailing list archive at Nabble.com.
------------------------------
Message: 3
Date: Wed, 17 Jul 2013 13:34:10 +0000
From: <pritha.ghosh(a)wipro.com>
Subject: Re: [rules-users] rules-users Digest, Vol 80, Issue 33 - help
on drools guvnor
To: <rules-users(a)lists.jboss.org>
Message-ID:
<6374181C9192E7459C135FEE70E5E16509F1E31F(a)CHN-SNR-MBX-8.wipro.com>
Content-Type: text/plain; charset="us-ascii"
The same code runs fine with
urlResource = (org.drools.io.impl.UrlResource) org.drools.io.ResourceFactory
.newUrlResource(new java.net.URL("http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/OBSP..."));
And resourse type "DRL"
Please find below the source code of the rule
rule "EmployeeMapRule"
no-loop true
enabled true
dialect "mvel"
when
EmployeeMap : EmployeeMap( employeeID : EmployeeID != null , employeeName : EmployeeName != null , employeeCountry : EmployeeCountry in ( "INDIA", "Australia", "USA" ) )
then
EmployeeMap.setEmployeeName( employeeName+" Success" );
EmployeeMap.setEmployeeCountry( employeeCountry );
EmployeeMap.setEmployeeID( employeeID );
update( EmployeeMap );
end
I have written the rule in guvnor.
Drools version 5.5
Please find below the source code for my model employeemap
declare EmployeeMap
EmployeeName: String
EmployeeCountry: String
EmployeeID: Integer
end
I have attached the pojo class I am using to fire the rule
Thanks,
Pritha
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of rules-users-request(a)lists.jboss.org
Sent: Wednesday, July 17, 2013 6:50 PM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 80, Issue 33
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of rules-users digest..."
Today's Topics:
1. Re: help on drools guvnor (Stephen Masters)
----------------------------------------------------------------------
Message: 1
Date: Wed, 17 Jul 2013 14:19:21 +0100
From: Stephen Masters <stephen.masters(a)me.com>
Subject: Re: [rules-users] help on drools guvnor
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID: <93FD4B72-09E1-4AEB-8ACD-CFC3B4BD36A9(a)me.com>
Content-Type: text/plain; charset="us-ascii"
Have you tested that the rules fire when you load them as DRL?
It would probably be worth showing us what EmployeeMap looks like and the rule which you expect to fire if there is an EmployeeMap in working memory.
The Drools version would also be useful.
Steve
On 17 Jul 2013, at 14:04, pritha.ghosh(a)wipro.com wrote:
> Hi,
>
> I am not able to run rules from .pkg resources.
>
> Knowledgesession is getting populated with package and rules inside the packages but when I am firing ksession.fireAllRules(); no rules are getting executed.
>
> Below is my program
>
> final KnowledgeBuilder kbuilder =
> KnowledgeBuilderFactory.newKnowledgeBuilder();
>
> // Use this line if calling rule defined using guvnor package
> org.drools.io.impl.UrlResource urlResource;
> try {
> urlResource = (org.drools.io.impl.UrlResource) org.drools.io.ResourceFactory
> .newUrlResource(new
> java.net.URL("http://localhost:8080/drools-guvnor/org.drools.guvnor.Gu
> vnor/package/OBSPOC/OBSSNAP/OBSPOC_OBSSNAP.pkg"));
>
>
> urlResource.setBasicAuthentication("enabled");
> urlResource.setUsername("admin");
> urlResource.setPassword("admin");
> kbuilder.add(urlResource,ResourceType.PKG);
> }
> catch (MalformedURLException e) {
> System.out.println("malformed URL");
> e.printStackTrace();
> }
> catch (Exception e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> // create the knowledge base
> KnowledgeBase kbase =
> KnowledgeBaseFactory.newKnowledgeBase();
>
>
>
>
> // Check the builder for errors
> if (kbuilder.hasErrors()) {
> System.out.println(kbuilder.getErrors().toString() + "********");
> throw new RuntimeException("Unable to compile the rule file.");
> }else{
> System.out.println(".....Rule File is Read Successfully....");
> }
>
> // get the compiled packages (which are serializable)
> final Collection pkgs = kbuilder
> .getKnowledgePackages();
>
> // add the packages to a knowledgebase (deploy the knowledge packages).
> // final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
> kbase.addKnowledgePackages(pkgs);
>
>
> final StatefulKnowledgeSession ksession = kbase
>
> .newStatefulKnowledgeSession();
>
> ksession.addEventListener(new DebugAgendaEventListener());
> ksession.addEventListener(new
> DebugWorkingMemoryEventListener());
>
> EmployeeMap employeeMap = new EmployeeMap();
> employeeMap.setEmployeeCountry("INDIA");
> employeeMap.setEmployeeID(1);
> employeeMap.setEmployeeName("USERP");
>
> ksession.insert(employeeMap);
> ksession.fireAllRules();
>
>
> ksession.dispose();
>
>
> Thanks,
> Pritha
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
>
> www.wipro.com
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
12 years, 7 months
Problems with the Mrs Manners Benchmark
by Sven Böcherer
Hello,
I am writing my dissertation on BRMS. I want to analyze the performance of
different systems. Drools is one of them.
I installed Drools 6 and wanted to start the Mrs Manners Benchmark for a
first analysis.
Unfortunately if I chose anything else but 5 guests, I get an infinite loop
where the program is never able to find the seating arrangement.
Attached you find a screenshot of what the console looks like.
I really hope you can help me with this problem.
Best regards,
Sven Böcherer
Sven Böcherer
Bachelorthesis
EXXETA AG
Albert-Nestler-Str. 11
76131 Karlsruhe
fon +49 721 6105-1500
fax +49 721 6105-1599
mail <mailto:Sven.Boecherer@EXXETA.com> Sven.Boecherer(a)EXXETA.com
web <http://www.exxeta.de/> www.EXXETA.com
Sitz der Gesellschaft:
EXXETA AG
Albert-Nestler-Str. 11, 76131 Karlsruhe
Vorstände: Achim Kirchgässner, Andreas Ritter
Aufsichtsratsvorsitzender: Ulrich A. Götz
Ust-IdNr. DE813026499
Eingetragen beim Amtsgericht Mannheim HRB 702566
Diese E-Mail enthaelt vertrauliche oder rechtlich geschuetzte
Informationen. Wenn Sie nicht der beabsichtigte Empfaenger sind,
informieren Sie bitte sofort den Absender und loeschen Sie diese E-Mail.
Das unbefugte Kopieren dieser E-Mail oder die unbefugte Weitergabe der
enthaltenen Informationen ist nicht gestattet.
The information contained in this message is confidential or protected by
law.
If you are not the intended recipient, please contact the sender and
delete this message. Any unauthorized copying of this message or
unauthorized distribution of the information contained herein is prohibited.
12 years, 7 months
Re: [rules-users] rules-users Digest, Vol 80, Issue 33 - help on drools guvnor
by pritha.ghosh@wipro.com
The same code runs fine with
urlResource = (org.drools.io.impl.UrlResource) org.drools.io.ResourceFactory
.newUrlResource(new java.net.URL("http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/OBSP..."));
And resourse type "DRL"
Please find below the source code of the rule
rule "EmployeeMapRule"
no-loop true
enabled true
dialect "mvel"
when
EmployeeMap : EmployeeMap( employeeID : EmployeeID != null , employeeName : EmployeeName != null , employeeCountry : EmployeeCountry in ( "INDIA", "Australia", "USA" ) )
then
EmployeeMap.setEmployeeName( employeeName+" Success" );
EmployeeMap.setEmployeeCountry( employeeCountry );
EmployeeMap.setEmployeeID( employeeID );
update( EmployeeMap );
end
I have written the rule in guvnor.
Drools version 5.5
Please find below the source code for my model employeemap
declare EmployeeMap
EmployeeName: String
EmployeeCountry: String
EmployeeID: Integer
end
I have attached the pojo class I am using to fire the rule
Thanks,
Pritha
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of rules-users-request(a)lists.jboss.org
Sent: Wednesday, July 17, 2013 6:50 PM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 80, Issue 33
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of rules-users digest..."
Today's Topics:
1. Re: help on drools guvnor (Stephen Masters)
----------------------------------------------------------------------
Message: 1
Date: Wed, 17 Jul 2013 14:19:21 +0100
From: Stephen Masters <stephen.masters(a)me.com>
Subject: Re: [rules-users] help on drools guvnor
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID: <93FD4B72-09E1-4AEB-8ACD-CFC3B4BD36A9(a)me.com>
Content-Type: text/plain; charset="us-ascii"
Have you tested that the rules fire when you load them as DRL?
It would probably be worth showing us what EmployeeMap looks like and the rule which you expect to fire if there is an EmployeeMap in working memory.
The Drools version would also be useful.
Steve
On 17 Jul 2013, at 14:04, pritha.ghosh(a)wipro.com wrote:
> Hi,
>
> I am not able to run rules from .pkg resources.
>
> Knowledgesession is getting populated with package and rules inside the packages but when I am firing ksession.fireAllRules(); no rules are getting executed.
>
> Below is my program
>
> final KnowledgeBuilder kbuilder =
> KnowledgeBuilderFactory.newKnowledgeBuilder();
>
> // Use this line if calling rule defined using guvnor package
> org.drools.io.impl.UrlResource urlResource;
> try {
> urlResource = (org.drools.io.impl.UrlResource) org.drools.io.ResourceFactory
> .newUrlResource(new
> java.net.URL("http://localhost:8080/drools-guvnor/org.drools.guvnor.Gu
> vnor/package/OBSPOC/OBSSNAP/OBSPOC_OBSSNAP.pkg"));
>
>
> urlResource.setBasicAuthentication("enabled");
> urlResource.setUsername("admin");
> urlResource.setPassword("admin");
> kbuilder.add(urlResource,ResourceType.PKG);
> }
> catch (MalformedURLException e) {
> System.out.println("malformed URL");
> e.printStackTrace();
> }
> catch (Exception e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> // create the knowledge base
> KnowledgeBase kbase =
> KnowledgeBaseFactory.newKnowledgeBase();
>
>
>
>
> // Check the builder for errors
> if (kbuilder.hasErrors()) {
> System.out.println(kbuilder.getErrors().toString() + "********");
> throw new RuntimeException("Unable to compile the rule file.");
> }else{
> System.out.println(".....Rule File is Read Successfully....");
> }
>
> // get the compiled packages (which are serializable)
> final Collection pkgs = kbuilder
> .getKnowledgePackages();
>
> // add the packages to a knowledgebase (deploy the knowledge packages).
> // final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
> kbase.addKnowledgePackages(pkgs);
>
>
> final StatefulKnowledgeSession ksession = kbase
>
> .newStatefulKnowledgeSession();
>
> ksession.addEventListener(new DebugAgendaEventListener());
> ksession.addEventListener(new
> DebugWorkingMemoryEventListener());
>
> EmployeeMap employeeMap = new EmployeeMap();
> employeeMap.setEmployeeCountry("INDIA");
> employeeMap.setEmployeeID(1);
> employeeMap.setEmployeeName("USERP");
>
> ksession.insert(employeeMap);
> ksession.fireAllRules();
>
>
> ksession.dispose();
>
>
> Thanks,
> Pritha
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
>
> www.wipro.com
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)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/20130717/6d327e7...
------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
End of rules-users Digest, Vol 80, Issue 33
*******************************************
Please do not print this email unless it is absolutely necessary.
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
12 years, 7 months
help on drools guvnor
by pritha.ghosh@wipro.com
Hi,
I am not able to run rules from .pkg resources.
Knowledgesession is getting populated with package and rules inside the packages but when I am firing ksession.fireAllRules(); no rules are getting executed.
Below is my program
final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
// Use this line if calling rule defined using guvnor package
org.drools.io.impl.UrlResource urlResource;
try {
urlResource = (org.drools.io.impl.UrlResource) org.drools.io.ResourceFactory
.newUrlResource(new java.net.URL("http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/OBSP..."));
urlResource.setBasicAuthentication("enabled");
urlResource.setUsername("admin");
urlResource.setPassword("admin");
kbuilder.add(urlResource,ResourceType.PKG);
}
catch (MalformedURLException e) {
System.out.println("malformed URL");
e.printStackTrace();
}
catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// create the knowledge base
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
// Check the builder for errors
if (kbuilder.hasErrors()) {
System.out.println(kbuilder.getErrors().toString() + "********");
throw new RuntimeException("Unable to compile the rule file.");
}else{
System.out.println(".....Rule File is Read Successfully....");
}
// get the compiled packages (which are serializable)
final Collection pkgs = kbuilder
.getKnowledgePackages();
// add the packages to a knowledgebase (deploy the knowledge packages).
// final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(pkgs);
final StatefulKnowledgeSession ksession = kbase
.newStatefulKnowledgeSession();
ksession.addEventListener(new DebugAgendaEventListener());
ksession.addEventListener(new DebugWorkingMemoryEventListener());
EmployeeMap employeeMap = new EmployeeMap();
employeeMap.setEmployeeCountry("INDIA");
employeeMap.setEmployeeID(1);
employeeMap.setEmployeeName("USERP");
ksession.insert(employeeMap);
ksession.fireAllRules();
ksession.dispose();
Thanks,
Pritha
Please do not print this email unless it is absolutely necessary.
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
12 years, 7 months
Deploying Guvnor 5.5.1 in JBoss 7.1.1.Final
by rjr201
Hi,
I've just checked out and successfully compiled:
https://github.com/droolsjbpm/guvnor/tree/5.5.x
I've tried to deploy this in jboss-as-7.1.1.Final but got the following
error:
16:48:14,132 ERROR [org.apache.catalina.core.StandardContext] (MSC service
thread 1-4) Context [/guvnor-webapp-drools-5.5.1-SNAPSHOT] startup failed
due to previous errors: java.lang.IllegalArgumentException: Duplicate
context initialization parameter resteasy.injector.factory
at
org.apache.catalina.core.StandardContext.addParameter(StandardContext.java:2186)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.as.web.deployment.JBossContextConfig.processWebMetaData(JBossContextConfig.java:261)
[jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.as.web.deployment.JBossContextConfig.applicationWebConfig(JBossContextConfig.java:169)
[jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:417)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:182)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.as.web.deployment.JBossContextConfig.lifecycleEvent(JBossContextConfig.java:162)
[jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3790)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)
[jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[rt.jar:1.7.0_13]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[rt.jar:1.7.0_13]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]
16:48:14,142 ERROR [org.apache.catalina.core.StandardContext] (MSC service
thread 1-4) Context [/guvnor-webapp-drools-5.5.1-SNAPSHOT] startup failed
due to previous errors
16:48:14,149 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4)
MSC00001: Failed to start service
jboss.web.deployment.default-host."/guvnor-webapp-drools-5.5.1-SNAPSHOT":
org.jboss.msc.service.StartException in service
jboss.web.deployment.default-host."/guvnor-webapp-drools-5.5.1-SNAPSHOT":
JBAS018040: Failed to start context
at
org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[rt.jar:1.7.0_13]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[rt.jar:1.7.0_13]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]
16:48:14,157 INFO [org.jboss.as] (MSC service thread 1-4) JBAS015951: Admin
console listening on http://127.0.0.1:9990
16:48:14,158 ERROR [org.jboss.as] (MSC service thread 1-4) JBAS015875: JBoss
AS 7.1.1.Final "Brontes" started (with errors) in 13913ms - Started 295 of
374 services (2 services failed or missing dependencies, 76 services are
passive or on-demand)
16:48:14,358 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2)
JBAS015870: Deploy of deployment "guvnor-webapp-drools-5.5.1-SNAPSHOT.war"
was rolled back with failure message {"JBAS014671: Failed services" =>
{"jboss.web.deployment.default-host.\"/guvnor-webapp-drools-5.5.1-SNAPSHOT\""
=> "org.jboss.msc.service.StartException in service
jboss.web.deployment.default-host.\"/guvnor-webapp-drools-5.5.1-SNAPSHOT\":
JBAS018040: Failed to start context"}}
16:48:14,384 INFO [org.jboss.weld.deployer] (MSC service thread 1-3)
JBAS016009: Stopping weld service for deployment
guvnor-webapp-drools-5.5.1-SNAPSHOT.war
16:48:17,110 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1)
JBAS015877: Stopped deployment guvnor-webapp-drools-5.5.1-SNAPSHOT.war in
2745ms
16:48:17,111 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2)
JBAS014774: Service status report
JBAS014777: Services which failed to start: service
jboss.web.deployment.default-host."/guvnor-webapp-drools-5.5.1-SNAPSHOT":
org.jboss.msc.service.StartException in service
jboss.web.deployment.default-host."/guvnor-webapp-drools-5.5.1-SNAPSHOT":
JBAS018040: Failed to start context
16:48:17,113 ERROR [org.jboss.as.server.deployment.scanner]
(DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and
was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671:
Failed services" =>
{"jboss.web.deployment.default-host.\"/guvnor-webapp-drools-5.5.1-SNAPSHOT\""
=> "org.jboss.msc.service.StartException in service
jboss.web.deployment.default-host.\"/guvnor-webapp-drools-5.5.1-SNAPSHOT\":
JBAS018040: Failed to start context"}}}}
Am I doing something wrong? Or has anyone else come across this error?
Any help with this would be gratefully appreciated.
Thanks,
Rich.
--
View this message in context: http://drools.46999.n3.nabble.com/Deploying-Guvnor-5-5-1-in-JBoss-7-1-1-F...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
Getting infinite loops even with limitation of fires
by Bojan Janisch
Hello everyone,
Recently I'm using Drools in a multithreaded environment. But after a while I see that Drools is running for endless time even though I gave him with fireAllRules(1000) a limitation to fire only 1000 rules. The occurrence is rule-independent, I've checked multiple times and each time it's another rule which works well if I run it separately.
Could someone check the code of this stack trace? That's a thread dump of my last run.
"ECJ Evaluation Thread 9" daemon prio=10 tid=0x00002b08a4fd9000 nid=0x2f90 runnable [0x00002b08a9a82000]
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.getEntry(HashMap.java:347)
at java.util.HashMap.containsKey(HashMap.java:335)
at org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:244)
at org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:237)
at org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:88)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at defaultpkg.Rule_308_7dd58592a49c4dd1a6fd98dc64c74466DefaultConsequenceInvokerGenerated.evaluate(Unknown Source)
at defaultpkg.Rule_308_7dd58592a49c4dd1a6fd98dc64c74466DefaultConsequenceInvoker.evaluate(Unknown Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1287)
- locked <0x000000020865c080> (a org.drools.common.DefaultAgenda)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1221)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1456)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:710)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:679)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:234)
at rulevolution.RulEvolution.runDrools(RulEvolution.java:348)
at rulevolution.RulEvolution.evaluate(RulEvolution.java:183)
at ec.simple.SimpleEvaluator.evalPopChunk(SimpleEvaluator.java:259)
at ec.simple.SimpleEvaluator$SimpleEvaluatorThreadCG.run(SimpleEvaluator.java:341)
at ec.util.ThreadPool$PoolThread.run(ThreadPool.java:57)
Locked ownable synchronizers:
- None
Also here the rule and code snipped I'm using to prove that the infinite loop does not come from my code:
//kSession is a StatefulKnowledgeSession
try {
//Limiting the Activation will prevent infinite loops
kSession.fireAllRules(1000);
} catch (Exception e) {
System.out.println("error while processing :: " + e.toString());
System.out.println(rule);
} finally {
kSession.dispose();
}
-------------------------------------------------------------------
rule "308"
no-loop
when
$0:NormalizedNamedEntity(
ct_0:CoveredText,
cp_0:Concept,
label_0:getConcept().getPrefLabel().value,
getConcept().identifierSource.toLowerCase.contains("ops"))
$1:NormalizedNamedEntity(
ct_1:CoveredText,
cp_1:Concept,
label_1:getConcept().getPrefLabel().value,
getConcept().identifierSource.toLowerCase.contains("bodyside"))
then
int start = getStart($0,$1);
int ende = getStop($0,$1);
String attribute = label_0+" "+label_1;
insert(annotate(aJCas, "Operation", 309, attribute, start, ende, "", attribute));
end
I appreciate any help to solve this occurrence.
Greetings
Bojan
12 years, 7 months