Client code using RuleAgent API - Guvnor 5.1.1 - getting 401 error
by Achyutha, Venkata
Hi,
This error would be basic one but it's very frustrating to me to debug this, few days ago it use to work.
I deployed guvnor 5.1.1 war into web logic 10.3, created package with 4 rules, build and deploy, got package url.
Started using package url in properties file and passing file to RuleAgent api, suddenly it started giving HTTP response code: 401 for URL.
Any thoughts on this issue would be greatly appreciated.
Below is the content of properties file and Client code.
{url=http://10.117.39.51:7001/Guvnor5.1.1/org.drools.guvnor.Guvnor/package/com.tmobile.pos.rules/LATEST , name=myrules, username=weblogic, poll=30, newInstance=true, localCacheDir=C:\Installed\workspaces\drools\POC\bin, workspacepath=C://bea/user_projects/domains/posdomain, password=weblogic123, enableBasicAuthentication=true}
Error:
RuleAgent(myrules) INFO (Fri Nov 26 15:19:00 IST 2010): Configuring with newInstance=true, secondsToRefresh=30
RuleAgent(myrules) INFO (Fri Nov 26 15:19:00 IST 2010): Configuring package provider : URLScanner monitoring URLs: http://10.117.39.51:7001/Guvnor5.1.1/org.drools.guvnor.Guvnor/package/com... with local cache dir of C:\Installed\workspaces\drools\POC\bin
RuleAgent(myrules) EXCEPTION (Fri Nov 26 15:19:01 IST 2010): Server returned HTTP response code: 401 for URL: http://10.117.39.51:7001/Guvnor5.1.1/org.drools.guvnor.Guvnor/package/com.... Stack trace should follow.
java.io.IOException: Server returned HTTP response code: 401 for URL: http://10.117.39.51:7001/Guvnor5.1.1/org.drools.guvnor.Guvnor/package/com...
Client Code: (getting error at 3rd line)
File file = new File("C:\\guvnor.properties");
properties.load(new FileInputStream(file));
RuleAgent agent = RuleAgent.newRuleAgent(properties);
RuleBase ruleBase = agent.getRuleBase();
WorkingMemory workingMemory = ruleBase.newStatefulSession();
Thanks
Kumar
13 years, 2 months
Drools-Fusion : Inserting an Event in to an "entry-point" stream in the RHS of a rule?? Pls help
by Chetan Mahadev
Hi
Can we insert an Event in the RHS part of a rule to an entry-point?
basically i am trying to do this. Pls let me know if this is possible? if
not any alternative approaches? Any example would be useful pls
declare TransactionEvent
@role( event )
end
$tmp : TestClass()
$tmp.message == "TRUE"
then
TransactionEvent ev1 = new TransactionEvent (); // This should be
inserted in to an entry-pont "Temporal Reasoning" stream
ev1.setMessage("Temporal Reasoning")
insert (ev1) to entry-point "Temporal Reasoning"
end
rule "Temporal Reasoning"
$tmp : TransactionEvent ( message== "Temporal Reasoning") from entry-point
"Temporal Reasoning"
then
System.out.println("Rule fired due to entry point ");
end
Regds
Chetan
13 years, 3 months
Problem with Guvnor 5.1.1, <save> frequently does not save...
by David Shields
I have spent several days writing rules and tests for them in Guvnor, and
kept having strange results. A test would sometimes fail, repeatedly, and
then finally start working after I would delete and recreate some portion
of it, or change a value.
After two of us spent many hours trying to identify the extent of the
problem, we concluded the following:
1. The problem happens under both IE and Firefox.
2. The problem happens less frequently under Firefox if we install and
turn on a third-party plug-in which disables Firefox caching web pages.
3. Saving a new rule or test will allow us to work with it (edit - save -
test scenarios). However, frequently the rule or test will just disappear
once we log out.
4. A "Save" and "Check-in" will often work correctly if we cross our
fingers and do the following:
a. Save it once (the screen updates, and you can check the
version history)
b. Refresh the browser
c. Make the change again
d. Save it a second time
5. After doing a "Save" and "Check-in", you can immediately do a "view
source" and see your changes in place. However, if you then close the
test (or rule) and re-open it, you will often find that the change is
gone, and the test or rule looks like it did before you made the change.
A sample screenshot appears below. In this case, I created the test with
the "performedTime" set to 20-Sep-2008. I ran the test and it failed,
because the rule was checking for greater than or equal to 21-Sep-2008. I
then changed the date on the test to 21-Sep-2008, did a "save changes" and
a "Check-in", and then ran the scenario again.
As you can see below, the asserted object contains the date 20-Sep-2008,
even though the test clearly shows 21-Sep-2008.
Does anybody have any ideas on this? If I copy the above test into a new
test, it will often work the first time, but then it may disappear, once I
logout, even though it was saved and checked-in.
It almost seems like there is something wrong with the imbedded
repository, and / or the first running of the test created fact objects
that are persisting and being found the second time I ran the changed
test. ...
We are running the Final release of Drools Guvnor 5.1.1 found in
drools-5.1.1-guvnor.zip downloaded on 4-Sep-2010
We are running under Tomcat 6.0, with the recommended jar files replaced.
Thanks for your help!
--------------------------------------------------
David Shields
Division of Clinical Informatics
Department of Community and Family Medicine
Duke University Medical Center
Phone (864) 787-8551
13 years, 4 months
How to Access and Execute Rules from Database
by Ashish Soni
Hi All ,
I am able to configure oracle database in drools but now i am not able to
find how can i load rules from the DB and execute them , I gone through the
documentation but not able to get much information or might be i am missing
something.
If any one can provide me a example or some pointer ,hints then it would be
helpful.
Regards,
Ashish
13 years, 4 months
Guvnor, Apache Tomcat, and Active directory
by Dean Whisnant
Has anyone connected Guvnor on Apache Tomcat to Active Directory? I know the components.xml file is where we setup the security, but I haven't been able to find any examples of using active directory in my config. I am using 5.1.1 of Guvnor, 7.x of Tomcat, on a windows server.
Any thoughts?
Thanks
Dean
13 years, 5 months
Drools 5.2.0.M2 is not compatible with JDK 1.5?
by style.x7
Hi all,
I'm just trying out the default Drools project created with Eclipse plugin
but already getting errors:
java.lang.NoSuchMethodError:
java.util.LinkedList.peekLast()Ljava/lang/Object;
at
org.drools.rule.builder.dialect.java.parser.JavaParser.addBlockDescr(JavaParser.java:249)
at
org.drools.rule.builder.dialect.java.parser.JavaParser.updateStatement(JavaParser.java:6934)
at
org.drools.rule.builder.dialect.java.parser.JavaParser.statement(JavaParser.java:6117)
at
org.drools.rule.builder.dialect.java.parser.JavaParser.blockStatement(JavaParser.java:5733)
at
org.drools.rule.builder.dialect.java.parser.JavaParser.block(JavaParser.java:5662)
at
org.drools.rule.builder.dialect.java.JavaExprAnalyzer.analyzeBlock(JavaExprAnalyzer.java:92)
at
org.drools.rule.builder.dialect.java.JavaDialect.analyzeBlock(JavaDialect.java:258)
at
org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaConsequenceBuilder.java:90)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:98)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1546)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:653)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:295)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:471)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
...
peekLast() is a JDK 1.6 method.. so does that means from Drools 5.2x
onwards, I have to upgrade my JDK? Which sadly I can't cause my company is
using OSX Leopard, stuck with JDK 1.5 :(
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-5-2-0-M2-is-not-compatible-with-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Decision table imported into guvnor fails validation
by Lisa Horton
I have a decision table (xls) that I am able to successfully load into a knowledge base and test in my java code. However, when I import it into guvnor using the Create a File upload for xls type, validation fails with these errors:
[document list decision table] Rule Compilation error The type com.domain.job.AbstractJob is not visible The type org.apache.commons.lang.reflect.MemberUtils is not visible Syntax error on token "enum", Identifier expected The type org.apache.commons.lang.Entities is not visible The type com.abclegal.domain.activity.AbstractActivity is not visible Syntax error on token "enum", Identifier expected Syntax error on token "enum", Identifier expected The type org.apache.commons.lang.IntHashMap is not visible The type org.apache.commons.lang.builder.IDKey is not visible The import org.apache.commons.lang.NumberRange collides with another import statement The import org.apache.commons.lang.math.NumberUtils collides with another import statement
The spreadsheet does include import statement in the rules template section, including an import of com.domain.job.AbstractJob seen above. AbstractJob is in the POJO model.
I am at version 5.1.1
I'd appreciate any suggestions for troubleshooting. Also, is this the recommended way to integrate decision tables with Guvnor rules (i.e. to import into guvnor), or is there a better practice for managing decision tables along with other rule sources?
13 years, 6 months