2 op4433263 op4433263 于 2017.01.09 13:50 提问

drools6.5 与spring3.1.1 整合问题

spring-drools.xml




/kie:ksession
/kie:kbase
/kie:kmodule
<!-- 上面的代码加上去就报错 -->
<!-- 注解方式获取bean -->

    具体错误如下:

    SEVERE: Context initialization failed

java.lang.RuntimeException: Unable to get all ZipFile entries: \kenny\otdworkspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\otd\WEB-INF\classes
at org.drools.core.util.IoUtils.indexZipFile(IoUtils.java:187)
at org.drools.compiler.kie.builder.impl.ZipKieModule.(ZipKieModule.java:35)
at org.drools.compiler.kie.builder.impl.ClasspathKieProject.createInternalKieModule(ClasspathKieProject.java:202)
at org.kie.spring.KModuleBeanFactoryPostProcessor.createKieModule(KModuleBeanFactoryPostProcessor.java:151)
at org.kie.spring.KModuleBeanFactoryPostProcessor.addKieModuleToRepo(KModuleBeanFactoryPostProcessor.java:137)
at org.kie.spring.KModuleBeanFactoryPostProcessor.postProcessBeanFactory(KModuleBeanFactoryPostProcessor.java:125)
at org.kie.spring.annotations.KModuleAnnotationPostProcessor.postProcessBeanFactory(KModuleAnnotationPostProcessor.java:33)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:671)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.FileNotFoundException: \kenny\otdworkspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\otd\WEB-INF\classes (系统找不到指定的路径。)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:214)
at java.util.zip.ZipFile.(ZipFile.java:144)
at java.util.zip.ZipFile.(ZipFile.java:158)
at org.drools.core.util.IoUtils.indexZipFile(IoUtils.java:161)
... 22 more

一月 09, 2017 1:38:25 下午 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.RuntimeException: Unable to get all ZipFile entries: \kenny\otdworkspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\otd\WEB-INF\classes
at org.drools.core.util.IoUtils.indexZipFile(IoUtils.java:187)
at org.drools.compiler.kie.builder.impl.ZipKieModule.(ZipKieModule.java:35)
at org.drools.compiler.kie.builder.impl.ClasspathKieProject.createInternalKieModule(ClasspathKieProject.java:202)
at org.kie.spring.KModuleBeanFactoryPostProcessor.createKieModule(KModuleBeanFactoryPostProcessor.java:151)
at org.kie.spring.KModuleBeanFactoryPostProcessor.addKieModuleToRepo(KModuleBeanFactoryPostProcessor.java:137)
at org.kie.spring.KModuleBeanFactoryPostProcessor.postProcessBeanFactory(KModuleBeanFactoryPostProcessor.java:125)
at org.kie.spring.annotations.KModuleAnnotationPostProcessor.postProcessBeanFactory(KModuleAnnotationPostProcessor.java:33)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:671)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.FileNotFoundException: \kenny\otdworkspace.metadata.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\otd\WEB-INF\classes (系统找不到指定的路径。)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:214)
at java.util.zip.ZipFile.(ZipFile.java:144)
at java.util.zip.ZipFile.(ZipFile.java:158)
at org.drools.core.util.IoUtils.indexZipFile(IoUtils.java:161)
... 22 more

见过这个错误的朋友给点帮助谢谢

8个回答

JE_GE
JE_GE   2017.01.10 13:04

什么异常,看不到,对比一下

 <?xml version="1.0" encoding="UTF-8"?>  
<beans xmlns="http://www.springframework.org/schema/beans"  
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   
    xmlns:context="http://www.springframework.org/schema/context"  
    xmlns:aop="http://www.springframework.org/schema/aop"   
    xmlns:tx="http://www.springframework.org/schema/tx"  
    xmlns:flex="http://www.springframework.org/schema/flex"  
    xmlns:drools="http://drools.org/schema/drools-spring"    
    xsi:schemaLocation="http://www.springframework.org/schema/beans  
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd  
           http://www.springframework.org/schema/context  
           http://www.springframework.org/schema/context/spring-context-2.5.xsd  
           http://www.springframework.org/schema/aop  
           http://www.springframework.org/schema/aop/spring-aop-2.5.xsd  
           http://www.springframework.org/schema/tx   
           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd  
           http://www.springframework.org/schema/flex    
           http://www.springframework.org/schema/flex/spring-flex-1.0.xsd  
           http://drools.org/schema/drools-spring  
           http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-container/drools-spring/src/main/resources/org/drools/container/spring/drools-spring-1.0.0.xsd">  
    <drools:kbase id="kBase">  
        <drools:resources>  
            <drools:resource type="DRL" source="classpath:com/iyspace/drools/resource/insert.drl"/>  
        </drools:resources>  
        <drools:configuration>  
            <drools:mbeans enabled="true"/>  
            <drools:event-processing-mode mode="STREAM"/>  
        </drools:configuration>  
    </drools:kbase>  
     <drools:ksession kbase="kBase" type="stateful" id="statefulKnowledgeSession"/>  
     <drools:ksession kbase="kBase" type="stateless" id="ksession" name="stateless1"/>  
</beans>  
wxmisszj1985
wxmisszj1985   2017.03.16 20:18

你解决了嘛,我也是这个问题。请指教下

op4433263
op4433263   2017.03.17 16:10

我Ecipse 升级到neon.1这个问题就解决了

wxmisszj1985
wxmisszj1985   2017.03.20 09:33

其他地方有改动吗,我换了下 还是提示这个错误呢。

super_da
super_da   2017.04.29 18:49

这个问题是因为KModuleBeanFactoryPostProcessor.createKieModule这个方法中对路径进行了截断,导致windows环境下路径少了盘符。java中File类对于没有盘符的路径默认在当前分区查找,eclipse中对于server location默认设置到工作区下面的一个目录,如果你的工作区跟tomcat不在一个磁盘分区,那么就会出现上面的异常。 知道原因了,解决就容易了。可以把tomcat放到跟workspace一个分区,也可以把server location指定到跟tomcat同一个分区的某个目录。

u011646880
u011646880   2017.06.28 11:15

你好,问题解决了吗,我也遇到了这个问题,我是的6.3的版本,在集成spring的时候出现了这个问题
还有你那里有例子吗,能给个小例子吗。
我现在在用jbpm6.3 搭建工作流,有好多的问题

kissliumin
kissliumin   2017.08.23 11:02

你的tomcat配置有问题,Deploy Path路径要到apache-tomcat-xxx\webapp下,修改一下就可以了

swordgsun
swordgsun   2017.08.31 18:18

这个问题 最后怎么解决的 按照上面的方法 也还是报这个错误啊

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!