Re: [rules-users] Unable to build index of kmodule.xml from Kie project jar
Try upgrading to 6.1.CR2. On Thu, Jul 24, 2014 at 1:23 AM, LearningDrool apeksha.gu...@asurion.com wrote: Hi, I am getting the same error as described below. I was able to run and fire rules using a standalone application in my project but when I try to call the same rules through a dynamic web app, it throws the below errors : Code : KieServices ks = KieServices.Factory.get(); KieContainer kc = ks.getKieClasspathContainer(); StatelessKieSession ksession = kc.newStatelessKieSession(TestDRL); ksession.addEventListener( new DebugAgendaEventListener() ); ksession.execute() The Kmodule File is defined as below and is placed in the /Resources/META-INF folder ?xml version=1.0 encoding=UTF-8? kmodule xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns=http://jboss.org/kie/6.0.0/kmodule; xmlns:Kie=http://drools.org/schema/drools-spring; kbase name=MainTest equalsBehavior=equality packages=com.test.web.actions.bard ksession name=TestDRL type=stateless / /kbase /kmodule Error : 0:05:58.692 [http-bio-8443-exec-4] INFO o.d.c.k.b.impl.ClasspathKieProject - Found kmodule: jar:file:/C:/test/web/actions/bard/WEB-INF/lib/bard.jar!/META-INF/kmodule.xml 10:05:58.706 [http-bio-8443-exec-4] DEBUG o.d.c.k.b.impl.ClasspathKieProject - KieModule URL type=jar url=/C:/test/web/actions/bard/WEB-INF/lib/bard.jar 10:06:05.834 [http-bio-8443-exec-4] ERROR o.d.c.k.b.impl.ClasspathKieProject - Unable to load pom.properties from/C:/test/web/actions/bard/WEB-INF/lib/bard.jar null 10:06:05.845 [http-bio-8443-exec-4] ERROR o.d.c.k.b.impl.ClasspathKieProject - Unable to load pom.properties from/C:/test/web/actions/bard/WEB-INF/lib/bard.jar 10:06:05.856 [http-bio-8443-exec-4] ERROR o.d.c.k.b.impl.ClasspathKieProject - Unable to build index of kmodule.xml url=jar:file:/C:/test/web/actions/bard/WEB-INF/lib/bard.jar!/META-INF/kmodule.xml null Also I was able to call the DRL file using the below code in my project: KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); Resource ruleFile = ResourceFactory.newUrlResource(getClass().getClassLoader().getResource(test1.drl)); kbuilder.add(ruleFile, ResourceType.DRL); KnowledgeBase kbase = kbuilder.newKnowledgeBase(); kbase.addKnowledgePackages(kbuilder.getKnowledgePackages()); I had placed the test1.drl file in the Tomcat folder Why are the Ksessions not being loaded when using the Kmodule.xml. Any ideas? -- View this message in context: http://drools.46999.n3.nabble.com/Unable-to-build-index-of-kmodule-xml-from-Kie-project-jar-tp4030253p4030463.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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Unable to build index of kmodule.xml from Kie project jar
Hi, I am getting the same error as described below. I was able to run and fire rules using a standalone application in my project but when I try to call the same rules through a dynamic web app, it throws the below errors : Code : KieServices ks = KieServices.Factory.get(); KieContainer kc = ks.getKieClasspathContainer(); StatelessKieSession ksession = kc.newStatelessKieSession(TestDRL); ksession.addEventListener( new DebugAgendaEventListener() ); ksession.execute() The Kmodule File is defined as below and is placed in the /Resources/META-INF folder ?xml version=1.0 encoding=UTF-8? kmodule xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns=http://jboss.org/kie/6.0.0/kmodule; xmlns:Kie=http://drools.org/schema/drools-spring; kbase name=MainTest equalsBehavior=equality packages=com.test.web.actions.bard ksession name=TestDRL type=stateless / /kbase /kmodule Error : 0:05:58.692 [http-bio-8443-exec-4] INFO o.d.c.k.b.impl.ClasspathKieProject - Found kmodule: jar:file:/C:/test/web/actions/bard/WEB-INF/lib/bard.jar!/META-INF/kmodule.xml 10:05:58.706 [http-bio-8443-exec-4] DEBUG o.d.c.k.b.impl.ClasspathKieProject - KieModule URL type=jar url=/C:/test/web/actions/bard/WEB-INF/lib/bard.jar 10:06:05.834 [http-bio-8443-exec-4] ERROR o.d.c.k.b.impl.ClasspathKieProject - Unable to load pom.properties from/C:/test/web/actions/bard/WEB-INF/lib/bard.jar null 10:06:05.845 [http-bio-8443-exec-4] ERROR o.d.c.k.b.impl.ClasspathKieProject - Unable to load pom.properties from/C:/test/web/actions/bard/WEB-INF/lib/bard.jar 10:06:05.856 [http-bio-8443-exec-4] ERROR o.d.c.k.b.impl.ClasspathKieProject - Unable to build index of kmodule.xml url=jar:file:/C:/test/web/actions/bard/WEB-INF/lib/bard.jar!/META-INF/kmodule.xml null Also I was able to call the DRL file using the below code in my project: KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); Resource ruleFile = ResourceFactory.newUrlResource(getClass().getClassLoader().getResource(test1.drl)); kbuilder.add(ruleFile, ResourceType.DRL); KnowledgeBase kbase = kbuilder.newKnowledgeBase(); kbase.addKnowledgePackages(kbuilder.getKnowledgePackages()); I had placed the test1.drl file in the Tomcat folder Why are the Ksessions not being loaded when using the Kmodule.xml. Any ideas? -- View this message in context: http://drools.46999.n3.nabble.com/Unable-to-build-index-of-kmodule-xml-from-Kie-project-jar-tp4030253p4030463.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
[rules-users] Unable to build index of kmodule.xml from Kie project jar
I'm trying to use the Kie jar in my spring project. It successfully identifies the Kie jars in my project but give errors listed below :- INFO ClasspathKieProject - Found kmodule: jar:file:/C:/Users/Sumit%20Dhaniya/.m2/repository/com/demo/FirstDemo/1.0/FirstDemo-1.0.jar!/META-INF/kmodule.xml ERROR ClasspathKieProject - Unable to load pom.properties from/C:/Users/Sumit Dhaniya/.m2/repository/com/demo/FirstDemo/1.0/FirstDemo-1.0.jar as jarPath cannot be found /Users/Sumit Dhaniya/.m2/repository/com/demo/FirstDemo/1.0/FirstDemo-1.0.jar ERROR ClasspathKieProject - Unable to load pom.properties from/C:/Users/Sumit Dhaniya/.m2/repository/com/demo/FirstDemo/1.0/FirstDemo-1.0.jar \Users\Sumit Dhaniya\.m2\repository\com\demo\FirstDemo\1.0\FirstDemo-1.0.jar (The system cannot find the path specified) ERROR ClasspathKieProject - Unable to build index of kmodule.xml url=jar:file:/C:/Users/Sumit%20Dhaniya/.m2/repository/com/demo/FirstDemo/1.0/FirstDemo-1.0.jar!/META-INF/kmodule.xml Even if I define kie modules and sessions in my conf file I can't access the drl and rdrl files in my Kie Project. Though if I create my objects using kieServices.getResources().newUrlResource(url); everything works fine. -- View this message in context: http://drools.46999.n3.nabble.com/Unable-to-build-index-of-kmodule-xml-from-Kie-project-jar-tp4030253.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