tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: Spring in Geronimo
Date Fri, 11 Sep 2009 23:34:08 GMT

On Sep 11, 2009, at 3:26 AM, Quintin Beukes wrote:

> I had a look at the Spring in OEJB 3.1. Works well. Very nice feature.
> My question is how I can get the same running in Geronimo. Since I'm
> not initializing OpenEJB myself I figured I would need to get Geronimo
> to initialize it somehow, and then update the application context by
> dynamically loading spring configurations.

So far that setup only works when Spring is booting OpenEJB as an  
embedded container in a Java SE application.  It doesn't work with the  
same automagic exporting and importing in Tomcat or Geronimo.

Here's an email with some explanation of the difficulties in a  
bidirectional export/import.

Note that in either Tomcat or Geronimo you should be able to export  
from OpenEJB into your Spring context no problems with the  
"org.apache.openejb.spring.EJB" bean mentioned on this page:

Just be aware that Geronimo uses a more complex deploymentId format  
than the one OpenEJB uses by default.  You'd probably want to set them  
to be the same since your spring xml would be referencing them.

Also note that you could install PropertyEditor classes to take care  
of looking up and injecting spring beans into your EJBs.  You'd just  
need to find some way to make your Spring ApplicationContext available  
to the PropertyEditor instance (perhaps a static or thread local).   
That will work in all environments (embedded, Tomcat, Geronimo).

See the custom-injection example for the PropertyEditor example.

We are looking for more functionality in this area, so if you come up  
with anything neat.  Definitely feel encouraged to share.


View raw message