Hello,
I'm trying to play around with Drool 6.0.1 integration with Spring (I'm using spring-boot which includes spring 4.0). I've looked at the unit tests written and have copied them pretty much exactly. When I start the app, I consistently receive:
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.kie.spring.KModuleBeanFactoryPostProcessor]: Constructor threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:164)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1069)
... 22 more
Caused by: java.lang.NullPointerException
at org.kie.spring.KModuleBeanFactoryPostProcessor.initConfigFilePath(KModuleBeanFactoryPostProcessor.java:79)
at org.kie.spring.KModuleBeanFactoryPostProcessor.<init>(KModuleBeanFactoryPostProcessor.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
When debugging the NPE comes from line 79, getClass().getResource("/").getPath(), because getResource yields null. Here is my spring context file:
<bean id="kiePostProcessor" class="org.kie.spring.KModuleBeanFactoryPostProcessor"/>