Starting from 5.1RC1 you will be able to attach an EventListener to
KnowledgeAgent. You will be able to do the garbage collection after the
agent kbase gets updated.
I don't really know when 5.1RC1 will be available. Does anyone here know?
Best,
2010/7/1 Jeffrey Schneller <jeffrey.schneller(a)envisa.com>
Thanks for the info. Is there any way that you can add a call to
do
garbage collection after the knowledge agent is refreshed? I am noticing
that all my rules stick around for some time until garbage collection is
actually run. If rule packages are huge, modified, and rebuilt quickly the
scanner will pick them up and process them but if garbage collection hasn’t
run after the last refresh then a bunch of stale objects are hanging around.
I tested this by running a memory profile tool. After the rule refresh
occurs all my rule object counts increase by 1. If I force garbage
collection from the profile tool then all the rule object counts drop down
to 1.
Am I doing something wrong?
When do you expect 5.1RC1 to be available?
Thanks.
*From:* rules-users-bounces(a)lists.jboss.org [mailto:
rules-users-bounces(a)lists.jboss.org] *On Behalf Of *Esteban Aliverti
*Sent:* Thursday, July 01, 2010 1:27 PM
*To:* Rules Users List
*Subject:* Re: [rules-users] Drools and Guvnor 5.1M2 -
ExceptionbeingthrowninprocessChangeSet
The other error could be because of a bug I recently fixed:
https://jira.jboss.org/browse/BRMS-320
It should be solved in 5.1RC1 I think.
Best,
2010/7/1 Jeffrey Schneller <jeffrey.schneller(a)envisa.com>
Esteban,
Here is the stack trace for the ClassNotFoundException when the compiler
jar is not included.
java.lang.ClassNotFoundException:
org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at
org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:190)
at
org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.call(ServiceRegistryImpl.java:185)
at
org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:143)
at
org.drools.builder.KnowledgeBuilderFactory.loadServiceFactory(KnowledgeBuilderFactory.java:107)
at
org.drools.builder.KnowledgeBuilderFactory.getKnowledgeBuilderPServiceFactory(KnowledgeBuilderFactory.java:101)
at
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:29)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:556)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:541)
at
org.drools.agent.impl.KnowledgeAgentImpl.incrementalBuildResources(KnowledgeAgentImpl.java:731)
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:515)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:145)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:130)
Any idea on why the other error is appearing. The error is
“java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage”. This occurs when the knowledge
agent is created with the compiled package from the Guvnor for the first
time.
Thank you for all your work and help. Drools is a great package.
Thanks.
*From:* rules-users-bounces(a)lists.jboss.org [mailto:
rules-users-bounces(a)lists.jboss.org] *On Behalf Of *Esteban Aliverti
*Sent:* Thursday, July 01, 2010 8:09 AM
*To:* Rules Users List
*Subject:* Re: [rules-users] Drools and Guvnor 5.1M2 - Exception
beingthrowninprocessChangeSet
Could you please provide us the line number where de ClassNotFoundException
occurs. I think I know what could be happening. When you use incremental
change set processing (newInstance = false), the agent use a kbuilder to
perform some diff between the modified and original resource. The thing is
that the agent always instantiate a kbuilder even if all the resources are
already compiled (which is useless).
Please provide me the line number of the exception, i will start working on
this issue. Meanwhile, as a workaround, add the drools-compiler dependency.
The KAgent was practically rebuilt from scratch since 5.1M1 so these kind
of error were expected ;)
Best,
2010/7/1 Jeffrey Schneller <jeffrey.schneller(a)envisa.com>
As a follow-up, this did work however there are still some problems. The
rules did get pulled into the application and seem to be running but clearly
something is not right.
I needed to include the drools-compiler.jar in my app otherwise I was
getting a ClassNotFoundException. I am pulling a compiled package from the
Guvnor so not sure why I need the compiler jar in my app.
When the rules are pulled into the app I am getting the exception thrown
which is being logged and the app can continue running:
2010-07-01 00:36:14,201 | INFO (MyDroolsListener.java:41) KnowledgeAgent
performing an incremental build of the ChangeSet
2010-07-01 00:36:14,261 | ERROR (MyDroolsListener.java:30)
java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage
2010-07-01 00:36:14,261 | WARN (MyDroolsListener.java:53) KnowledgeAgent:
The resource didn't create any package: [UrlResource path='
http://ruleserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.rule....
']
2010-07-01 00:36:14,271 | INFO (MyDroolsListener.java:41) KnowledgeAgent
incremental build of KnowledgeBase finished and in use
Then if I rebuild the package in the Guvnor then I see the following [the
two lines are repeated for each rule in the package]:
[2010:07:182 00:07:741:debug] BinaryResourceDiffProducerImpl: Comparing
[Rule name=v_32, agendaGroup=MAIN, salience=0, no-loop=false] against [Rule
name=v_32, agendaGroup=MAIN, salience=0, no-loop=false]
[2010:07:182 00:07:741:debug] BinaryResourceDiffProducerImpl: The rules
have different LHS
Thanks
*From:* rules-users-bounces(a)lists.jboss.org [mailto:
rules-users-bounces(a)lists.jboss.org] *On Behalf Of *Esteban Aliverti
*Sent:* Wednesday, June 30, 2010 6:35 PM
*To:* Rules Users List
*Subject:* Re: [rules-users] Drools and Guvnor 5.1M2 - Exception
beingthrownin processChangeSet
The problem seams to happen because the kagent can't access the url.
If you try to access the change set xml using a browser, does the browser
ask you for authentication? I don't know why, but guvnor protect its urls
since 5.1 I think.
So, basically, the error is that guvnor can't read from the url. The same
error happens if you provide a non existent url. I need to open a jira for
this.
As a work around, try doing this:
<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
drools-change-set-5.0.xsd<http://drools.org/drools-5.0/change-setdrool...
>
<add>
<resource basicAuthentication='enabled' username='admin'
password='admin' source='
http://ruleserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.rule....
type='PKG' />
</add>
</change-set>
Remember to replace username and password.
Best,
2010/6/30 Jeffrey Schneller <jeffrey.schneller(a)envisa.com>
Here is the xml file I am getting:
<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
drools-change-set-5.0.xsd<http://drools.org/drools-5.0/change-setdrool...
>
<add>
<resource source='
http://ruleserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.rule....
type='PKG' />
</add>
</change-set>
*From:* rules-users-bounces(a)lists.jboss.org [mailto:
rules-users-bounces(a)lists.jboss.org] *On Behalf Of *Esteban Aliverti
*Sent:* Wednesday, June 30, 2010 3:18 PM
*To:* Rules Users List
*Subject:* Re: [rules-users] Drools and Guvnor 5.1M2 - Exception being
thrownin processChangeSet
Could you please post the xml file you are getting from
http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.rule...
?
Best,
2010/6/30 Jeffrey Schneller <jeffrey.schneller(a)envisa.com>
I am trying to upgrade to the 5.1M2 build from 5.0.1 and am running into
some issues. I have installed the new 5.1 Guvnor and imported the rules
from my 5.0.1 Guvnor instance.
I then removed the old 5.0.1 drools jars from my app and replaced them with
the 5.1M2 drools jars. I was also added all the dependent libraries. The
code that worked with the 5.0.1 version does not work with the 5.1M2
version. In 5.0.1 I was constructing the xml and streaming it into the
applyChangeSet method. With 5.1M2 I am just pointing to the change set xml
file that is in the Guvnor.
I am seeing a NullPointerException being thrown in the processChangeSet
method as shown below.
Caused by: java.lang.NullPointerException
at
org.drools.agent.impl.KnowledgeAgentImpl.processChangeSet(KnowledgeAgentImpl.java:171)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:143)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:130)
Did I miss something? Am I doing something wrong? Below is the code that
I have.
KnowledgeAgentConfiguration kaconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
kaconf.setProperty( "drools.agent.scanDirectories",
"true"
);
kaconf.setProperty("drools.agent.newInstance",
"false");
ResourceFactory.getResourceChangeScannerService().start();
ResourceFactory.getResourceChangeNotifierService().start();
String url = "
http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.rule...
";
KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent( "Configuration", kaconf );
kagent.setSystemEventListener(new MyDroolsListener());
try {
kagent.applyChangeSet(ResourceFactory.newUrlResource(new URL(url)));
// ERROR IS OCCURING INSIDE OF applyChangeSet
} catch (MalformedURLException e) {
e.printStackTrace();
}
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users