Re: [rules-users] Drools 5.4.0.FINAL and OSGI. Unable to instantiate service for Class 'org.drools.concurrent.ExecutorProvider'

2013-01-21 Thread ikbhal
Hi,

Hi
I am using drools 
I am getting this error after i run the rule after 10 times.
Can you please suggest me is there any i can do 
i tried to chagne version of drools-core,api,compiler , but it does not
work.
my pom.xml is
dependency
groupIdorg.drools/groupId
artifactIddrools-core/artifactId
version5.1.1/version
/dependency
dependency
groupIdorg.drools/groupId
artifactIddrools-compiler/artifactId
version5.1.1/version
/dependency
dependency
groupIdorg.drools/groupId
artifactIddrools-api/artifactId
version5.1.1/version
/dependency
dependency
groupIdorg.drools/groupId
artifactIddrools-templates/artifactId
version5.1.1/version
/dependency
dependency
groupIdcom.thoughtworks.xstream/groupId
artifactIdxstream/artifactId
version1.3.1/version
/dependency

this is the code
public T T runRule(String ruleName, Object facts[], T result, String
resultName)
throws ERPServiceException {

if(ksession == null || ruleMap == null || ruleMap.size() == 0){
throw new 
ERPServiceException(ERPErrorCodes.ERR_NO_DATA_TO_PROCESS);
}
LOGGER.info(inside run rule);

ListFactHandle factHandleList = new ArrayListFactHandle();
FactHandle factHandle = null;
for(Object fact: facts) {
LOGGER.info(rule fact: + facts);
factHandle = ksession.insert(fact);
factHandleList.add(factHandle);
}
ksession.setGlobal(resultName, result);  
/* 
 * ksession.addEventListener(kbaseRefresher);
 *ksession.addEventListener(kbaseRefresher);
 */ 
String ruleFullName = null;
RuleEntry ruleEntry = ruleMap.get(ruleName);

if(ruleEntry != null){
Long ruleMetaDataId = ruleEntry.getRuleMetaDataId();
RuleMetaDataEntry metaDataEntry =
ruleMetaDataMap.get(ruleMetaDataId);
if(metaDataEntry != null 
metaDataEntry.getRuleMetaDataParameterEntries() != null 
 
metaDataEntry.getRuleMetaDataParameterEntries().size()1) {
ruleFullName = metaDataEntry.getName();
}else{
ruleFullName = RULE_NAME_PREFIX + ruleName;
}
LOGGER.info(running rule:   + ruleFullName);
ksession.fireAllRules(new
RuleNameMatchesAgendaFilter(ruleFullName));
for(FactHandle fhandle: factHandleList){
ksession.retract(fhandle);
}
}
return result;
}


Caused by: java.lang.ExceptionInInitializerError
at
org.drools.concurrent.ExecutorProviderFactory.getExecutorProvider(ExecutorProviderFactory.java:12)
at
org.drools.rule.constraint.MvelConstraint$ExecutorHolder.clinit(MvelConstraint.java:259)
at
org.drools.rule.constraint.MvelConstraint.jitEvaluator(MvelConstraint.java:232)
at
org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:197)
at
org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:157)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
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
com.myntra.commons.utils.RuleEngineCache.runRule(RuleEngineCache.java:152)
at
com.myntra.lms.manager.impl.CourierServiceabilityManagerImpl.getCouriers(CourierServiceabilityManagerImpl.java:221)
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:616)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at

Re: [rules-users] Drools 5.4.0.FINAL and OSGI. Unable to instantiate service for Class 'org.drools.concurrent.ExecutorProvider'

2013-01-21 Thread ikbhal
Thanks Per Sterner, i tried to your suggestion,
I removed drools-api dependency from pom.xml
its working.




--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Drools-5-4-0-FINAL-and-OSGI-Unable-to-instantiate-service-for-Class-org-drools-concurren-tp4017660p4021691.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users