Basic questions about rule deployment
by Fermion
Hi,
I've finished my first small application using JBoss Rules. My current
deployment "strategy" is that I want to have a single executable .jar file
containing my application and an external (not included in the .jar) folder
that contains the rules that should be used.
Unfortunately, this seems to be harder, than I thought, as my application
refuses to use .drl or .dsl files that are outside of the package.
I'm quite sure that it's just my misunderstanding of the manual that leads
to the problem, as this seems to be one of the most basic deployment
approaches, as stated by the manual:
"
Chapter 7. Deployment and Testing
7.1. Deployment options
Once you have rules integrated in your application (or ideally before) you
will need to plan how to deploy rules along with your application. Typically
rules are used to allow changes to application business logic without
re-deploying the whole application. This means that the rules must be
provided to the application as data, not as part of the application (eg
embedded in the classpath).
"
Unfortunately I have quite some problems understanding the rest of the
chapter. So I just used and modified on of the given examples.
CODE/*
//read in the source
Reader source = new
InputStreamReader(JBossRules.class.getResourceAsStream(KNOWLEDGE_FILE));
//read in the DSL
Reader dsl = new
InputStreamReader(JBossRules.class.getResourceAsStream(DOMAINSPECIFICLANGUAGE_FILE));
//Use package builder to build up a rule package.
//An alternative lower level class called "DrlParser" can also be used...
PackageBuilder builder = new PackageBuilder();
//Use the following instead of above if you are using a DSL:
builder.addPackageFromDrl(source, dsl);
*/CODE
If I use
KNOWLEDGE_FILE = "/Rules_withDsl.drl";
DOMAINSPECIFICLANGUAGE_FILE = "/Rules_withDsl.dsl";
it all works wonderfully... but then the rules are within my .jar :-(
So I tried to change this into a folder outside the package:
KNOWLEDGE_FILE = "C:/test/Rules_withDsl.drl";
DOMAINSPECIFICLANGUAGE_FILE = "C:/test/Rules_withDsl.dsl";
Now, it doesn't work any more, because the "getResourceAsStream" returns
null pointers...
Any idea?
Thanks
--
View this message in context: http://www.nabble.com/Basic-questions-about-rule-deployment-tf4601653.htm...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 1 month
Re: [rules-users] error message
by ekke
hi,
I'm running drools with eclipse 3.3 - there are some minor problems, but it
works
just confirmed:
create a new rules project with hello world example
then go to project - properties - java build path - added external jar: my
jdt.core from my eclipse 33 installation
run hello world - all is ok
without adding the jdt.core jar to my cp I get the error you reported
ekke
suresh00 wrote:
>
> Hi,
> I guess its not the issue with the classpath. The plugin doesn't work with
> eclipse 3.3. This works with Eclipse 3.2 (verified few minutes ago)
> Here is the defect at Jboss site:
> http://jira.jboss.com/jira/browse/JBRULES-1260
>
> Thank you,
> Suresh Reddy.
>
>
> ekke wrote:
>>
>> hi,
>>
>> the error message gives you the answer:
>>
>> ...
>> Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in
>> the classpath
>> ...
>>
>> put this jar into your classpath and it works
>> (and much better and faster for you to get results: read the docs and
>> search in the list before asking ;-)
>>
>> ekke
>>
>>
>>
>> suresh00 wrote:
>>>
>>> Hi,
>>> I am new to using Drools. I am trying to run hellow world from eclipse
>>> 3.3. I got the following error msg:
>>>
>>> org.drools.RuntimeDroolsException: Unable to load dialect
>>> 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'
>>> at
>>> org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:152)
>>> at
>>> org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:140)
>>> at
>>> org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:117)
>>> at
>>> org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:94)
>>> at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:124)
>>> at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:86)
>>> at com.sample.DroolsTest.readRule(DroolsTest.java:50)
>>> at com.sample.DroolsTest.main(DroolsTest.java:21)
>>> Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not
>>> in the classpath
>>> at
>>> org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:93)
>>> at
>>> org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:54)
>>> at
>>> org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:148)
>>> ... 7 more
>>>
>>> Any suggestions fixing this issue?
>>>
>>> Thanks,
>>> Suresh
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/error-message-tf4602256.html#a13149940
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 1 month
upgrading from 4.0.0 to 4.0.2
by Karl Trout
All I was trying to upgrade my application to use the latest 4.0.2
release but I seem to be getting errors
when my application is calling
import org.drools.compiler.DroolsParserException;
import org.drools.compiler.PackageBuilder;
import org.drools.rule.Package;
import org.drools.rule.Rule;
PackageBuilder builder = new PackageBuilder();new PackageBuilder();
here is the error thrown:
java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at org.drools.rule.builder.dialect.mvel.MVELDialect.<init>(MVELDialect.java:78)
at org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration.getDialect(MVELDialectConfiguration.java:26)
at org.drools.compiler.PackageBuilderConfiguration.buildDialectRegistry(PackageBuilderConfiguration.java:166)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:142)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:86)
at com.thomcomp.generate.action.RulesReader.readPackage(RulesReader.java:25)
at com.thomcomp.generate.action.RulesReader.getRules(RulesReader.java:55)
at com.thomcomp.generate.action.GetRulesDef.execute(GetRulesDef.java:47)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Did I miss something I can't seem to figure out where to start
looking. some advise would be appreciated.
running under tomcat 6 with jdk1.5.0_09
17 years, 1 month
Re: [rules-users] error message
by ekke
hi,
the error message gives you the answer:
...
Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in
the classpath
...
put this jar into your classpath and it works
(and much better and faster for you to get results: read the docs and search
in the list before asking ;-)
ekke
suresh00 wrote:
>
> Hi,
> I am new to using Drools. I am trying to run hellow world from eclipse
> 3.3. I got the following error msg:
>
> org.drools.RuntimeDroolsException: Unable to load dialect
> 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'
> at
> org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:152)
> at
> org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:140)
> at
> org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:117)
> at
> org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:94)
> at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:124)
> at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:86)
> at com.sample.DroolsTest.readRule(DroolsTest.java:50)
> at com.sample.DroolsTest.main(DroolsTest.java:21)
> Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in
> the classpath
> at
> org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:93)
> at
> org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:54)
> at
> org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:148)
> ... 7 more
>
> Any suggestions fixing this issue?
>
> Thanks,
> Suresh
>
--
View this message in context: http://www.nabble.com/error-message-tf4602256.html#a13145168
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 1 month
RE: [rules-users] rules precompilation
by Manukyan, Sergey
Ming, Ekke,
After deserialising the Package back - getting exception when inserting
facts:
Exception thrown : java.lang.NoClassDefFoundError: XXXShadowProxy
XXX - is my class name
Any ideas?
-Sergey
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Jin, Ming
Sent: Wednesday, October 03, 2007 1:50 PM
To: Rules Users List
Subject: RE: [rules-users] rules precompilation
Sergey,
I am using precompiled rules. Serializing instances of
org.drools.rule.Package works for me.
Thanks,
-Ming
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Manukyan,
Sergey
Sent: Wednesday, October 03, 2007 12:29 PM
To: Rules Users List
Subject: [rules-users] rules precompilation
Folks,
Where can I find information on how to pre-compile rules in 4.0.1?
Thanks,
-Sergey
**********************
** LEGAL DISCLAIMER **
**********************
This E-mail message and any attachments may contain legally privileged,
confidential or proprietary information. If you are not the intended
recipient(s), or the employee or agent responsible for delivery of this
message to the intended recipient(s), you are hereby notified that any
dissemination, distribution or copying of this E-mail message is
strictly prohibited. If you have received this message in error, please
immediately notify the sender and delete this E-mail message from your
computer.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
17 years, 1 month
Re: [rules-users] PermGen OOM and shadow proxies
by Andrew Thompson
Have you tried just increasing the size of your PERM generation? Maybe it is not a leak but simply that you need just a little more than the JVM's default limit?
--
Andrew Thompson
----- Original Message ----
From: s erel <erelsagi(a)gmail.com>
To: Rules Users List <rules-users(a)lists.jboss.org>
Sent: Wednesday, October 10, 2007 11:07:01 AM
Subject: Re: [rules-users] PermGen OOM and shadow proxies
I've tried it with trunk and the OOM error still happens.
In our project working memories/facts are not shared between threads. One thread does not interfere with another thread rule evaluation.
Do we need shadow proxies for such a scenario?
The document says:
IMPORTANT: disabling shadow facts for a class inhibits the
ability of the engine keep track of changes to that class attributes. It
means, once asserted, a fact of that class MUST NOT change any of its
attributes or the engine may start to present unpredictable behavior. It
does not help to use update(). The only way to safely change an
attribute of a fact whose shadow fact is disabled is to call
modifyRetract() before changing the attribute, change the attribute and
call modifyAssert()
What about when retracting in order to assert a new reference? Is it safe to use normal retract() ?
On 10/8/07, Mark Proctor <mproctor(a)codehaus.org> wrote:
s erel wrote:
I understand that shadow facts are created once during
building.
Still, the application crashes in less than a minute when shadow facts
are enabled and it runs for hours when they are disabled.
I was assuming it to be related to a corrupted data structure that
leaks.
Can you think of such a case?
Are there any limitations for shadow facts (besides them being final)?
Can you try this with trunk and let us know if it still happens?
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/t...
On 10/8/07, Mark Proctor <
mproctor(a)codehaus.org> wrote:
s erel wrote:
Hello,
I've posted before regarding this issue.
We currently evaluating drools 4.01 for our project. We've noticed that
the perm gen space grows at a rapid rate and that eventually results
in a OOM. When shadow facts are disabled, the problem seems to go away
(or at least not as noticeable as before).
Any ideas?
What is the effect of a shadowed object which itself contains complex
objects that are also involved in a pattern (through inline eval)?
when the system encounters a new Class, and shadow is enabled, it
generates a proxy to that class - however this is a one time operation.
The only way that shadow proxies would continue to be created would be
if you where continually creating or loading new classes or
redefinitions of the old classes.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/
17 years, 1 month
PermGen OOM and shadow proxies
by s erel
Hello,
I've posted before regarding this issue.
We currently evaluating drools 4.01 for our project. We've noticed that the
perm gen space grows at a rapid rate and that eventually results
in a OOM. When shadow facts are disabled, the problem seems to go away (or
at least not as noticeable as before).
Any ideas?
What is the effect of a shadowed object which itself contains complex
objects that are also involved in a pattern (through inline eval)?
17 years, 1 month
pattern
by Markus Helbig
Drools Documentation says:
Matches a field against any valid Java Regular Expression. Typically
that regexp is a String, but variables that resolve to a valid regexp
are also allowed. It is important to note that different from java, if
you write a String regexp directly on the source file, you don't need
to escape '\'. Example:
but
"Test\s+" is a valid RegEx (it was valid in Drools 3.x too), but now:
SyntaxfehlerRule Compilation error : [Rule name=OnlineStreaming Start,
agendaGroup=MAIN, salience=100, no-loop=true]
com/p7s1/swi/phoenix/n24/Rule_OnlineStreaming_Start_0.java (19:923) :
Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )
What i'm doing wrong here?
Cheers
Markus
17 years, 1 month
Re: JBOSS and multiple rule conditions being met
by Mark Proctor
Sheila,
You have just violated #4
http://labs.jboss.com/drools/lists.html
Mark
jayrajshe(a)yahoo.com wrote:
> Hi
>
> I have been working with JBOSS for a few days now. I cannot say that I am very familiar with it yet.
>
> JBOSS rules have been used to validate data in our system. It works fine as long as we care only if a product met any one condition.
>
> However, there is now a new requirement which says that the users would like to know all the conditions which the product met setting it to a particular state.
>
> To explain with an example:
> Rule 1 - set status to PENDING if product is HIKING == y
> Rule 2 - set status to ERROR if product has High Risk Flag == y
>
> If a product is only HIKING, then this rule works well. If a product is only HISK RISK then this rule works. However, if a product meets both HIKING and HISK RISK then we would see only one or the other. Code is as given below:
> WorkingMemory workingMemory = null;
> workingMemory = getClassValidationRuleBase().newWorkingMemory();
> workingMemory.assertObject(classificationValidationData);
> workingMemory.fireAllRules();
> String result = classificationValidationData.getResultValue()
>
> How can get the output such that I get a list of all(multiple) the conditions that were met by a product setting it to a particular state.
>
> Do you have an example which can show how this can be done.
>
> Thanks for your time and help.
>
> Sheila
>
>
>
>
17 years, 1 month
jbilling to use Drools for telecom
by Paul Casal
Hello,
Thank you for Drools, I've been using it for the past few months and it is
such a great framework to work with.
I wanted to drop by to let you know that jbilling will be using Drools for
its 'telco' release. This is an open source enterprise billing system that
is getting into the telecommunications market. Drools will be quite a key
component of this new product, we are using it for the business logic of
several new modules such as rating and bundling.
For more on this go to http://www.jbilling.com/?q=node/347 this blog entry
done recently by jbilling's lead developer. I think it's a good example on
when a rules framework can be very useful.
Regards,
Paul Casal
Sr. Developer
jbilling.com
--
View this message in context: http://www.nabble.com/jbilling-to-use-Drools-for-telecom-tf4597529.html#a...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 1 month