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.
13 years, 3 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.
13 years, 3 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.
13 years, 3 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
13 years, 3 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.
13 years, 3 months
"From" in decision table
by Bruno Freudensprung
Hi guys,
As you have probably noticed, today is my "decision tables day" :-).
Before telling you what is going wrong, let me show you what kind of
rule I try to put in my Drools 5.1 decision table:
# for each window
$window : Window($elements : elements) from $windows
# for each manual annotation
$an1 : ManualAnnotation( this inside $window && text ==
*"ToMatch"*)
# if there is another manual annotation
exists ManualAnnotation( this inside $window && text ==
*"ToMatch2"*)
The only things I would like to parametrize are strings in bold.
My decision table looks like this:
CONDITION CONDITION CONDITION
CONDITION CONDITION
$an1 : ManualAnnotation
exists ManualAnnotation
$window : Window($elements... this inside $window
text == "$1"
this inside $window text == "$1"
for each window
annotation inside window
Text annotation inside window Text
N/A N/A ToMatch
N/A ToMatch2
N/A N/A ToMatch3 N/A ToMatch4
Here are the problems (in bold) with the generated rule:
$an1 : ManualAnnotation( *this inside $window == "N/A"* && text
== *"*ToMatch*"*)
exists ManualAnnotation( *this inside $window == "N/A"* && text
== *"*ToMatch2*"*)
*$window : Window($elements : elements) from $windows*
* The order of the LHS "fact lines" of the generated rules is the
not same as the order of appearance in the spreadsheet
* The "this inside $window" is considered as a field name
Do you know if I can solve those problems?
I have tried to find a way to tell the decision table to extend another
rule but I haven't found a keyword for that in the documentation.
Maybe do I have to use rule templates?
Many thanks,
Best regards,
Bruno.
13 years, 3 months
Classloading error with AspectJ and Drools 5.2.0.Final
by Steven Williams
Hi,
I have just upgraded to Drools 5.2.0.Final and am getting a weird error when
running unit tests.
java.lang.NullPointerException
at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions(
ClassLoaderWeavingAdaptor.java:251)
at org.aspectj.weaver.loadtime.DefaultWeavingContext.getDefinitions(
DefaultWeavingContext.java:130)
at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(
ClassLoaderWeavingAdaptor.java:161)
at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(
Aj.java:271)
at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(
Aj.java:276)
at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:254)
at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:90)
at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(
ClassPreProcessorAgentAdapter.java:54)
at sun.instrument.TransformerManager.transform(TransformerManager.java:169)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365
)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.fastFindClass(
JavaDialectRuntimeData.java:570)
at org.drools.util.CompositeClassLoader$CachingLoader.load(
CompositeClassLoader.java:258)
at org.drools.util.CompositeClassLoader$CachingLoader.load(
CompositeClassLoader.java:241)
at org.drools.util.CompositeClassLoader.loadClass(
CompositeClassLoader.java:88)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.drools.rule.JavaDialectRuntimeData.wire(
JavaDialectRuntimeData.java:405)
at org.drools.rule.JavaDialectRuntimeData.wire(
JavaDialectRuntimeData.java:396)
at org.drools.rule.JavaDialectRuntimeData.onBeforeExecute(
JavaDialectRuntimeData.java:237)
at org.drools.rule.DialectRuntimeRegistry.onBeforeExecute(
DialectRuntimeRegistry.java:132)
at org.drools.compiler.PackageBuilder.reloadAll(PackageBuilder.java:796)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:751)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(
PackageBuilder.java:360)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(
PackageBuilder.java:538)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(
KnowledgeBuilderImpl.java:28)
at au.com.promedicus.rules.KnowledgeBaseBuilder.addPackagesFromList(
KnowledgeBaseBuilder.java:108)
at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
KnowledgeBaseBuilder.java:69)
at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
KnowledgeBaseBuilder.java:54)
I have traced the problem to org.drools.rule.
JavaDialectRuntimeData$PackageClassLoader.getResources. This returns null
whereas AspectJ expects it to at least return an empty enumeration - hence
the NPE. Interestingly the problem does not occur when running our server,
however we can't upgrade unless our unit tests pass and we can't easily turn
off aspectj for these.
regards
Steve
13 years, 3 months
Re: [rules-users] [rules-dev] Building a (semantic) application
by Wolfgang Laun
This list is dedicated to the communication between Drools developers.
For general questions about Drools and rules, please use the "Rules Users
List" <rules-users(a)lists.jboss.org>, which has a much wider audience.
-W
On 7 September 2011 03:56, Sebastian Samaruga <cognescent(a)gmail.com> wrote:
> Question,
>
>
13 years, 3 months
Druplicate rule name: 0
by bitter
I have 100 rules in xls decision table.
I modify any rule and save change. Then I try to build create new knwoledge
base using this file and I have exception:
java.lang.RuntimeException: [784,0]: Duplicate rule name: 0
[801,0]: Duplicate rule name: 0
[818,0]: Duplicate rule name: 0
[837,0]: Duplicate rule name: 0
[856,0]: Duplicate rule name: 0
[873,0]: Duplicate rule name: 0
[890,0]: Duplicate rule name: 0
[907,0]: Duplicate rule name: 0
[924,0]: Duplicate rule name: 0
[941,0]: Duplicate rule name: 0
[958,0]: Duplicate rule name: 0
[975,0]: Duplicate rule name: 0
[992,0]: Duplicate rule name: 0
[1009,0]: Duplicate rule name: 0
I tried to compile this file using SpreadSheetCompiler. This is a scrap of
drl file wth rules:
*
# rule values at A52, header at A5
rule "0"
salience 60
ruleflow-group "0"
when
*
--
View this message in context: http://drools.46999.n3.nabble.com/Druplicate-rule-name-0-tp3246425p324642...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 3 months