java.lang.NoSuchMethodError thrown in drools api
by DE_Azrael
Hi everyone,
I'm using drools 5.5.0 final in my project.
The project is already running since a couple of years by now and I'm new in
the project. I did some tuning on the JBOSS and the source code and deployed
a new version.
Since than I have a strange behaviour on one interface. The first 4 to 6
transactions are working fine. Than I'm receiving a "NoSuchMethodError" from
my insertFact method.
Caused by: java.lang.NoSuchMethodError:
java.lang.StringBuilder.append(Ljava/util/Date;)Ljava/lang/StringBuilder;
at
ConditionEvaluatorf4a3f354729241ac8370890200fdf2d8.evaluate(Unknown Source)
at
org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:200)
at
org.drools.rule.constraint.MvelConstraint.isAllowedCachedRight(MvelConstraint.java:184)
at
org.drools.common.SingleBetaConstraints.isAllowedCachedRight(SingleBetaConstraints.java:134)
at org.drools.reteoo.NotNode.assertObject(NotNode.java:131)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
at
de.hp.ipcc.speechLogic.tools.DroolsHelper.insertFact(DroolsHelper.java:208)
at
de.hp.ipcc.speechLogic.fixedNet.SpeechLogicFnBean.getOrders(SpeechLogicFnBean.java:443)
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.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at
org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72)
at
org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:138)
... 99 more
So I did a fallback on the old version (without my tuning changes) and the
funny thing is that the failure is now also happening there .... but it has
never been registered before.
I checked the information that I'm inserting into drools for the cases where
everything is working fine and where the failure occurs. The information are
identical.
Here the code where the failure is thrown:
//orders are in dto, now load delta information for customer,
//so drools can relate them to the order
if(customerNumber != null && customerNumber.trim().length() > 0){
SpeloDeltaDao deltaDao = new SpeloDeltaDao();
Collection<Spelo_Delta> deltaList =
deltaDao.getDeltaInfos(DELTA_CATEGORY_ORDERS, customerNumber);
if(deltaList != null){
for(Spelo_Delta sd : deltaList){
dh.insertFact(sd);
}
if(logga.isDebugEnabled()){
msg = new StringBuilder().append("Inserted ").append(deltaList.size());
msg.append(" spelo_delta records for customer
<").append(customerNumber).append(">");
if(logga.isDebugEnabled()) {
logga.debug(msg);
}
}
}
public FactHandle insertFact(Object proposition){
FactHandle fh = null;
if(ksession != null){
fh = ksession.insert(proposition);
}
return fh;
}
Not sure if it is important how the KnowledgeBAse and session is defined
.....
public class DroolsHelper implements Constants {
protected static KnowledgeBase kbase = null;
StatefulKnowledgeSession ksession = null;
.........
So by now I have no clue what could be wrong and it would be really cool if
one of you could help me.
Thanks
Johannes
--
View this message in context: http://drools.46999.n3.nabble.com/java-lang-NoSuchMethodError-thrown-in-d...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
Re: [rules-users] (Hot?) rules production deployment
by Pykhtin, Alex
Anyone can tell if Drools supports hot deployment of rules and fact types?
We are using Drools rules (No Guvnor/Workbench), and the whole cycle Development-Test-Production takes a very long time. Ideally we would like business users to add or modify rules in Production without risk of crashing entire rules engine. But as of today, any rule or fact type change is subject to full regression testing, as any other of our Java code. I tried to experiment with Drools Workbench, but so far it doesn't look like it can help much with hot deployment. Workbench can greatly streamline the development and deployment process, but generally speaking, since all Drools boils down to Java, it is essentially another jar deployment. So, it looks like if we would want to simplify our production deployments, the only option is to abolish the QA cycle for Drools jars (which our QA will probably never agree to).
Any ideas?
Thanks,
Alex
11 years, 10 months
Collect all occurrences of resulting data.
by Ephemeris Lappis
Hello.
I'm looking for the better way to write a rule that collects data only when
they have been all processed.
For example, two input objects classes as facts : *Data* and *Category*.
I declare a local type to memorize the result of the evaluation for each
pair of fact.
Some rule evaluates the Cartesian product of all *Data* by all *Category* :
Now I want to collect all the results, but only when the previous rule has
been fired for all the data.
Something like :
Any advice ?
Thanks in advance for your help.
Regards.
--
View this message in context: http://drools.46999.n3.nabble.com/Collect-all-occurrences-of-resulting-da...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
Cannot find KieModule: org.default:artifact:1.0.0-SNAPSHOT
by waynemetcalfe
I've seen this problem a few places while searching for a solution. Is it
possible to overcome this issue?
Drools version:6.0.0.Final
Java version: 1.7.0_45
Code snippet:
...
final KieServices ks = KieServices.Factory.get();
final KieRepository kr = ks.getRepository();
final KieFileSystem kfs = ks.newKieFileSystem();
//ruleScript is simply a string containing the rules
kfs.write("src/main/resources/com/company/test/rules/rules.drl",
ruleScript);
KieBuilder kb = ks.newKieBuilder(kfs);
kb.buildAll();
if (kb.getResults().hasMessages(Level.ERROR)){
configuration.getLog().error("\nSomething wrong here!\n\n");
}
final KieContainer kContainer =
ks.newKieContainer(kr.getDefaultReleaseId());
session = kContainer.newKieSession();
Exception:
java.lang.RuntimeException: Cannot find KieModule:
org.default:artifact:1.0.0-SNAPSHOT
at
org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:86)
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Cannot-find-KieModule-org-default-artif...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 11 months
Drools 6 inject ksession with configured persistence
by Jan Šťastný
Hi,
I have a kjar with kmodule.xml, where my kbase and its ksession are defined.
Then I'd like to inject the ksession into my service component and work
with it. But. I don't know where to configure persistence for the
session. Well, in kmodule.xml there is not such an entry. And after
injection there is no way of setting the EntityManagerFactory.
Thanks
Jan
11 years, 11 months
Best practice with Guvnor repository
by Sean Su
If as an organization, we are using Guvnor to host our rules and we have
multiple rule based projects which may not have anything to do with each
other, what would be the recommended practice - having one web application
instance with different packages, or having multiple Guvnor instances
therefore the repository are totally separated?
Thanks
Sean
11 years, 11 months