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
14 years, 6 months
order of execution between BPM events and rules
by Jordi Alvarez
Hello, I am involved in a set of projects for an insurance company in which
we have been combining Drools Expert and Drools Flow for its 5.1.1 version.
We are making extensive use of events / wait states in our processes.
We have experienced that, in case of conflict between wait state constraints
and rules (that is, there is a wait state constraint that is true and also a
rule activation that is true), always the constraints associated to our
processes execute before the rule.
We have searched in the documentation but found nothing regarding this
point. Can anybody confirm whether our empirical assumption is really true?
There is some way to configure this behaviour?
Many thanks in advance!
Jordi Alvarez
14 years, 6 months
How to get a Facts handle in Custom Evaluator
by kashif10
Lets say we have 100s or 1000s of Fact objects of Observation.
In rule we need to compare it with some data lets say
Observation( this checkObs "SomeData")
Where checkObs is our customeEvaluator
Now we have to make the RHS dynamic...
That If we have some data in database depending upon the caller... we need
to replcae that with "SomeData" in our evaluator, but how can I get/passes
user info in our custom evaluator.
Is there a way to read some global variable, or some other facts object in
our evalutor, which changed per firing of rule sets??
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-get-a-Facts-handle-in-Custom-Eva...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
Unable to get WebDav Access, unless modify JackRabbit Config
by john@oa
Relates to webdav management of rules under: guvnor-5.2.0.Final-tomcat-6.0
Hi
For rapid development, I wish to directly manage the repository through
WebDav.
I can successfully navigate the repository using BitKinex 3.2.3 or Windows 7
web folders. However, I cannot create or edit .drl files. When I do this I
receive an ERROR in the Tomcat console (see error below this post).
I have tried to authenticate with:
-no authentication details
- with the 'guest' user
- the 'anonymous' user
- and the 'admin' user.
I have managed to enable WebDav editing of the repository .drl file's by
updating the JackRabbit configuration of the Tomcat server and changing the
anonymous user to have an id of 'guest' (in Tomcat's repository.xml file -
see below).
*However*, when I do this Drools Guvnor can no longer edit or view Rules.
Any help much appreciated!
ERROR received on edit:
*****************
at java.lang.Thread.run(Thread.java:662)
ERROR 07-09 18:41:29,280 (WebDavServletBean.java:service:154) Exception:
org.
drools.repository.RulesRepositoryException: javax.jcr.AccessDeniedException:
Acc
ess denied
at
org.drools.repository.VersionableItem.checkout(VersionableItem.java:5
61)
at
org.drools.repository.VersionableItem.checkout(VersionableItem.java:5
31)
at
org.drools.repository.AssetItem.updateBinaryContentAttachment(AssetIt
em.java:405)
at
org.drools.guvnor.server.files.WebDAVImpl.setResourceContent(WebDAVIm
pl.java:712)
at net.sf.webdav.methods.DoPut.execute(DoPut.java:152)
at
net.sf.webdav.WebDavServletBean.service(WebDavServletBean.java:128)
at
org.drools.guvnor.server.files.WebdavServlet.service(WebdavServlet.ja
va:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
at
org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHtt
pServletRequest.java:53)
at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
------------------------
JackRabbit configuration with guest user:
*******************************
<LoginModule
class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
</LoginModule>
------------------
--
View this message in context: http://drools.46999.n3.nabble.com/Unable-to-get-WebDav-Access-unless-modi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
Function and return value
by snehils
I have made a function in drl file. This function is calling another function
from java file. This java file function returns an object, that I am not
able to get.
function SomeObject testFinction(SomeObject obj1) {
String str;
// Some calculations
// ...
str = "something after calculation";
// this function will return SomeObject based on str value
SomeObject obj2 = Util.getSomeObject(str); // problem is here. obj2 is
updated with same value of obj1. Expected value is diffrent from obj1.
Checked getSomeObject(). It is working fine.
// Some other calculations...
// ...
return anotherSomeObject;
}
rule "Check SomeObject"
when
//eval(tlvID == "57")
someObj:SomeObject(id == "123")
then
testFinction(someObj);
end
I am using drool version 5.1.0.
--
View this message in context: http://drools.46999.n3.nabble.com/Function-and-return-value-tp3317132p331...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
knowledge agent unable to update rule/flow upon changes
by James
Hi all,
I follow the last reply in
"http://drools.46999.n3.nabble.com/KnowledgeAgent-not-reloading-KnowledgeB..."
and use the static method in following class to obtain knowledge base:
public class DroolsCore {
private static KnowledgeAgent kagent = null;
private static KnowledgeBase knowledgeBase = null;
public static KnowledgeBase createKnowledgeBase() {
if(kagent == null && knowledgeBase == null) {
ResourceChangeScannerConfiguration sconf =
ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
sconf.setProperty("drools.resource.scanner.interval", "10");
ResourceFactory.getResourceChangeScannerService().configure(sconf);
ResourceFactory.getResourceChangeScannerService().start();
ResourceFactory.getResourceChangeNotifierService().start();
kagent = KnowledgeAgentFactory.newKnowledgeAgent("myagent");
kagent.applyChangeSet(ResourceFactory.newClassPathResource("resource/changeSet.xml"));
knowledgeBase = kagent.getKnowledgeBase();
}
return knowledgeBase;
}
}
I have the my changeSet.xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/...'>
<add>
<resource source='classpath:resource/rules/' type='DRL' />
<resource source='classpath:resource/flows/' type='DRF' />
</add>
</change-set>
After deploying the application as webapp, I can run the flow + rule all
right.
However, when I switch the execution order in my flow file on the fly and
run the app again (by cliking a link), I get the same result as the flow has
never been changed.
Moreover, I get the following error message when I uninstall the webapp from
my application server (WASCE/geronimo 2.1):
Exception in thread "Thread-44" java.lang.RuntimeException: This Resource
cannot
be listed, or is not a directory
at
org.drools.io.impl.ClassPathResource.listResources(ClassPathResource.
java:191)
at
org.drools.io.impl.ResourceChangeScannerImpl.scan(ResourceChangeScann
erImpl.java:130)
at
org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet.run(Res
ourceChangeScannerImpl.java:311)
at java.lang.Thread.run(Thread.java:735)
Any help is appreciated.
--
View this message in context: http://drools.46999.n3.nabble.com/knowledge-agent-unable-to-update-rule-f...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
Override JPAWorkItemManager
by Amin Mohammed-Coleman
Hi
I am trying to set a custom jpa work item manager and setting it on the properties object before i create a knowledgesessionconfiguration with property "drools.workItemManagerFactory" but it seems as though the default JPAWorkItemManager is used every time. Is there a way to override this?
Cheers
14 years, 6 months
Decision table empty action cell
by Bruno Freudensprung
Hi,
I am implementing a decision table that looks like:
*CONDITION*
*ACTION*
*$p : Person*
*name == "$1"*
*retract($p);*
*Person name*
*Retract the person*
Fred
N/A
Kenny
N/A
The problem is generated rules have an empty RHS unless I put a string
(here N/A) on each line of the Action column, and I'd like to hide this
column in my final spreadsheet.
Does anyone know a way to instruct Drools to generate the LHS even if
the cell is empty?
If it is not possible, do you know any Excel trick to automatically fill
the Action cell with an arbitrary value (here N/A) when a new line is
inserted in my table?
Many thanks in advance for your help,
Best regards,
Bruno.
14 years, 6 months