PDA

View Full Version : accessing bean factory from ejb


shadowek
Aug 23rd, 2004, 05:03 AM
Hi,
How to access bean factory from ejb beans? I would like to have one instance of bean factory in my jboss server. My questions are:
* how to startup bean factory and bind it to jndi context?
I will use AbstractStatelessSessionBean support with my own BeanFactoryLocator which will obtain reference to bean factory from jndi.

Other ideas for accessing spring beans from ejbs are also welcome.

ElPapa
Aug 23rd, 2004, 10:58 AM
There was a discussion about this on the mailing list. I believe if you searched the archives you'd find the details.

You can find an example of how to access POJOs from an EJB here. It's a real working EJB code in the ejbtest integration sample, that's in Spring CVS. This 'Simple' EJB is actually used remotely:

http://cvs.sourceforge.net/viewcvs.py/springframework/spring/autobuilds/apps/ejbtest/src/java/org/springframework/integrationtest/ejbtest/simple/ejb/

The code has been moved to the "attic", but it's all still there...

Colin Sampaleanu
Sep 23rd, 2004, 09:07 PM
Packages were refactories a while back, but all the sample code is still live. You sholdn't need to access anything in the attic.

http://cvs.sourceforge.net/viewcvs.py/springframework/spring/autobuilds/apps/ejbtest/#dirlist