Finally I got my MDB & Spring to play together. However, I am getting a strange ClassCastException. This is the error:
And the code I am using is:Code:<MessageDrivenBean threw an Exception in onMessage(). The exception was: java.lang.ClassCastException: sample.GreetingServiceImpl. java.lang.ClassCastException: sample.GreetingServiceImpl
Code:BeanFactoryLocator bfl = SingletonBeanFactoryLocator.getInstance(); BeanFactoryReference bf = bfl.useBeanFactory("MyApp"); GreetingServiceImpl b=(GreetingServiceImpl) bf.getFactory().getBean("GreetingServiceImpl");
Seems to me the class being returned and the class I am typecasting are one and the same (all these are in package "sample"). So why the CastException?
Any help appreciated.


Reply With Quote