java.lang.NoSuchMethodError on every Action node
by Ana F Santos
Hi everyone.
I've been trying to use Drools for the past month, and sometimes I have
problems I can't guess anymore how to solve.
This time, every action I try to insert in a ruleflow, I receive a
java.lang.NoSuchMethodError. I'm even trying a really simple ruleflow with
just one simple action - like System.out.println("Test"); - and all I get
is a java.lang.NoSuchMethodError.
[
The stack trace:
java.lang.NoSuchMethodError:
br.com.pst.packages.ruleflows.Process_br_com_pst_packages_ruleflows_0.action0(Lorg/drools/spi/KnowledgeHelper;Lorg/drools/spi/ProcessContext;)V
at
br.com.pst.packages.ruleflows.Process_br_com_pst_packages_ruleflows_0Action0Invoker.execute(
Process_br_com_pst_packages_ruleflows_0Action0Invoker.java:20)
at
org.drools.workflow.instance.node.ActionNodeInstance.internalTrigger(
ActionNodeInstance.java:54)
at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(
NodeInstanceImpl.java:111)
at
org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(
NodeInstanceImpl.java:142)
at
org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(
NodeInstanceImpl.java:128)
at
org.drools.workflow.instance.node.StartNodeInstance.triggerCompleted(
StartNodeInstance.java:49)
at
org.drools.workflow.instance.node.StartNodeInstance.internalTrigger(
StartNodeInstance.java:41)
at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(
NodeInstanceImpl.java:111)
at
org.drools.ruleflow.instance.RuleFlowProcessInstance.internalStart(
RuleFlowProcessInstance.java:16)
at org.drools.process.instance.impl.ProcessInstanceImpl.start(
ProcessInstanceImpl.java:185)
at
org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.start(
WorkflowProcessInstanceImpl.java:230)
at org.drools.common.AbstractWorkingMemory.startProcess(
AbstractWorkingMemory.java:1639)
at org.drools.common.AbstractWorkingMemory.startProcess(
AbstractWorkingMemory.java:1604)
at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(
StatefulKnowledgeSessionImpl.java:267)
at br.com.pst.packages.ServicePackages.main(
ServicePackages.java:99)
]
Actually, the beginning problem was with my project, with a process and
subprocess. The subprocess works fine, but the main process throws a
java.lang.NoSuchMethodError always on any node I put after a specific
RuleFlowGroup node. Everyting used to work before, but when I begin to
enlarge it, nothing seems to work anymore. And, as I told, I can't always
guess the exact problem as the thrown exceptions are very generic.
Hope anyone could help me!
Thanks a lot
ANA FLÁVIA FONSECA DOS SANTOS
Analista de Desenvolvimento de Software
PST Eletrônica S/A
Phone: +55 19 3787 6379
aflavia(a)pst.com.br
www.pst.com.br
www.positron.com.br
14 years, 2 months
Debug as within Eclipse
by chris richmond
I used the upate site to update my Eclipse Galileo IDE with the drools
tools, created a new drools project, had it add the hello/goodbye test class
and pointed my workspace to the 5.1M binaries. It runs fine, but when I
Debug As -> Drools Application I get the following errors. I get this error
for any drools project I try to debug as Drools application within Eclipse.
Any ideas?
Thanks,
CHris
FATAL ERROR in native method: JDWP No transports initialized,
jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized
[../../../src/share/back/debugInit.c:690]
14 years, 2 months
MVEL strict mode -- when, why?
by Barry Kaplan
I have never gotten any of my rules to compile using mvel strict mode. If I
leave the default I get spews of error messages that I can't make any sense
of. For example with:
---
package systeminsights.plugin.core.schedule
rule "foo"
when
eval(true)
then
// noop
end
---
I get messages like
[Error: Failed to compile: 3 compilation error(s):
- (1,21) unqualified type in strict mode for: plugin
- (1,26) unqualified type in strict mode for: core
- (1,35) unqualified type in strict mode for: schedule]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0]
If I set strict mode to false all is good.
So, what is actually going on with strict mode? And how does one interpret
messages such as the above?
-barry
--
View this message in context: http://n3.nabble.com/MVEL-strict-mode-when-why-tp95666p95666.html
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 3 months
Drools Roadmap - Planned Release 5.1 release date
by McDonald, Daniel
Hi,
I was wondering if there is a planned release date for Release 5.1?
Thank you,
Daniel McDonald
Fidelity National Information Services - Research & Development
Office phone: (972) 691-6593
Mobile phone (214) 697-8163
_____________
The information contained in this message is proprietary and/or confidential. If you are not the
intended recipient, please: (i) delete the message and all copies; (ii) do not disclose,
distribute or use the message in any manner; and (iii) notify the sender immediately. In addition,
please be aware that any message addressed to our domain is subject to archiving and review by
persons other than the intended recipient. Thank you.
_____________
14 years, 4 months
ANT Compile issues
by Bhamidi, Krishna
Hi,
I am using DROOLs 5.0.0 CR1 and use the compiler from Drools-Ant. When I attempt to execute the rules using a rule agent, I get an exception that in part reads
java.lang.NullPointerException
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1820)
(Full stack follows this e-mail.) However, when I download the pkg file for the same ruleset from Guvnor and use it in the rule agent, it runs fine.
I use the following for building -
<taskdef name="compiler" classname="org.drools.contrib.DroolsCompilerAntTask" classpathref="compiler.classpath" />
<compiler srcdir="../${rulesDirectory}" tofile="../${buildDirectory}/${projectName}_rules.pkg"
classpath="../${buildDirectory}/${projectName}_rules.jar"
binformat="package">
<include name="*.drl" />
<include name="*.brl" />
<include name="*.xml" />
<include name="*.dslr" />
<include name="*.xls" />
</compiler>
What I should do to compile correctly?
Full Stack
java.lang.NullPointerException
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1820)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.drools.rule.DialectRuntimeRegistry.readExternal(DialectRuntimeRegistry.java:41)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.drools.rule.Package.readExternal(Package.java:197)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:189)
at org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:158)
at org.drools.agent.FileScanner.readPackage(FileScanner.java:136)
at org.drools.agent.FileScanner.getChangeSet(FileScanner.java:82)
at org.drools.agent.FileScanner.loadPackageChanges(FileScanner.java:56)
at org.drools.agent.DirectoryScanner.loadPackageChanges(DirectoryScanner.java:69)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:410)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:362)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:347)
at org.drools.agent.RuleAgent.init(RuleAgent.java:247)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:187)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:147)
14 years, 4 months
Extending the "validation of rules" functionality in Guvnor
by Premkumar Stephen
Hello everyone,
Currently, the validate functionality ensures that rules have proper
syntax.
it is possible to extend this functionality so that business use cases might
also be validated? Is there an API/examples to do that.
For eg, in our domain, an object X can be evaluated for 3 criteria ( a, b,
c )
However, we would need to prevent rules written which combine criteria b and
c
Rules can have the combinations ( a,b,c, ab, ac ). Combinations ( bc and abc
) should not be allowed.
Regards,
Prem
14 years, 5 months
Issue with drools-flow/persistence
by Daniel Ilkovich
I'm stumped. I'm trying to implement persistence with Drools-flow, and I'd
like to grab the value of a property on a workitem / processinstance, but
everytime I try to get the workitem or process instance I end up with the
stack trace below.
I'm walking through the source and from what I can tell, this happens
anytime I try and grab a property that is annotated with @Lob in an entity
class.
My environment is hibernate/mysql/JPA persistence using BTM as a transaction
manager.
These are the relevant lines of code:
ksession =
JPAKnowledgeService.loadStatefulKnowledgeSession(ksession.getId(), m_kbase ,
null, m_environment);
m_pi = ksession.getProcessInstance(m_pi.getId());
What am I doing wrong?
<pre>
<code>
java.lang.NullPointerException
at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:89)
at
org.drools.persistence.processinstance.ProcessInstanceInfo.getProcessInstance(ProcessInstanceInfo.java:135)
at
org.drools.persistence.processinstance.JPAProcessInstanceManager.getProcessInstance(JPAProcessInstanceManager.java:62)
at
org.drools.common.AbstractWorkingMemory.getProcessInstance(AbstractWorkingMemory.java:1793)
at
org.drools.impl.StatefulKnowledgeSessionImpl.getProcessInstance(StatefulKnowledgeSessionImpl.java:261)Hibernate:
select at
org.drools.command.runtime.process.GetProcessInstanceCommand.execute(GetProcessInstanceCommand.java:29)
at
org.drools.command.runtime.process.GetProcessInstanceCommand.execute(GetProcessInstanceCommand.java:12)
at
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:254)
at
org.drools.command.impl.CommandBasedStatefulKnowledgeSession.getProcessInstance(CommandBasedStatefulKnowledgeSession.java:95)
at
com.thoughtvine.tracks.workflow.TracksFlow.getParameterFromWorkItem(TracksFlow.java:182)
at
com.thoughtvine.tracks.workflow.test.TestTracksFlow.testGetWorkItem(TestTracksFlow.java:118)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
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)
</code>
</pre>
14 years, 6 months
Performance of compiler
by Christian Nedregård
Hi.
My environment: Win XP SP3, 2x2.13 GHz cpu, 3GB RAM, Drools 4.0.7, JDK
1.4.2_11, java compiler: JANINO, dialect: java.
We have about 850 drl's with 5 - 10 conditions in each. 0 -2 evals in each.
The drl's only contain one rule each.
We are using Drools programatically by compiling the drls using
PackageBuilder.addPackageFromDrl and adding them to a RuleBase using
RuleBase.addPackage(PackageBuilder.getPackage())
When we are building our rule base we are never able to compile more than 1
-2 rules per second, which means we need over 10 minutes (at 100% cpu) to
build our rulebase.
Profiling shows 68% cpu time in
org.drools.rule.builder.GroupElementBuilder.build and 18% cpu time in
org.codehaus.janino.Compiler.compile.
We have experimented by changing the compiler to ECLIPSE and the dialect to
mvel but the results are the same.
We have experimented using one PackageBuilder instance per drl or grouping
drls by package and sharing a builder per package. Same result in both
scenarios.
We have also expermimented with compiling concurrently in serveral threads.
Again, about the same result.
My question is: Is this the performance we can expect from the compiler or
are we doing something fundamentally wrong?
Below is an example of one of our drls. This one contains no evals, but
still takes more than 1 second to compile. If anyone can spot some issues
with the way we are doing things the feedback would be much apreciated :)
------------------------------------
package domain.core.productoffer.rules.subscriptiontype
import type.productoffer.ProductOfferRuleEvent
import domain.core.subscription.Subscription
import domain.core.subscription.SubscribedService
import type.subscription.ActionTypeEnum
import domain.core.productoffer.ProductOffer
import domain.rules.RuleEvent
global domain.core.productoffer.RuleValidationReport validationResult
rule "RequiredVProducts"
when
ProductOfferRuleEvent(id == '3')
ProductOffer(id.value == 31963)
$subscription:Subscription()
not ( SubscribedService(status != ActionTypeEnum.REMOVE_CANCEL &&
productId.value in (57, 69) ) from
$subscription.getAllChildSubscribedServices())
then
validationResult.addValidationMessage("2069", "For product offer
rule event with id '3' and product offer with id=31963 subscription must
have one of the following VProducts: 57, 69.");
end
------------------------------------
Regards
Christian Nedregård
14 years, 6 months
confused on when to call fireAllRules
by Charles Binford
Hi, I'm trying to add some functionality to my 4.0.7 based project and
am realizing I don't understand some basics as well as I thought I did.
Until now, I've been using a very simple model: create session, insert
facts, fire rules, destroy session. My new functionality needs to use a
long lived session. I also may find the duration feature useful so I
searched through the examples and found the TroubleTicketExample. Now
what has be confused is that example shows rules firing AFTER control
has been returned from the fireAllRules() call. I tried to create
something similar - call fireAllRules, then call session.update(han,
obj) - but nothing happens. If I call fireAllRules again (after the
update) then my rule fires as expected. My test didn't use any
duration statement. Is that the magic in the TroubleTicketExample? If
so, then how does one have a clue as to whether one needs to call
fireAllRules after an update or not (i.e. no way to tell if a duration
rule is keeping it running)? Obviously I'm missing some basic
understanding here. Please enlighten me.
Thanks,
Charles Binford
14 years, 8 months