Exception during insert
by Ryan Fitzgerald
Hi,
I get the following exception when trying to insert an object from within a rule consequence:
[Error: object is not an instance of declaring class]
The rule is as follows:
rule "Utran Cell Selection Rule"
salience 50
dialect "java"
when
then
UtranCell[] ucells = TopologyService.getInstance().getUtranCells();
for (int i=0; i<ucells.length; i++) {
insert( ucells[i] );
}
end
And it works fine if I replace the insert with System.out.println(ucells[i]) - it seems to be something problematic with the insert. Full trace is below.
I can't see what the problem is...any ideas?
Thanks,
Ryan.
org.drools.runtime.rule.ConsequenceException: [Error: object is not an instance of declaring class]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0]
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:627)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:183)
at com.sample.DroolsTest.main(DroolsTest.java:28)
Caused by: [Error: object is not an instance of declaring class]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0]
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:389)
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:138)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:133)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:104)
at org.mvel2.MVEL.executeExpression(MVEL.java:995)
at org.drools.base.dataproviders.MVELDataProvider.getResults(MVELDataProvider.java:91)
at org.drools.reteoo.FromNode.evaluateAndPropagate(FromNode.java:124)
at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:104)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:117)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:28)
at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:116)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:117)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:28)
at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:116)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:117)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:28)
at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:116)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:117)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:78)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:142)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:146)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1046)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1001)
at org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:114)
at org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:108)
at com.sample.Rule_Utran_Cell_Selection_Rule_0.consequence(Rule_Utran_Cell_Selection_Rule_0.java:9)
at com.sample.Rule_Utran_Cell_Selection_Rule_0ConsequenceInvoker.evaluate(Rule_Utran_Cell_Selection_Rule_0ConsequenceInvoker.java:18)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
... 6 more
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:931)
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:316)
... 36 more
15 years, 12 months
Drools-Spring Error During build
by ramram
Hi All,
I am having the following error while trying to build the drools-spring I
am using Maven to perform the build. Any Idea on what is causing this error.
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'kbase1': Invocation of init method failed; nested exception is
java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at
org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at
org.drools.container.spring.SpringDroolsTest.test1(SpringDroolsTest.java:16)
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:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
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:597)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;
at
org.drools.commons.jci.compilers.EclipseJavaCompiler$3.acceptResult(EclipseJavaCompiler.java:321)
at
org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:446)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:381)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:351)
at
org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:51)
at
org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:389)
at
org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:56)
at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:74)
at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:682)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:645)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:266)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:472)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at
org.drools.container.spring.beans.KnowledgeBaseBeanFactory.afterPropertiesSet(KnowledgeBaseBeanFactory.java:46)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 38 more
--
View this message in context: http://n3.nabble.com/Drools-Spring-Error-During-build-tp455293p455293.html
Sent from the Drools - User mailing list archive at Nabble.com.
16 years
incomplete audit?
by H.C.
I have started capturing audit info for my ruleflow execution and I see
multiple audit files being generated (audit.log, audit1.log and audit2.log).
While each file has content, only audit.log seems to display anything in the
audit view. However, I see the audit info in the viewer seems to end sooner
than my actual execution goes. I can hit breakpoints in later ruleflow
groups than are recorded in the audit. Is that captured in the other files
and if so, how can I load those into the audit view?
--
View this message in context: http://n3.nabble.com/incomplete-audit-tp452071p452071.html
Sent from the Drools - User mailing list archive at Nabble.com.
16 years
Rules categorization/packages
by Amit Kumar
Hello All,
I am looking to organize the rules in different categories. But for
distribution purposes We are creating packages for different
roles/processing phases
So a rule will reside in one pckage but for navigation it can belong to
multiple categories
So packages are like Shirts, Pants, Shoes, Sweaters
Categories are Color, Material, Size, Gender and those have sub categories
witin them
We have rules which will device the category of the item
Like "red rule", "blue rule", "cloth rule", leather rule"
Now the problem we are facing is for category rules is if I define the rule
in Shirt package .. then I will not be able ot use it in Pant package.. Will
have to redefine it.
The other problem in this scenario is If I have a price rule in Shirt
package and the category is "Blue Color" and "XL Size" then I will have to
put it in both categories
When I put the "Blue Rule" on "Blue Category" and "XL Rule" on "XL
Category" and I put the rule in both categories.. will it be an "and"
relationship or will be an "OR"
Regards,
Amit
16 years
Question About Programmatically Creating Drools Rules Remotely
by S. McKee
Hello,
I am running a Drools Guvnor server. While it is not an issue to create
rules through the UI, I do have a need to create rules and packages
through a Java program that I am coding that will connect remotely to
the Guvnor server from another box. Does anyone know if this is this
possible? If so, could I get pointed in the right direction for making
this happen?
Thank You,
Scott McKee
16 years
April 19th Drools Meeting 2 day medical/healthcare exclusive, 3 day general topics
by Mark Proctor
http://blog.athico.com/2010/03/april-19th-drools-meeting-2-day.html
------
April 19th Drools Meeting 2 day medical/healthcare exclusive, 3
day general topics
<http://blog.athico.com/2010/03/april-19th-drools-meeting-2-day.html>
Posted by Mark Proctor
Logistics
What: Week long meeting, with 2 day medical/healthcare exclusive, 1 day
open to all with medical slant, 2 day open to all all general topics.
Where: 10210 Campus Point Drive, San Diego, CA 92121-1598 (SAIC
Corporation Headquarters)
When: Monday the 19th of April to Friday the 23rd of April
Previous Boot Camps: San Francisco June 2009
Registration:
http://community.jboss.org/wiki/DroolsBootCampSanDiegoApril2010
The boot camp is free, you only need to turn up, but please register
here, http://community.jboss.org/wiki/DroolsBootCampSanDiegoApril2010.
This page also is a live and more informed version of the information
contained here - please read it thoroughly.
Who Should Attend: See the registration page above for more detailed
information.
Overview
Mon-Tue (medical only)
The the first two days are exclusive to the medical and healthcare
communities and only people from medical and healthcare organisations or
with a medical background will be allowed to attend.
Wed (medical slant - open to all)
Keynote - James Taylor (Smart Enough Systems) "Smarter systems for
uncertain times".
The third day will still maintain a medical slant, wrapping up the last
two days, but we will open it up for those that want to observe or
participate. We will try and cover topics that will be interesting to
all there, even if not from medical background, just be aware that
medical discussions take priority. It is recommended that most people
start on the Wednesday, especially as we have an excellent keynote
speaker for everyone.
Thu-Fri (general topics - open to all)
The last two days is open to all and will hvae no specific topic. It is
likely we'll repeat a few talks from mon-tue that are relevant to new
comers.
Agenda
Other than the Wednesday keynote with James Taylor, we do not yet have
dates and times allocated for talks, as we are still waiting for all
talks to be proposed. So if you are thinking of talking, hurry up and
let us know :) (see registration page for more info). The registration
page will be kept up to date with talks, and contains information and
ideas on talks we'd like people to give; basically anything you think
people attending will be interested in - it does not have to be drools
specific. The current proposed talks are:
*Name* *Talk*
James Taylor (Smart Enough Systems
<http://www.smartenoughsystems.com/>) *Wed 9am Key Note :* Smarter
systems for uncertain times
Mark Proctor (JBoss) Intro to Drools 5
Mark Proctor (JBoss) Rule Authoring Techniques
Mark Proctor (JBoss) Spring, Camel and OSGi integration
Kris Verlaenen (JBoss)
Building Domain Specific Workflows for Clinical Decision Support
Kris Verlaenen (JBoss) Dynamic Fragments for Non-Linear Execution of
Adaptive Processes
Edson Tirelli (JBoss) Applying Complex Event Processing
Davide Sottara (University of Bologna) Hybrid Ontologies
Davide Sottara (University of Bologna) Enhancing Rules with Uncertainty
and Vagueness
Ken Kawamoto (Duke University) Clinical Decision Support with HL7 and
Drools
16 years
Null Pointer Exception while adding rules
by rulesnubi
Hello,
I'm getting the following exception while add new rules -
java.lang.NullPointerException
at java.util.zip.Inflater.ensureOpen(Inflater.java:325)
at java.util.zip.Inflater.reset(Inflater.java:294)
at java.util.zip.ZipFile.getInflater(ZipFile.java:372)
at java.util.zip.ZipFile.getInputStream(ZipFile.java:320)
at java.util.zip.ZipFile.getInputStream(ZipFile.java:286)
at java.util.jar.JarFile.getInputStream(JarFile.java:387)
at
sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:136)
at java.net.URL.openStream(URL.java:1007)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1161)
at
com.sun.enterprise.loader.EJBClassLoader.getResourceAsStream(EJBClassLoader.java:834)
at
org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1192)
at
org.drools.rule.CompositeClassLoader.getResourceAsStream(CompositeClassLoader.java:86)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:240)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:217)
at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:122)
at
org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:178)
at
org.eclipse.jdt.internal.compiler.lookup.Scope.getPackage(Scope.java:2060)
at
org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference.getTypeBinding(QualifiedTypeReference.java:65)
at
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:153)
at
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType(TypeReference.java:110)
at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype(ClassScope.java:1102)
at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperInterfaces(ClassScope.java:902)
at
org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy(ClassScope.java:948)
at
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:288)
at
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:198)
at
org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:383)
at
org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:397)
at
org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:351)
at
org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:51)
at
org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:389)
at
org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:56)
at
org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:74)
at
org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:690)
at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:653)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:290)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:488)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
This is not even consistent. It works some time and throws up the above
exceptions at times.
I'm using drools v 5.0.1 on glassfish application server. The jdk is - Java
HotSpot(TM) Server VM (build 1.5.0_15-b04, mixed mode)
Anyone have similar experiences?
Thanks,
nubi
--
View this message in context: http://n3.nabble.com/Null-Pointer-Exception-while-adding-rules-tp454453p4...
Sent from the Drools - User mailing list archive at Nabble.com.
16 years
April 19th Boot Camp to be open to all
by Mark Proctor
http://blog.athico.com/2010/03/april-19th-boot-camp-to-be-open-to-all.html
We will now be opening the boot camp up to all, for the last 3 days. The
boot camp was previously announced here
<http://blog.athico.com/2010/03/drools-open-source-healthcare.html>. The
over all schedule is below. I'll be putting up a registration wiki page
up on line in the next day or two, like last years which you can fine
here
<http://community.jboss.org/wiki/DroolsBootCampSanFranciscoJune2009>.
Keep an eye on the blog for more info soon.
We are looking for people that would like to present, take a focus group
or workshop. The topics can be on drools, or how drools is applied, or
on projects that use drools, or just general interesting topics for
rules, workflow, event processing and ontologies - anything you think
the people there would be interested in. Email me if you would like to
present
*Where *- San Diego, CA (meeting place tbc)*
Date *- Monday the 19th of April to Friday the 23rd of April
Schedule
* *Mon-Tue* (medical only) The the first two days are exclusive to
the medical community and only people from medical organisations
or with a medical background will be allowed to attend.
* *Wed* (medical focus - open to all) The third day will still
maintain a medical theme, wrapping up the last two days, but we
will open it up for those that want to observe or participate. We
will try and cover topics that will be interesting to all there,
even if not from medical background, just be aware that medical
discussions take priority.
* *Thu-Fri* (general topics - open to all) The last two days is open
to all and will have no specific topic
16 years