Announcement Announcement Module
Collapse
No announcement yet.
ClassCastException in MDB Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ClassCastException in MDB

    Finally I got my MDB & Spring to play together. However, I am getting a strange ClassCastException. This is the error:

    Code:
    <MessageDrivenBean threw an Exception in onMessage(). The exception was:
     java.lang.ClassCastException: sample.GreetingServiceImpl.
    java.lang.ClassCastException: sample.GreetingServiceImpl
    And the code I am using is:
    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.
Working...
X