[rules-users] java.lang.NoSuchMethodError thrown in drools api

DE_Azrael Johannes.Weber at hp.com
Wed Apr 23 03:27:00 EDT 2014


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-drools-api-tp4029326.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list