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>
            <groupId>org.drools</groupId>
            <artifactId>drools-core</artifactId>
            <version>5.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-compiler</artifactId>
            <version>5.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-api</artifactId>
            <version>5.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-templates</artifactId>
            <version>5.1.1</version>
        </dependency>
        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
            <version>1.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");
                
                List<FactHandle> factHandleList = new ArrayList<FactHandle>();
                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
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy93.getCouriers(Unknown Source)
        at
com.myntra.lms.service.impl.CourierServiceabilityServiceImpl.getCouriers(CourierServiceabilityServiceImpl.java:105)
        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.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:166)
        at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:82)
        ... 38 more
Caused by: java.lang.IllegalArgumentException: Unable to instantiate service
for Class 'org.drools.concurrent.ExecutorProvider'
        at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:162)
        at
org.drools.concurrent.ExecutorProviderFactory$ExecutorProviderHolder.<clinit>(ExecutorProviderFactory.java:8)
        ... 72 more
Caused by: java.lang.NullPointerException
        at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:160)





--
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-tp4017660p4021686.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

Reply via email to