How Can I share data in different Scope and Contexts ?
by Saul
Hi. I am new with drools, I have being thinking if drools can do the
following requirement, I have a application with different context:
1. aplicationContext: keep all information an fact relationship with the
system ( calendar, configuration data, etc)
2. sessionContext: keep information an fact of my session ( user information,
module data ( loan module), etc)
3. serviceContext: keep information an fact of the services ( open loan,
payment loan , etc)
My question is: Can I have different context or scope (with data) linking to
the working memory (WM). My target is keeping the information shareable
between different context and fire rule in ServiceContext using the data from
my previous contexts (application and session).
Or I have to create one WM to every Service Context and insert all my fact of
the others context (application and session), I don´t like this one.
Best Regard
Paul Cuesta
16 years, 11 months
How Can I share data in different Scope and Contexts?
by Saul Cuesta
Hi. I am new with drools, I have being thinking if drools can do the
following requirement, I have a application with different context:
1. aplicationContext: keep all information an fact relationship with the
system ( calendar, configuration data, etc)
2. sessionContext: keep information an fact of my session ( user
information, module data ( loan module), etc)
3. serviceContext: keep information an fact of the services ( open loan,
payment loan , etc)
My question is: Can I have different context or scope (with data) linking to
the working memory (WM). My target is keeping the information shareable
between different context and fire rule in ServiceContext using the data
from my previous contexts (application and session).
Or I have to create one WM to every Service Context and insert all my fact
of the others context (application and session), I don´t like this one.
Best Regard
Paul Cuesta
16 years, 11 months
memberOf in a eval statement (dialect mvel)
by vdelbart
Hi,
I want to use the keyword memberOf in an eval statement (with dialect =
mvel).
rule "Your 5 Rule"
dialect "mvel"
when
$l:ArrayList()
eval("test" memberOf $l)
then
#actions
System.out.println("OK");
end
but it doesn't work, and I don't understand the error :
Caused by: java.lang.ClassCastException: java.lang.String
at
org.drools.base.mvel.MVELEvalExpression.evaluate(MVELEvalExpression.java:36)
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:72)
... 12 more
Thanks for your help,
V.
--
View this message in context: http://www.nabble.com/memberOf-in-a-eval-statement-%28dialect-mvel%29-tf4...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 11 months
Using JBoss Rules in cases where users need to add / remove rules
by Robert Burdick
Hello All:
I am trying to figure out if JBoss Rules will be suitable for my
application
needs. Maybe you can give some insight.
My application needs to implement / use a rules engine for evaluating
conditions and firing off events when those conditions are met. So far
this
sounds exactly like the sort of thing that JBoss Rules is for. The
twist is
that my application will also provide an administrative utility that
allows
admins to add or remove rules, as well as modify the conditions that
trigger
these rules. Can JBoss Rules be used to do this? All of the examples
I've
seen so far seem to incorporate rules whose consequences are fixes, but
with
changeable conditions. For example, there are lots of samples out there
like an insurance application. Such an example has consequences such as
offerQuote, turnDownCustomer etc. that don't change, but with conditions
that do change. For example, today offer quotes to all good drivers,
tomorrow change the rule to offer quotes to all good drivers over the
age of
18. The conditions change, but the basic actions in the system are
common.
What I think my requirement implies is a way to define rules with
conditions
and the corresponding consequences code at runtime. This seems to imply
that the application code needs to be dynamic, in order to allow users
to
define arbitrary consequence code. Has anyone ever tried to do
something
this generic with JBoss Rules, and better, can you fill me in on how to
go
about this?
Thanks, Robert
16 years, 11 months
[RePost] Deploying insurance example into JBoss...
by mmquelo massi
Sorry For Multiple posting but I had problems with the last post....
I deleted all the active links and I hope that It works.
The post has been rendered as follows: "weft didn't produce an output."
massi
----
Hi guys,
I got troubled trying to deploy the "Insurance example" in JBoss.
I tell you, step by step, what I did.
1. I downloaded "drools-4.0.3-examples.zip" from JBoss site.
2. I extracted the "insurance-example" into directory "insurance".
3. I downloaded and installed maven 1.8.
4. I opened a "cmd" shell and I executed the command: mvn clean package.
5. I got back the following error message:
C:\Users\mmquelo\Documents\Eclipse Workspaces\insurance33\insurance>mvn -e
clean package
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building DroolsInsurance
[INFO] task-segment: [clean, package]
[INFO]
------------------------------------------------------------------------
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin...
Downloading:
http://repository.jboss.com/maven2/org/apache/maven/plugins/maven-clean-p...
clean-plugin-2.1.pom
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin...
clean-plugin-2.1.pom
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.apache.maven.plugins:maven-clean-plugin
Reason: POM 'org.apache.maven.plugins:maven-clean-plugin' not found in
repositor y: Unable to download the artifact from any repository
org.apache.maven.plugins:maven-clean-plugin:pom:2.1
from the specified remote repositories:
jbossRepository (
http://repository.jboss.com/maven2),
central (
http://repo1.maven.org/maven2)
for project org.apache.maven.plugins:maven-clean-plugin
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to build
project
for plugin 'org.apache.maven.plugins:maven-clean-plugin': POM '
org.apache.maven.
plugins:maven-clean-plugin' not found in repository: Unable to download the
arti
fact from any repository
org.apache.maven.plugins:maven-clean-plugin:pom:2.1
from the specified remote repositories:
jbossRepository (
http://repository.jboss.com/maven2),
central (
http://repo1.maven.org/maven2)
for project org.apache.maven.plugins:maven-clean-plugin
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(
DefaultLifecycleExecutor.java:1274)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor
(DefaultLifecycleExecutor.java:1522)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindLifecycleForPackaging
(DefaultLifecycleExecutor.java:1016)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.constructLifecycleMappings
(DefaultLifecycleExecutor.java:980)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
DefaultLifecycleExecutor.java:458)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java
:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java
:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.InvalidPluginException: Unable to build
proje
ct for plugin 'org.apache.maven.plugins:maven-clean-plugin': POM '
org.apache.mav
en.plugins:maven-clean-plugin' not found in repository: Unable to download
the a
rtifact from any repository
org.apache.maven.plugins:maven-clean-plugin:pom:2.1
from the specified remote repositories:
jbossRepository (
http://repository.jboss.com/maven2),
central (
http://repo1.maven.org/maven2)
for project org.apache.maven.plugins:maven-clean-plugin
at
org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(
DefaultPluginManager.java:277)
at
org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(
DefaultPluginManager.java:193)
at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(
DefaultPluginManager.java:172)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(
DefaultLifecycleExecutor.java:1257)
... 18 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM '
org.apache.maven.plugins:maven-clean-plugin' not found in repository: Unable
to download the
artifact from any repository
org.apache.maven.plugins:maven-clean-plugin:pom:2.1
from the specified remote repositories:
jbossRepository (
http://repository.jboss.com/maven2),
central (
http://repo1.maven.org/maven2)
for project org.apache.maven.plugins:maven-clean-plugin
at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(
DefaultMavenProjectBuilder.java:571)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(
DefaultMavenProjectBuilder.java:231)
at
org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(
DefaultPluginManager.java:261)
... 21 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException:
Unable
to download the artifact from any repository
org.apache.maven.plugins:maven-clean-plugin:pom:2.1
from the specified remote repositories:
jbossRepository (
http://repository.jboss.com/maven2),
central (
http://repo1.maven.org/maven2)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(De
faultArtifactResolver.java:206)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(
DefaultArtifactResolver.java:73)
at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(
DefaultMavenProjectBuilder.java:524)
... 23 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to
download the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact
(DefaultWagonManager.java:324)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(
DefaultArtifactResolver.java:194)
... 25 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Fri Dec 07 11:00:35 CET 2007
[INFO] Final Memory: 1M/4M
[INFO]
------------------------------------------------------------------------
C:\Users\mmquelo\Documents\Eclipse Workspaces\insurance33\insurance>
What did it go wrong?
What did I miss?
Thank You again!
Massi
16 years, 11 months
Deploying insurance example into JBoss...
by mmquelo massi
Hi guys,
I got troubled trying to deploy the "Insurance example" in JBoss.
I tell you, step by step, what I did.
1. I downloaded "drools-4.0.3-examples.zip" from JBoss site.
2. I extracted the "insurance-example" into directory "insurance".
3. I downloaded and installed maven 1.8.
4. I opened a "cmd" shell and I executed the command: *mvn clean package*.
5. I got back the following error message:
*C:\Users\mmquelo\Documents\Eclipse Workspaces\insurance33\insurance>mvn -e
clean package
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building DroolsInsurance
[INFO] task-segment: [clean, package]
[INFO]
------------------------------------------------------------------------
Downloading: **
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean*<http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean>
*-*
* plugin/2.1/maven-clean-plugin-2.1.pom
Downloading: **
http://repository.jboss.com/maven2/org/apache/maven/plugins/maven-c*<http://repository.jboss.com/maven2/org/apache/maven/plugins/maven-c>
*lean-plugin/2.1/maven-clean-plugin-2.1.pom*
* Downloading: **
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean*<http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean>
*-*
* plugin/2.1/maven-clean-plugin-2.1.pom
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).*
*Project ID: org.apache.maven.plugins:maven-clean-plugin*
*Reason: POM 'org.apache.maven.plugins:maven-clean-plugin' not found in
repositor y: Unable to download the artifact from any repository*
* org.apache.maven.plugins:maven-clean-plugin:pom:2.1*
*from the specified remote repositories: jbossRepository (**
http://repository.jboss.com/maven2* <http://repository.jboss.com/maven2>*),*
* central (**http://repo1.maven.org/maven2*<http://repo1.maven.org/maven2>
*)*
* for project org.apache.maven.plugins:maven-clean-plugin*
*[INFO]
------------------------------------------------------------------------*
* [INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to build
project
for plugin 'org.apache.maven.plugins:maven-clean-plugin': POM '
org.apache.maven.
plugins:maven-clean-plugin' not found in repository: Unable to download the
arti
fact from any repository*
* org.apache.maven.plugins:maven-clean-plugin:pom:2.1*
*from the specified remote repositories: jbossRepository (**
http://repository.jboss.com/maven2* <http://repository.jboss.com/maven2>*),*
* central (**http://repo1.maven.org/maven2*<http://repo1.maven.org/maven2>
*)*
* for project org.apache.maven.plugins:maven-clean-plugin
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin
(Defa
ultLifecycleExecutor.java:1274)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor
(DefaultLifecycleExecutor.java:1522)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindLifecycleForP
ackaging(DefaultLifecycleExecutor.java:1016)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.constructLifecycl
eMappings(DefaultLifecycleExecutor.java:980)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(Defau
ltLifecycleExecutor.java:458)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLi
fecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java
:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java
:430)*
* at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused
by: org.apache.maven.plugin.InvalidPluginException: Unable to build proje
ct for plugin 'org.apache.maven.plugins:maven-clean-plugin': POM '
org.apache.mav
en.plugins:maven-clean-plugin' not found in repository: Unable to download
the a
rtifact from any repository*
* org.apache.maven.plugins:maven-clean-plugin:pom:2.1*
*from the specified remote repositories: jbossRepository (**
http://repository.jboss.com/maven2* <http://repository.jboss.com/maven2>*),*
* central (**http://repo1.maven.org/maven2*<http://repo1.maven.org/maven2>
*)*
* for project org.apache.maven.plugins:maven-clean-plugin
at
org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersio
n(DefaultPluginManager.java:277)
at
org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(De
faultPluginManager.java:193)
at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin
(DefaultPlug
inManager.java:172)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin
(Defa
ultLifecycleExecutor.java:1257)
... 18 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM '
org.apache.ma
ven.plugins:maven-clean-plugin' not found in repository: Unable to download
the
artifact from any repository*
* org.apache.maven.plugins:maven-clean-plugin:pom:2.1*
*from the specified remote repositories: jbossRepository (**
http://repository.jboss.com/maven2* <http://repository.jboss.com/maven2>*),*
* central (**http://repo1.maven.org/maven2*<http://repo1.maven.org/maven2>
*)*
* for project org.apache.maven.plugins:maven-clean-plugin
at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepo
sitory(DefaultMavenProjectBuilder.java:571)
at
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromReposito
ry(DefaultMavenProjectBuilder.java:231)
at
org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersio
n(DefaultPluginManager.java:261)
... 21 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException:
Unable
to download the artifact from any repository*
* org.apache.maven.plugins:maven-clean-plugin:pom:2.1*
*from the specified remote repositories: jbossRepository (**
http://repository.jboss.com/maven2* <http://repository.jboss.com/maven2>*),*
* central (**http://repo1.maven.org/maven2*<http://repo1.maven.org/maven2>
*)*
* at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(De
faultArtifactResolver.java:206)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(De
faultArtifactResolver.java:73)
at
org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepo
sitory(DefaultMavenProjectBuilder.java:524)
... 23 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to
downl
oad the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact
(Def
aultWagonManager.java:324)
at
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(De
faultArtifactResolver.java:194)
... 25 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Fri Dec 07 11:00:35 CET 2007
[INFO] Final Memory: 1M/4M
[INFO]
------------------------------------------------------------------------*
*C:\Users\mmquelo\Documents\Eclipse Workspaces\insurance33\insurance>*
What did it go wrong?
What did I miss?
Thank You again!
Massi
16 years, 11 months
java.lang.ClassNotFoundException: [Lorg.drools.rule.Declaration;
by Manan Gosalia
Hello,
I am trying to deserialize rule package from disk. However, I am getting the following exception. I have also included the code that I use to deserialize rule packages. I found only one link on the web that describes this issue after looking around: http://www.mail-archive.com/user@drools.codehaus.org/msg01731.html. But there was no solution or help there. Any idea?
I am using drools 3.0.5 and Java 1.5.
Caused by: java.lang.ClassNotFoundException: [Lorg.drools.rule.Declaration;
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.drools.rule.PackageCompilationData$PackageClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.drools.common.ObjectInputStreamWithLoader.resolveClass(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readArray(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.util.HashMap.readObject(Unknown Source)
at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at org.drools.rule.PackageCompilationData.readExternal(Unknown Source)
at java.io.ObjectInputStream.readExternalData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at org.drools.rule.Package.readExternal(Unknown Source)
at com.cisco.cp.engine.util.CPRuleUtil$CPRuleFileHelper.getRulePackage(CPRuleUtil.java:654)
.... 26 more
private Package getRulePackage(File file) throws Exception {
// Make sure file is a valid rule file with the proper rule file
// ... type.
if(file == null) {
throw new Exception("File argument is null");
}
if(!file.exists()) {
throw new Exception("File does not exist");
}
FileInputStream ruleFileInputStream = null;
ObjectInputStream ruleObjectInputStream = null;
Reader ruleFileReader = null;
Package rulePackage = null;
try {
rulePackage = new Package();
// If the rule file is already compiled, then we just have
// ... read it through object input stream.
ruleFileInputStream = new FileInputStream(file);
ruleObjectInputStream =
new ObjectInputStream(ruleFileInputStream);
rulePackage.readExternal(ruleObjectInputStream);
// Validate the package - this will throw exception if there
// ... were any error in the package.
rulePackage.checkValidity();
}
finally {
if (rulePackage != null &&
rulePackage.getErrorSummary() != null &&
!rulePackage.getErrorSummary().equals("")) {
System.out.println("RULE FILE ERRORS: " +
rulePackage.getErrorSummary());
}
if (ruleObjectInputStream != null) {
ruleObjectInputStream.close();
}
if (ruleFileInputStream != null) {
ruleFileInputStream.close();
}
if (ruleFileReader != null) {
ruleFileReader.close();
}
}
return rulePackage;
}
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
16 years, 11 months
Get compiled Java Code of Rules
by Markus Helbig
Hi,
is there any possibility to get the compiled java code of the rules
... could be helpful for several reasons ...
Cheers
Markus
16 years, 12 months
Invalid signature file
by J Michael Dean
I have created a plugin to contain the core Drools jars and
dependencies, and this plugin is then used by my RCP. This works, a
couple rules fire correctly, etc. Now I want to set up a testing
framework (JUnit4) and have the following code, which causes an
Invalid signature file error. My core plugin was created in Eclipse
simply by wrapping the Drools jars and dependencies, and as I said,
the RCP itself works. Any assistance is greatly appreciated.
- Mike
@BeforeClass
public static void setUp() throws Exception {
Reader source;
final PackageBuilder builder = new PackageBuilder();
boolean exists = (new File("rules/GlucoseDroolRules00.drl")).exists();
if (exists) {
builder.addPackageFromDrl(new FileReader(
"rules/GlucoseDroolRules00.drl"));
} else {
System.out.println("Cannot locate the file - will try as resource");
source = new InputStreamReader(AllDroolsRulesTests.class
.getResourceAsStream("rules/GlucoseDroolRules00.drl"));
builder.addPackageFromDrl(source);
}
if (builder.hasErrors()) {
System.out.println(builder.getErrors().toString());
}
Package pkg = builder.getPackage();
ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(pkg);
}
The code dies in the line instantiating the PackageBuilder builder:
java.lang.SecurityException: Invalid signature file digest for
Manifest main attributes
at
sun
.security
.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:221)
at
sun
.security
.util.SignatureFileVerifier.process(SignatureFileVerifier.java:176)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:233)
at java.util.jar.JarVerifier.update(JarVerifier.java:188)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:325)
at java.util.jar.JarFile.getInputStream(JarFile.java:390)
at
sun
.net
.www
.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:136)
at java.net.URL.openStream(URL.java:1007)
at
org
.drools.util.ChainedProperties.loadProperties(ChainedProperties.java:
245)
at
org
.drools.util.ChainedProperties.loadProperties(ChainedProperties.java:
216)
at org.drools.util.ChainedProperties.<init>(ChainedProperties.java:123)
at org.drools.util.ChainedProperties.<init>(ChainedProperties.java:31)
at
org
.drools
.compiler
.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:108)
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
droolsRules.tests.AllDroolsRulesTests.setUp(AllDroolsRulesTests.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun
.reflect
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org
.junit
.internal
.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
at
org
.junit
.internal
.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
at
org
.junit
.internal
.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
at
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at
org
.eclipse
.jdt
.internal
.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at
org
.eclipse
.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org
.eclipse
.jdt
.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
460)
at
org
.eclipse
.jdt
.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
673)
at
org
.eclipse
.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
386)
at
org
.eclipse
.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
196)
16 years, 12 months