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:
<MessageDrivenBean threw an Exception in onMessage(). The exception was:
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.