I have a scenario where I'm building the rules packages using the BRMS and
using a standalone drools-core deployment to load these binaries. However,
with the 4.0.4 release the following exception is generated by the
Package.readExternal(…) method during de-serialization.
It's using the BRMS 4.0.4 distribution war and the drools-core.jar
4.0.4available via Maven.
------------------------------------------------------------------------------------------------------------------------------------------------------
java.lang.ClassCastException: org.drools.rule.Package
at org.drools.rule.Package.readExternal(Package.java:176)
at com.gbv.platform.rules.drools.impl.RuleRuntimeImpl.init(
RuleRuntimeImpl.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod
(AbstractAutowireCapableBeanFactory.java
:1214)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods
(AbstractAutowireCapableBeanFactory.java:1179
)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean
(AbstractAutowireCapableBeanFactory.java:1145)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
(AbstractAutowireCapableBeanFactory.java:427)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(
AbstractBeanFactory.java:251)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton
(DefaultSingletonBeanRegistry.java:144)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
AbstractBeanFactory.java:248)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
AbstractBeanFactory.java:160)
at
org.springframework.osgi.service.exporter.OsgiServiceFactoryBean.afterPropertiesSet
(OsgiServiceFactoryBean.java:271)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods
(AbstractAutowireCapableBeanFactory.java:1175
)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean
(AbstractAutowireCapableBeanFactory.java:1145)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
(AbstractAutowireCapableBeanFactory.java:427)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(
AbstractBeanFactory.java:251)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton
(DefaultSingletonBeanRegistry.java:144)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
AbstractBeanFactory.java:248)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
AbstractBeanFactory.java:160)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons
(DefaultListableBeanFactory.java:276)
at
org.springframework.context.support.AbstractApplicationContext.refresh(
AbstractApplicationContext.java:360)
at
org.springframework.osgi.context.support.AbstractRefreshableOsgiBundleApplicationContext.refresh
(AbstractRefreshableOsgiBundleApplicationCo
ntext.java:170)
at
org.springframework.osgi.extender.support.ServiceDependentOsgiBundleXmlApplicationContext.refresh
(ServiceDependentOsgiBundleXmlApplicationC
ontext.java:76)
at
org.springframework.osgi.extender.support.ApplicationContextCreator.run(
ApplicationContextCreator.java:155)
at java.lang.Thread.run(Thread.java:595)
Error Loading DROOLS Package : org.drools.rule.Package
------------------------------------------------------------------------------------------------------------------------------------------------------
BTW, Running the debugger through it I was able to get the stack trace
below. This occurs on the first call to Package.readExternal(ObjectInput)
line: 176 after returning from ObjectInputStream.readObject() line: 348
------------------------------------------------------------------------------------------------------------------------------------------------------
Package.readExternal(ObjectInput) line: 176
ObjectInputStream.readExternalData(Externalizable,
ObjectStreamClass) line: 1755
ObjectInputStream.readOrdinaryObject(boolean) line:
1717
ObjectInputStream.readObject0(boolean) line: 1305
ObjectInputStream.readObject() line: 348
Package.readExternal(ObjectInput) line: 176
RuleRuntimeImpl.init() line: 61
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line:
not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line:
39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 585
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).invokeCustomInitMethod(String,
Object, String, boolean) line: 1214
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).invokeInitMethods(String,
Object, RootBeanDefinition) line: 1179
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).initializeBean(String,
Object, RootBeanDefinition) line: 1145
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).createBean(String,
RootBeanDefinition, Object[]) line: 427
AbstractBeanFactory$1.getObject() line: 251
DefaultListableBeanFactory(DefaultSingletonBeanRegistry).getSingleton(String,
ObjectFactory) line: 144
DefaultListableBeanFactory(AbstractBeanFactory).getBean(String,
Class, Object[]) line: 248
DefaultListableBeanFactory(AbstractBeanFactory).getBean(String)
line: 160
OsgiServiceFactoryBean.afterPropertiesSet() line: 271
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).invokeInitMethods(String,
Object, RootBeanDefinition) line: 1175
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).initializeBean(String,
Object, RootBeanDefinition) line: 1145
DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).createBean(String,
RootBeanDefinition, Object[]) line: 427
AbstractBeanFactory$1.getObject() line: 251
DefaultListableBeanFactory(DefaultSingletonBeanRegistry).getSingleton(String,
ObjectFactory) line: 144
DefaultListableBeanFactory(AbstractBeanFactory).getBean(String,
Class, Object[]) line: 248
DefaultListableBeanFactory(AbstractBeanFactory).getBean(String)
line: 160
DefaultListableBeanFactory.preInstantiateSingletons() line:
276
ServiceDependentOsgiBundleXmlApplicationContext(AbstractApplicationContext).refresh()
line: 360
ServiceDependentOsgiBundleXmlApplicationContext(AbstractRefreshableOsgiBundleApplicationContext).refresh()
line: 170
ServiceDependentOsgiBundleXmlApplicationContext.refresh() line:
76
ApplicationContextCreator.run() line: 155
Thread.run() line: 595
------------------------------------------------------------------------------------------------------------------------------------------------------
Cheers,
Pavi
Show replies by date