permgen leak
by brachi
i'm using drools 5.5.0, after the rules deployment, (associate DRL's with the
KnowladBase and compile them)
my permgen grows to 500m, and also if i undeploy, the permgen doesn't
cleaned up. (only if i restart the server)
It won't help me to increase the permgen size, because the client does a lot
of heavy deployment, and can be in the maximum size by 3-4 deployments.
I tried this tomcat flags, and it does nothing:
-XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled
-XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC
I tried set the flag : PermGenThreshold=0, like other people suggested in
your forums and it doesn't help.
any help? it's production issue...
--
View this message in context: http://drools.46999.n3.nabble.com/permgen-leak-tp4027038.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 11 months
Order of object creation in stateful session
by Dean Whisnant
Hi,
This may be a very basic question, but I'm using drools 5.1.1 and when I invoke a stateful session and that session ends I receive back all of the facts that were created during that session and I translate those into an EDI transaction. As an example I might have a few objects of types "2700*LX,2750* N1,2750* REF, and 2750*DTP". I know my rules fired create objects like:
LX*1
N1*75*CMSEC
REF*17*A
DTP*007*D8*20140114
LX*2
N1*75*STATUS
REF*17*AFTNM
DTP*007*D8*20140114
Each of these lines is an object of the type I mentioned above.
My task is to make sure that the different object types "stick" together when I put them in the .x12 file so that they are formatted above.
What I do internally is I keep track that I have two of each of these objects, but I don't know if there is some type of timestamp that is on them that I could keep the first LX, N1, REF, DTP together or not.
In one example I have a rule that inserts them in the order you see, yes, it literally inserts 8 objects/facts into memory. And I need to know the order they were inserted so that I can properly form a file out of them on the backend.
Here's how I grab the objects and factHandle list. Is there a method that might help me know what object was created by what rule and how I might keep facts created in a rule together?
// Get handle to all objects coming from drools
Collection<FactHandle> handleList = null;
try
{
handleList = ksession.getFactHandles();
}
catch (Exception e)
{
_log.error("kSession get Fact Handles. Error=" + e.getMessage());
}
// Build the List with the results from drools - objectOutList
Object anObject;
TranslatedObjectImpl aTranslatedObject;
FactHandle fH;
for (Iterator<FactHandle> it = handleList.iterator(); it.hasNext();)
{
fH = (FactHandle) it.next();
anObject = (Object) ksession.getObject(fH);
if (anObject instanceof String)
{
// prt("Ignoring back from drool the String object " + anObject.getClass().getCustomerLogName());
}
else if (anObject instanceof TranslatedObjectImpl)
{
aTranslatedObject = (TranslatedObjectImpl) ksession.getObject(fH);
objectOutList.add(aTranslatedObject);
if (_log.isTraceEnabled()) _log.trace("Back from drools, translated object " + anObject.getClass().getSimpleName());
}
else
{
objectOutList.add(ksession.getObject(fH));
if (_log.isTraceEnabled()) _log.trace("Back from drools, found object " + anObject.getClass().getSimpleName());
}
}
if (_log.isDebugEnabled()) _log.debug("Done with Transformer. Total number of Drools object = " + objectOutList.size());
ksession.dispose();
Any thoughts?
Thanks,
Dean
10 years, 11 months
KieBuilder.buildAll() causing exception
by waynemetcalfe
Hi Guys,
I'm a pretty recent Drools user.
I'm trying to update a project to stop using the deprecated KnowledgeBase.
I've followed examples on
http://blog.athico.com/2013/10/configuration-and-convention-based.html
<http://blog.athico.com/2013/10/configuration-and-convention-based.html> ,
but an exception is being thrown when trying to build the KieBases.
Drools version:6.0.0.Final
Java version: 1.7.0_45
Code snippet:
...
final KieServices ks = KieServices.Factory.get();
final KieRepository kr = ks.getRepository();
final KieFileSystem kfs = ks.newKieFileSystem();
//ruleScript is simply a string containing the rules
kfs.write("src/main/resources/com/company/test/rules/rules.drl",
ruleScript);
KieBuilder kb = ks.newKieBuilder(kfs);
kb.buildAll();
if (kb.getResults().hasMessages(Level.ERROR)){
configuration.getLog().error("\nSomething wrong here!\n\n");
}
final KieContainer kContainer =
ks.newKieContainer(kr.getDefaultReleaseId());
session = kContainer.newKieSession();
...
The following exception is thrown:
java.lang.instrument.IllegalClassFormatException: Error while instrumenting
class org/drools/compiler/lang/DRL6Lexer.
at
org.jacoco.agent.rt.internal_9dd1198.CoverageTransformer.transform(CoverageTransformer.java:89)
at
sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at
sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at
org.drools.compiler.compiler.DRLFactory.getDRLLexer(DRLFactory.java:93)
at
org.drools.compiler.compiler.DRLFactory.buildLexer(DRLFactory.java:43)
at org.drools.compiler.compiler.DrlParser.parse(DrlParser.java:164)
at org.drools.compiler.compiler.DrlParser.parse(DrlParser.java:146)
at
org.drools.compiler.compiler.PackageBuilder.drlToPackageDescr(PackageBuilder.java:518)
at
org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl$1.map(CompositeKnowledgeBuilderImpl.java:404)
at
org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.buildResource(CompositeKnowledgeBuilderImpl.java:329)
at
org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.buildPackageDescr(CompositeKnowledgeBuilderImpl.java:312)
at
org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.buildPackages(CompositeKnowledgeBuilderImpl.java:96)
at
org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:87)
at
org.drools.compiler.kie.builder.impl.AbstractKieModule.buildKnowledgePackages(AbstractKieModule.java:204)
at
org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:39)
at
org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:309)
at
org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:187)
at
com.company.test.rules.BasicRuleEngine.start(BasicRuleEngine.java:66)
at
com.company.test.rules.TestBasicRuleEngine.listenersShouldBeNotifiedOfStartAndStop(TestBasicRuleEngine.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:254)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:149)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
at
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)
Caused by: java.io.IOException: Error while instrumenting class
org/drools/compiler/lang/DRL6Lexer.
at
org.jacoco.agent.rt.internal_9dd1198.core.instr.Instrumenter.instrumentError(Instrumenter.java:147)
at
org.jacoco.agent.rt.internal_9dd1198.core.instr.Instrumenter.instrument(Instrumenter.java:98)
at
org.jacoco.agent.rt.internal_9dd1198.CoverageTransformer.transform(CoverageTransformer.java:87)
... 60 more
Caused by: java.lang.RuntimeException: Method code too large!
at
org.jacoco.agent.rt.internal_9dd1198.asm.MethodWriter.a(Unknown Source)
at
org.jacoco.agent.rt.internal_9dd1198.asm.ClassWriter.toByteArray(Unknown
Source)
at
org.jacoco.agent.rt.internal_9dd1198.core.instr.Instrumenter.instrument(Instrumenter.java:79)
at
org.jacoco.agent.rt.internal_9dd1198.core.instr.Instrumenter.instrument(Instrumenter.java:96)
... 61 more
Any help or info would be greatly appreciated!
--
View this message in context: http://drools.46999.n3.nabble.com/KieBuilder-buildAll-causing-exception-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 11 months
Inconsistent output when @PropertyReactive is used
by Sonata
Below is a test to demonstrate it, also add the @PropertyReactive property to
MyClass()
package com.sample;
rule base
when m : MyClass(data == null)
then
end
rule "2" extends base
when
String()
MyClass(value != "test") from m
then
System.out.println("2 fired");
end
rule "1" extends base
salience 1
when
MyClass(value == null) from m
then
System.out.println("1 fired");
insert(new String());
modify(m) { setValue("test") }
end
The test above should output "1 fired" and "2 fired".
Although we have set the value to "test", rule "2" supposes to not fire, but
it is in fact expected to fire due to the non-reactive property of CE
"from", and the result confirms this.
But if we reorder the code in rule "1" to
rule "1" extends base
salience 1
when
MyClass(value == null) from m
then
System.out.println("1 fired");
modify(m) { setValue("test") }
insert(new String());
end
Then you get only "1 fired", as if CE "from" is reactive again.
This only happens when you have the @PropertyReactive property added to
MyClass()
Version tested are 5.5.0.Final and 5.6.0.Final
Could the Drools team review this? Thank you.
--
View this message in context: http://drools.46999.n3.nabble.com/Inconsistent-output-when-PropertyReacti...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 11 months
Ability to use Any of the Following (OR) with DSLs
by Nikita Patel
Hi,
I have created multiple DSLs. I now want to be able to create a rule which says:
1. For any of the following:
DSL 1
DSL 2
2. For any of the following:
DSL 3
DSL 2
DSL 4
3. For any of the following:
DSL 3
How can I currently do this?
Appreciate any pointers.
Thanks,
Nikita
10 years, 11 months
Problem when creating KieModuleModel
by Demian Calcaprina
Hi Guys!
I am having a problem using drools 6 in my project. And I was able to
reproduce it in one of the examples..
I just got this example:
https://github.com/droolsjbpm/drools/tree/master/drools-examples-api/kiem...
built the 2 dependant projects, kiebase inclusion and namedkiesession.
Then, run the org.drools.example.api.kiemodulemodel.KieModuleModelExample
in my eclipse, and I get the following:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
details.
Exception in thread "main" java.lang.NullPointerException
at
org.drools.compiler.kie.builder.impl.KieBuilderImpl.generateKieModuleMetaInfo(KieBuilderImpl.java:222)
at
org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:194)
at
org.drools.example.api.kiemodulemodel.KieModuleModelExample.go(KieModuleModelExample.java:39)
at
org.drools.example.api.kiemodulemodel.KieModuleModelExample.main(KieModuleModelExample.java:63)
Exactly the same happens when I do the same in my project.
Any ideas?
Thanks!
Demian
10 years, 11 months
How to add generated rules (from templates) to a KB on the fly?
by Shinsekai
Hi,
I use Drools (6.0.0) with KIE-api and I have a method to generate drl rules
from templates+hashmaps. These rules are stored in a List<String>.
Now, I would to pack up these generated rules and make them available to a
preexistant KieSession.
Thus, a KieSession could access to standard KieBases (with rules stored in
resource directories) AND to these generated rules (stored in an object, in
memory).
Is it possible to do that?
I precise I don't want to use org.drools.internal.* classes.
Regards,
Alexandre
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-add-generated-rules-from-templat...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 11 months
KnowledgeAgent fallback FROM local cache?
by dunnlow
I am using drools 5.5 with Guvnor and the Integration Server. My integration
server uses a knowledgeagent that pulls the package from guvnor and I have
set the drools.resource.urlcache for a local cache in case Guvnor is
unavailable.
If Guvnor is available at startup, the KAgent sees any deployed changes to
my package from then on. If guvnor is NOT available, the local cache is
used and everything works fine UNTIL I make a change to Guvnor. The KAgent
seems to never fall back to checking for Guvnor's availability.
I'd like the KnowledgeAgent to use the local cache until Guvnor is available
again. Is there an (existing) way to make this happen?
If not, any thought about implementing a solution?
Thanks,
- J
--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-fallback-FROM-local-cach...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 11 months