I am trying out EJB 3.0. I use RAD 8 and WebSphere application server 7. I created an Session Bean let’s call it TopSessionEJB and injected a datasoure into that bean like:
private javax.sql.DataSource defaultDataSource;
I update my ibm-ejb-jar-bind.xml and map the datasource to the real jndi data source name:
<session name="TopSessionEJB ">
I call the this EJB from the servlet and everything works fine.
Now if I make a subclass of TopSessionEJB, let’s call it MySubClassEJB. I deploy this updated EAR on the server, things are fine. I try to access my old Servlet from the browser which in turn calls my old TopSessionEJB, I get error in my server logs, complaining that I did not provide any resource reference for my MySubClassEJB's myDataSource.
com.ibm.wsspi.injectionengine.InjectionException: CWNEN0044E: A resource reference binding could not be found for the following resource references [myDataSource], defined for the MySubClassEJB component.
One would think I just need another entry in the ibm-ejb-jar-bind.xml for this subclass MySubClassEJB but if I try to do that I get RAD error that I am creating a resource reference for something that does not exist.
So the question is how do you inject a database resource-reference in the your base EJB and then inherit that datasource in all of your sub-classes.
I would appreciate if someone could help.