Drools使用

中文博客,Drools的文章都是抄来抄去,真遇到点儿事,嘛都查不到,昨个儿遇到此问题

java.lang.ClassNotFoundException: org.drools.concurrent.ExecutorProviderImpl

google到一个英文论坛(http://comments.gmane.org/gmane.comp.java.drools.user/32524)

大约是有两个bundle中有同一个名字的包,一个是接口,一个是实现,运行时实现的那个包被drop了,

 

我们分析良久,认定问题的原因必然是classloader不对,网上一个国际友人说的对:

  1. org.drools.concurrent.ExecutorProviderFactory$ExecutorProviderHolder tries to obtain instance of class org.drools.concurrent.ExecutorProvider using org.drools.util.ServiceRegistryImpl.get method
  2. org.drools.util.ServiceRegistryImpl doesn't have any implementation of org.drools.concurrent.ExecutorProvider in it's registry
  3. org.drools.util.ServiceRegistryImpl tries to instantiate default implementation - org.drools.concurrent.ExecutorProviderImpl using org.drools.util.ServiceRegistryImpl$ReflectionInstantiator using wrong classloader - in my opinion there is problem.
  4. Finally java.lang.ClassNotFoundException: org.drools.concurrent.ExecutorProviderImpl is thrown because classloader from bundle knowledge-api-5.4.0.Final cannot load class org.drools.concurrent.ExecutorProviderImpl.

他提供的方法如下:

This type of problems in OSGi environment were solved by registering proper instances in OSGi service repository. For example for core module in org.drools.osgi.core.Activator class. Maybe would be worth to register also org.drools.concurrent.ExecutorProviderImpl as OSGi service. I've tried to fix this problem this and this way solves this problem.

 

连接:https://community.jboss.org/message/758994#758994

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值