1- Drools 5.1M2
2- I have logs, but Drools isn't showing any error, everything looks fine,
just changes to files are not used.
3- Agent sees the files because is telling me that has found 4 files, but is
not updating them.
This is my change set file:
<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'>
<add>
<resource
source='file://home/mxhero/workspaceMxHero/engine/configurations/drools/rules/'
type='DRL' />
</add>
</change-set>
In that directory i have 3 rules files. Here is the log by drools:
registering core services
core services registered
registering compiler services
compiler services registered
registering api services
registering api : org.drools.io.impl.ResourceFactoryServiceImpl@114025 :
interface org.drools.io.ResourceFactoryService
registering api : org.drools.impl.KnowledgeBaseFactoryServiceImpl@14a9387 :
interface org.drools.KnowledgeBaseFactoryService
registering api :
org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl@2da5a6 :
interface org.drools.builder.KnowledgeBuilderFactoryService
api drools services registered
[2010:06:176 10:06:53:info] ResourceChangeScanner created with default
interval=60
[2010:06:176 10:06:58:info] ResourceChangeScanner reconfigured with
interval=30
[2010:06:176 10:06:66:info] ResourceChangeNotification created
[2010:06:176 10:06:67:info] ResourceChangeNotification scanner has started
[2010:06:176 10:06:100:info] ResourceChangeNotification has started
listening for ChangeSet publications
[2010:06:176 10:06:100:debug] ResourceChangeNotification thread is waiting
for queue update
[2010:06:176 10:06:101:debug] ResourceChangeScanner attempt to scan 0
resources
[2010:06:176 10:06:101:debug] ResourceChangeScanner thread is waiting for 30
seconds.
(null: 3, 88): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.
(null: 3, 88): cvc-elt.1: Cannot find the declaration of element
'change-set'.
(null: 4, 7): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.
(null: 7, 17): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.
java.lang.NoClassDefFoundError: sun/misc/Unsafe
at
org.mvel2.optimizers.dynamic.DynamicClassLoader.<clinit>(DynamicClassLoader.java:39)
at
org.mvel2.optimizers.dynamic.DynamicOptimizer._init(DynamicOptimizer.java:47)
at
org.mvel2.optimizers.dynamic.DynamicOptimizer.init(DynamicOptimizer.java:43)
at
org.mvel2.optimizers.OptimizerFactory.setDefaultOptimizer(OptimizerFactory.java:106)
at org.mvel2.optimizers.OptimizerFactory.<clinit>(OptimizerFactory.java:64)
at
org.drools.rule.builder.dialect.java.AbstractJavaRuleBuilder.<clinit>(AbstractJavaRuleBuilder.java:27)
at
org.drools.rule.builder.dialect.java.JavaDialect.<clinit>(JavaDialect.java:98)
at
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.newDialect(JavaDialectConfiguration.java:65)
at
org.drools.compiler.PackageBuilderConfiguration.buildDialectRegistry(PackageBuilderConfiguration.java:300)
at org.drools.compiler.PackageRegistry.<init>(PackageRegistry.java:24)
at org.drools.compiler.PackageBuilder.newPackage(PackageBuilder.java:853)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:569)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:264)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:456)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:512)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at
org.mxhero.engine.core.internal.pool.InputPool.createAgent(InputPool.java:117)
at org.mxhero.engine.core.internal.pool.InputPool.init(InputPool.java:51)
at org.mxhero.engine.domain.pool.TaskPool.run(TaskPool.java:28)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: sun.misc.Unsafe
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 20 more
[2010:06:176 10:06:456:debug] ResourceChangeNotification monitor added
monitor=org.drools.io.impl.ResourceChangeScannerImpl@1b00766
[2010:06:176 10:06:457:debug] KnowledgeAgent building resource map
[2010:06:176 10:06:457:debug] KnowledgeAgent mapping resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/MailRule.drl']
to KnowledgeDefinition=[Rule name=Mail 2, agendaGroup=MAIN, salience=-2,
no-loop=true]
[2010:06:176 10:06:457:debug] KnowledgeAgent mapping resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/2MailRule.drl']
to KnowledgeDefinition=[Rule name=Mail, agendaGroup=MAIN, salience=0,
no-loop=true]
[2010:06:176 10:06:457:debug] KnowledgeAgent mapping resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/MailRule77.drl']
to KnowledgeDefinition=[Rule name=Mail 77, agendaGroup=MAIN, salience=-1,
no-loop=true]
[2010:06:176 10:06:457:info] KnowledgeAgent created, with configuration:
monitorChangeSetEvents=true scanResources=true scanDirectories=true
newInstance=false
(null: 3, 88): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.
[2010:06:176 10:06:482:info] KnowledegAgent has started listening for
ChangeSet notifications
(null: 3, 88): cvc-elt.1: Cannot find the declaration of element
'change-set'.
(null: 4, 7): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.
(null: 7, 17): schema_reference.4: Failed to read schema document
'drools-change-set-5.0.xsd', because 1) could not find the document; 2) the
document could not be read; 3) the root element of the document is not
<xsd:schema>.
[2010:06:176 10:06:486:info] KnowledgeAgent applying ChangeSet
[2010:06:176 10:06:487:debug] KnowledgeAgent subscribing to
directory=[UrlResource
path='file://home/mxhero/workspaceMxHero/engine/configurations/drools/rules/']
[2010:06:176 10:06:488:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@125ee49 to
resource=[UrlResource
path='file://home/mxhero/workspaceMxHero/engine/configurations/drools/rules/']
[2010:06:176 10:06:489:debug] ResourceChangeScanner subcribing
notifier=org.drools.io.impl.ResourceChangeNotifierImpl@19a6087 to
resource=[UrlResource
path='file://home/mxhero/workspaceMxHero/engine/configurations/drools/rules/']
[2010:06:176 10:06:490:debug] KnowledgeAgent mapping resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/MailRule.drl']
to KnowledgeDefinition=null
[2010:06:176 10:06:490:debug] KnowledgeAgent notifier subscribing to
resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/MailRule.drl']
[2010:06:176 10:06:490:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@125ee49 to
resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/MailRule.drl']
[2010:06:176 10:06:490:debug] ResourceChangeScanner subcribing
notifier=org.drools.io.impl.ResourceChangeNotifierImpl@19a6087 to
resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/MailRule.drl']
[2010:06:176 10:06:491:debug] KnowledgeAgent mapping resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/2MailRule.drl']
to KnowledgeDefinition=null
[2010:06:176 10:06:491:debug] KnowledgeAgent notifier subscribing to
resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/2MailRule.drl']
[2010:06:176 10:06:491:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@125ee49 to
resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/2MailRule.drl']
[2010:06:176 10:06:491:debug] ResourceChangeScanner subcribing
notifier=org.drools.io.impl.ResourceChangeNotifierImpl@19a6087 to
resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/2MailRule.drl']
[2010:06:176 10:06:491:debug] KnowledgeAgent mapping resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/MailRule77.drl']
to KnowledgeDefinition=null
[2010:06:176 10:06:491:debug] KnowledgeAgent notifier subscribing to
resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/MailRule77.drl']
[2010:06:176 10:06:491:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@125ee49 to
resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/MailRule77.drl']
[2010:06:176 10:06:492:debug] ResourceChangeScanner subcribing
notifier=org.drools.io.impl.ResourceChangeNotifierImpl@19a6087 to
resource=[FileResource
file='/home/mxhero/workspaceMxHero/engine/configurations/drools/rules/MailRule77.drl']
[2010:06:176 10:06:492:debug] KnowledgeAgent rebuilding KnowledgeBase using
ChangeSet
[2010:06:176 10:06:492:info] KnowledgeAgent performing an incremental build
of the ChangeSet
[2010:06:176 10:06:498:debug] KnowledgeAgent adding KnowledgePackages from
KnowledgeBuilder
[2010:06:176 10:06:498:info] KnowledgeAgent incremental build of
KnowledgeBase finished and in use
[2010:06:176 10:06:498:debug] KnowledgeAgent finished rebuilding
KnowledgeBase using ChangeSet
after 30 seconds waiting for update i get this one:
[2010:06:176 10:06:101:debug] ResourceChangeScanner attempt to scan 4
resources
[2010:06:176 10:06:101:debug] ResourceChangeScanner scanning
directory=[UrlResource
path='file://home/mxhero/workspaceMxHero/engine/configurations/drools/rules/']
[2010:06:176 10:06:103:debug] ResourceChangeScanner thread is waiting for 30
seconds.
Changes betweens time for update are not reflected.
I know I am probably doing something wrong in the way I am setting the
agent, because i just took the OSGI example and added the agent to it. Any
advice how setting the agent in the right way will be great.
Thanks
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/KnowledgeAgent-and-OS...
Sent from the Drools - User mailing list archive at
Nabble.com.