Help!! Message Driven Bean
I am totally desperate here. I want to create a MDB that can access my Spring beans with the getBeanFactory().getBean("beanName") method. I've checked the Spring doc and even bought 2 books - pro spring and wrox spring framework. Call me stupid but i just can't understand how to do it.
I have extended AbstractJmsMessageDrivenBean and have created the following method:
protected void onEjbCreate() {
System.out.println("OnEjbCreate()");
monthMap = (MonthMap)getBeanFactory().getBean("monthMap");
Map theMap = monthMap.getMonthMap();
System.out.println(theMap);
}
I have also added this to my ejb-jar.xml MDB definition:
<env-entry>
<env-entry-name>ejb/BeanFactoryPath</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>bean.xml</env-entry-value>
</env-entry>
Although I just copied this out the book and have no idea what it does????
My MDB no longer consumes messages now I've tried to spring it. The onMessage method does not fire even when there are messages on the queue.
I'm totally desperate to make this work but I just can't do it.
What did I do wrong?
I need a quick response or I'll have to drop Spring.
Help!!!!!!!!!!!!!!