Drools Fusion (CEP) & event life cycle
by Ephemeris Lappis
Hello.
I'm testing event processing in Drools, and after some basic tests, I have
some questions about event life cycle management.
According to the documentation, in stream mode, events may be automatically
discarded by the engine when no rule, currently or in the future, applies to
them.
In the following rule set (at the end of my post), the rule named
"Processing new alert event" is expected to be executed when a new 'alert'
notification event arrives and no previous alert exists. After an elementary
test, the first matching notification produces the expected behavior and
generates the Alert. But if a second matching notification is inserted, the
rule is ignored as expected, since the Alert is already set, but the event
object seems to be put durably in memory. When a 'stop' notification is
inserted, the Alert object is cleared by the rule "Processing stop event
after alert", as expected, but the second 'alert' notification that should
be forgotten is raised from the memory and the first rule is fired again,
creating an undesired second Alert.
I've tried a workaround adding an "opposite rule" to check the processing of
an 'alert' notification when there is a current Alert. As at the moment the
notification object is inserted the two rules are candidate in the agenda,
both are executed. I suppose I could try, for example, adding salience
values to make the rules execute in a deterministic order...
As you can see, I've added explicit deletion of the notification objects in
the rules, and all seems to work as needed. But it seems really a bit
cimplicated, and contradictory with the documentation...
What did I miss ?
Thanks for your help.
Regards?
Here the rule set :
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Fusion-CEP-event-life-cycle-tp40...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
NPE in LeftTupleSetsImpl.removeUpdate
by David Zeigler
Hi,
I'm using drools 6.0.1.Final. I received a NPE in the
org.drools.core.common.LeftTupleSetsImpl.removeUpdate() method on line
172, which
corresponds to this line for 6.0.1.Final:
previous.setStagedNext( next );
I see 2 commits in 6.1.0 to address NPEs in this class but I'm not sure if
either of those cover this particular NPE. I'm unable to reproduce this
issue with my code after the first occurrence. Does anyone know if this
has been fixed in 6.1.0? Please let me know if I can provide additional
info or if I should open a defect in Jira.
Thanks,
David
Here is the stack trace:
java.lang.NullPointerException
at
org.drools.core.common.LeftTupleSetsImpl.removeUpdate(
LeftTupleSetsImpl.java:172)
at
org.drools.core.common.LeftTupleSetsImpl.addDelete(
LeftTupleSetsImpl.java:84)
at
org.drools.core.common.SynchronizedLeftTupleSets.addDelete(
SynchronizedLeftTupleSets.java:20)
at
org.drools.core.reteoo.LeftInputAdapterNode.doDeleteSegmentMemory(
LeftInputAdapterNode.java:339)
at
org.drools.core.reteoo.LeftInputAdapterNode.doDeleteObject(
LeftInputAdapterNode.java:301)
at
org.drools.core.reteoo.LeftInputAdapterNode.retractLeftTuple(
LeftInputAdapterNode.java:417)
at
org.drools.core.reteoo.ObjectTypeNode.doRetractObject(
ObjectTypeNode.java:352)
at
org.drools.core.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:335)
at
org.drools.core.reteoo.EntryPointNode.retractObject(EntryPointNode.java:395)
at
org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:605)
at
org.drools.core.common.AbstractWorkingMemory.delete(
AbstractWorkingMemory.java:1184)
at
org.drools.core.common.AbstractWorkingMemory.delete(
AbstractWorkingMemory.java:1176)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(
StatefulKnowledgeSessionImpl.java:316)
11 years, 6 months
Trying to load a module from Maven coordinates
by david.berkman
Using Maven 3.2.1 and Drools 6.0.1, I'm trying to simply follow the
instructions for loading a container with a jar at a set of maven
coordinates. I have confirmed that the jar exists at the specified
coordinates (in Nexus), and that I can download it without using a
username/password (just an http get), and that the jar does contain both
.drl files and a /META-INF/kmodule.xml. I'm using the code below, and have
added the extra dependencies listed, but I get the errors shown below all
that. First off, working out the proper dependencies is no mean feat, when
it seems that just kie-ci should be necessary. What a pain, and there is far
too little documentation to help. But, I assume this should be possible, and
maybe some kind person out there has the magic combination of Drools, Maven,
and jars to make it work?
Thanks in advance,
David
KieServices kieServices = KieServices.Factory.get();
kieServices.newKieContainer(kieServices.newReleaseId("<groupId>",
"<artifactId>", "<version>"));
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-ci</artifactId>
<version>6.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-aether-provider</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.17</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-impl</artifactId>
<version>0.9.0.M2</version>
</dependency>
2014-03-07T15:29:50.368-0800 Sisu WARN (.:) [main] - Error injecting:
org.eclipse.aether.internal.impl.DefaultRepositorySystem
Exception in thread com.google.inject.ConfigurationException: Guice
configuration errors:
1) No implementation for org.eclipse.aether.impl.ArtifactDescriptorReader
was bound.
while locating org.eclipse.aether.impl.ArtifactDescriptorReader
for parameter 4 at
org.eclipse.aether.internal.impl.DefaultRepositorySystem.<init>(Unknown
Source)
while locating org.eclipse.aether.internal.impl.DefaultRepositorySystem
2) No implementation for org.eclipse.aether.impl.VersionRangeResolver was
bound.
while locating org.eclipse.aether.impl.VersionRangeResolver
for parameter 1 at
org.eclipse.aether.internal.impl.DefaultRepositorySystem.<init>(Unknown
Source)
while locating org.eclipse.aether.internal.impl.DefaultRepositorySystem
3) No implementation for org.eclipse.aether.impl.VersionResolver was bound.
while locating org.eclipse.aether.impl.VersionResolver
for parameter 0 at
org.eclipse.aether.internal.impl.DefaultRepositorySystem.<init>(Unknown
Source)
while locating org.eclipse.aether.internal.impl.DefaultRepositorySystem
3 errors
at
com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:991)
at
com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:950)
at
com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
at
org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at
com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
at
com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
at
com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
at
com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at
com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at
com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at
com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
at
com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at
com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at
com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at
org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at
org.eclipse.sisu.plexus.PlexusRequirements$RequirementProvider.get(PlexusRequirements.java:250)
at
org.eclipse.sisu.plexus.ProvidedPropertyBinding.injectProperty(ProvidedPropertyBinding.java:48)
at
org.eclipse.sisu.bean.BeanInjector.injectMembers(BeanInjector.java:52)
at
com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:128)
at
com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:117)
at
com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
at
com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:91)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
at
com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at
com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:89)
at
com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:259)
at
com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at
com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
at
org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at
com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
at
com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
at
com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
at
com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at
com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at
com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at
com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
at
com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at
com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at
com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at
org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at
org.eclipse.sisu.plexus.PlexusRequirements$RequirementProvider.get(PlexusRequirements.java:250)
at
org.eclipse.sisu.plexus.ProvidedPropertyBinding.injectProperty(ProvidedPropertyBinding.java:48)
at
org.eclipse.sisu.bean.BeanInjector.injectMembers(BeanInjector.java:52)
at
com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:128)
at
com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:117)
at
com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
at
com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:91)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
at
com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at
com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:89)
at
com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:259)
at
com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at
com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
at
org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at
com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
at
com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
at
com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
at
com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at
com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at
com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at
com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
at
com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at
com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at
com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at
org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at
org.eclipse.sisu.plexus.PlexusRequirements$RequirementProvider.get(PlexusRequirements.java:250)
at
org.eclipse.sisu.plexus.ProvidedPropertyBinding.injectProperty(ProvidedPropertyBinding.java:48)
at
org.eclipse.sisu.bean.BeanInjector.injectMembers(BeanInjector.java:52)
at
com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:128)
at
com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:117)
at
com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
at
com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:91)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
at
com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at
com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:89)
at
com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:259)
at
com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at
com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
at
org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at
com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
at
com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
at
com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at
org.eclipse.sisu.plexus.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:133)
at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:108)
at
com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at
com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at
com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at
com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1018)
at
com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at
com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at
com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at
org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:260)
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:252)
at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:246)
at org.kie.scanner.embedder.MavenEmbedder.lookup(MavenEmbedder.java:527)
at
org.kie.scanner.embedder.MavenEmbedder.buildMavenExecutionRequest(MavenEmbedder.java:152)
at org.kie.scanner.embedder.MavenEmbedder.<init>(MavenEmbedder.java:115)
at org.kie.scanner.embedder.MavenEmbedder.<init>(MavenEmbedder.java:104)
at org.kie.scanner.embedder.MavenEmbedder.<init>(MavenEmbedder.java:131)
at
org.kie.scanner.embedder.MavenProjectLoader.parseMavenPom(MavenProjectLoader.java:18)
at
org.kie.scanner.embedder.MavenProjectLoader.loadMavenProject(MavenProjectLoader.java:48)
at org.kie.scanner.Aether.<init>(Aether.java:44)
at org.kie.scanner.Aether.getAether(Aether.java:54)
at
org.kie.scanner.MavenRepository.getMavenRepository(MavenRepository.java:45)
at org.kie.scanner.ArtifactResolver.<init>(ArtifactResolver.java:25)
at
org.kie.scanner.KieRepositoryScannerImpl.getArtifactResolver(KieRepositoryScannerImpl.java:67)
at
org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:88)
at
org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:83)
at
org.drools.compiler.kie.builder.impl.KieRepositoryImpl.loadKieModuleFromMavenRepo(KieRepositoryImpl.java:113)
at
org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:99)
at
org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:76)
at
org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:84)
at
com.icix.neutrino.bedrock.predicate.drools.extras.spring.KieScannedContainerCacheInitializingBean.afterPropertiesSet(KieScannedContainerCacheInitializingBean.java:44)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
at com.icix.neutrino.terminus.hub.Foo.<clinit>(Foo.java:19)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)
2014-03-07T15:29:50.379-0800 Sisu WARN (.:) [main] - Error injecting:
org.apache.maven.artifact.resolver.DefaultArtifactResolver
Exception in thread com.google.inject.ProvisionException: Guice provision
errors:
1) No implementation for org.eclipse.aether.impl.ArtifactDescriptorReader
was bound.
while locating org.eclipse.aether.impl.ArtifactDescriptorReader
for parameter 4 at
org.eclipse.aether.internal.impl.DefaultRepositorySystem.<init>(Unknown
Source)
while locating org.eclipse.aether.internal.impl.DefaultRepositorySystem
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
while locating org.eclipse.aether.RepositorySystem
while locating org.apache.maven.artifact.resolver.DefaultArtifactResolver
2) No implementation for org.eclipse.aether.impl.VersionRangeResolver was
bound.
while locating org.eclipse.aether.impl.VersionRangeResolver
for parameter 1 at
org.eclipse.aether.internal.impl.DefaultRepositorySystem.<init>(Unknown
Source)
while locating org.eclipse.aether.internal.impl.DefaultRepositorySystem
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
while locating org.eclipse.aether.RepositorySystem
while locating org.apache.maven.artifact.resolver.DefaultArtifactResolver
3) No implementation for org.eclipse.aether.impl.VersionResolver was bound.
while locating org.eclipse.aether.impl.VersionResolver
for parameter 0 at
org.eclipse.aether.internal.impl.DefaultRepositorySystem.<init>(Unknown
Source)
while locating org.eclipse.aether.internal.impl.DefaultRepositorySystem
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
while locating org.eclipse.aether.RepositorySystem
while locating org.apache.maven.artifact.resolver.DefaultArtifactResolver
--
View this message in context: http://drools.46999.n3.nabble.com/Trying-to-load-a-module-from-Maven-coor...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
Usage of the jcr2vfs migration tool
by dstern
Are there instructions anywhere for using the jcr2vfs migration tool?
I pruned my JCR repository (created under Guvnor 5.6.0.Final) until the
migration tool ran without error (which meant archiving all my brl format
assets among other things) but I'm not sure what to do with the output.
I copied the contents of outputVfs to my existing .niogit folder (leaving
the .niogit generated by the migration tool alone) but the migrated
repository doesn't show up. Is this because I didn't replace my existing
.niogit with the one generated by the tool?
--
View this message in context: http://drools.46999.n3.nabble.com/Usage-of-the-jcr2vfs-migration-tool-tp4...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
Including repository in a WAR file
by ilguapo
I'm using Drools 5.3.0
I'd like to find out if the following scenario is possible:
- Include the repository_export.zip file inside my application WAR file.
This way, Guvnor won't be necessary.
- Provide a special upload page just like Guvnor's Import/Export to upload a
completely new repository_export.zip file when rules have changed.
I haven't been able to find a way to read a repository_export.zip file with
the current API. They only talk about drl, pkg, etc..etc but no zip files.
I could potentially take the zip file, unzip it to an XML and maybe read
this file??
Any ideas would be really helpful.
Regards,
Ilguapo
--
View this message in context: http://drools.46999.n3.nabble.com/Including-repository-in-a-WAR-file-tp40...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 6 months
Drools 6.0.1: Pushing changes back to Workbench GIT using SSH
by dotrc
I am using workbench for managing my rules maven projects within the embedded
GIT repository. I am aware that using git:// protocol, I can clone an
existing rule repository; I can do this successfully.
For authoring rules, I want to use Eclipse (using EGit). I want to push my
commits back to the GIT repo. I understand that I'll have to use ssh
protocol instead of git for specifying the repo, something like this:
ssh://{userName}@localhost:8001/{repoName}
When we use a standard GIT repo like stash, it gives us an option to set our
public key on the stash server, but I'm not able to find a way to do that
with the embedded ssh server within workbench. Hence, I'm not able to
authenticate myself and perform a push.
We tried creating a private-public key pair using ssh-keygen and put that
within c:\users\<username>\.ssh and added the public key to
'authorized_keys(2) (though I know this may not be the right place) and then
used the private key as the identity file with ssh client directly from
cygwin, again to no avail.
Any pointers will be really appreciated.
Also, should the username be 'admin' or any other specific one for pushing?
Will the existing Windows username work?
Thanks,
Rishi
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-6-0-1-Pushing-changes-back-to-Wo...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Drools 5.6.0.Final PKG vs DRL infinite loop
by gboro54
We are using drools 5.6.0.Final and the same version of Guvnor. When we run
the source file of a package from Guvnor everything works as expected. When
we take the same rules and create a package we get stuck in an infinite loop
of rules firing(I have a listener logging every time a rule is
created/fired). Why would there be a difference if the rules don't change
between the source and the pkg?
We build the kbase as follows:
KnowledgeBuilderConfiguration config = KnowledgeBuilderFactory
.newKnowledgeBuilderConfiguration();
config.setOption(PropertySpecificOption.ALWAYS);
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory
.newKnowledgeBuilder(config);
for (ResourcePair pair : pairs) {
/* kbuilder.add(
ResourceFactory.newClassPathResource("rule-sets/2014/feb/"+pair.resourceName),
ResourceType.getResourceType(pair.resourceType));*/
kbuilder.add(
ResourceFactory.newClassPathResource(pair.resourceName),
ResourceType.getResourceType(pair.resourceType));
}
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size() > 0) {
StringBuilder sb = new StringBuilder();
for (KnowledgeBuilderError error : errors) {
sb.append(error + "\n");
System.out.println(sb);
}
throw new IllegalArgumentException("Could not parse knowledge.
\n"
+ sb);
}
this.knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase();
this.knowledgeBase
.addKnowledgePackages(kbuilder.getKnowledgePackages());
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-5-6-0-Final-PKG-vs-DRL-infinite-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Conflict resolution strategy - before vs after Phreak impl
by mikerod
In version 5.x of Drools I see that it offered configurable conflict resolver
strategies. I also read a few different Drools documentation sources that
discussed varieties of "complex" conflict resolution strategies. One source
discussed a tiered implementation by the name of CompositeConflictResolver -
which was @ http://legacy.drools.codehaus.org/Conflict+Resolution.
We have been experimenting with uplifting from Drools v5.6.0.Final to a v6.x
version and we noted a fairly significant performance degradation /(a)/.
When digging into some rule logging,
we found that the issue was that our rule load order was not behaving well
in terms of conflict resolution. The "wrong" rule activations were chosen
to go first on the agenda, and this
was causing a lot of unnecessary/redundant "movement" within the Rete
network.
After reading through the documentation on conflict resolution strategies
and noting that it was configurable in Drools v5.x, I started thinking more
about the importance a conflict resolution strategy on performance. Digging
deeper, I believe Drools v5.6.0.Final uses
`org.drools.core.conflict.DepthConflictResolver` as the default resolver
(which is not the CompositeConflictResolver mentioned above interestingly).
In Drools v6.x (around v6.2.x I believe) with Phreak enabled, there is a
`org.drools.core.conflict.PhreakConflictResolver` that is used as the
default resolver.
This raises a few questions:
/1)/ With Phreak enabled, it looks like the conflict resolver is *not*
configurable anymore. I believe this is the case due to these lines
<https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/jav...>
. Why was this configuration options removed?
/2)/ The PhreakConflictResolver does not seem to be doing anything very
sophisticated now. I gather that it respects salience first, then falls
back to rule load order. I found this around these lines
<https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/jav...>
. Why was this implementation chosen? Is it discussed or documented
anywhere? Was it determined that this performs better than anything else or
that there is no significant difference either way? There are about 4
conflict resolver impls in the org.drools.core.conflict package. In Drools
v5.6.x I saw there were 10-11 of them in the similarly purposed
org.drools.conflict package.
/3)/ (related to /(2)/) Why was the default conflict resolution strategy
changed to PhreakConflictResolver from the DepthConflictResolver used in
v5.6.x? I do not think they are the same based on the source code, however,
I cannot say I fully understand all of the semantics of the
`Activation#getActivationNumber` used in the DepthConflictResolver.
I know that my perf issue /(a)/ noted above could be solved by using
salience, etc. I was wanting to avoid using salience where possible as it
leads to more fragile, less declarative systems. We were able to fix the
perf issue, by simply changing the rule load order anyways. My question is
not specifically asking how to deal with this perf issue. Instead I'm
asking about Drools choice of conflict resolution strategy in v6, as I have
listed in points /1-3/ above.
In the blog post @
http://blog.athico.com/2013/11/rip-rete-time-to-get-phreaky.html,
I think the sentence,
/"A simple heuristic, based on the rule most likely to result in firings, is
used to select the next rule for evaluation; this delays the evaluation and
firing of the other rules."/
is the only thing I see on the topic of conflict resolution (at least I
think it is). I understand the parts about unlinked and linked rules,
however, when the agenda is populated by multiple activations of the same
salience, that's when things get interesting from the point of view of the
topic discussed here.
I appreciate any feedback with regards to this.
--
View this message in context: http://drools.46999.n3.nabble.com/Conflict-resolution-strategy-before-vs-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months
Slf4j Log4j logger not working with Drools drl while using as a global variable.
by Soumya.plavaga
I am using global slf4j log4j logger as a global variable within our drl and
inserting that global logger value at runtime into kiesession. While we are
trying to do logger.info with multiple arguments then it's giving the
following exception stack trace -
Exception executing consequence for rule "Test Logger 2" in
test.rules.system: java.lang.RuntimeException: cannot invoke method: info
at
org.drools.core.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at
org.drools.core.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1027)
at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:129)
at
org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:71)
at
org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:935)
at
org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1200)
at
org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:952)
at
org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:926)
at
org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:232)
at
test.platform.rules.executor.service.impl.RuleExecutorServiceImplTest.testExecuteRule(RuleExecutorServiceImplTest.java:230)
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.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at
org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
at
org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:232)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
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.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:175)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.RuntimeException: cannot invoke method: info
at
org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.getValue(MethodAccessor.java:63)
at
org.mvel2.optimizers.impl.refl.nodes.VariableAccessor.getValue(VariableAccessor.java:37)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:86)
at
org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)
at org.mvel2.MVEL.executeExpression(MVEL.java:930)
at
org.drools.core.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:107)
at
org.drools.core.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1016)
... 36 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at
org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.executeAll(MethodAccessor.java:140)
at
org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.getValue(MethodAccessor.java:48)
... 44 more
Example: My drl file looks like this -
package test.system.rule;
import test.platform.model.*;
import org.slf4j.Logger;
global Logger logger;
rule "Test Logger 1"
when
then
logger.info("within test logger 1");
end
rule "Test Logger 2"
when
then
logger.info("within test logger 2. Rule fired {}",
drools.getRule().getName());
end
While rules are firing then the first logger is getting printed into console
but second one is not getting printed and giving the above exception to me.
--
View this message in context: http://drools.46999.n3.nabble.com/Slf4j-Log4j-logger-not-working-with-Dro...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 7 months