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.

  
http://www.nabble.com/Re%3A-Deploying-Spring-Integration-example-p24704223.html

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: http://openejb.apache.org/3.0/spring.html

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.


-David

Reply via email to