Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: changed title
Note

OpenEJB 3.1 and later users should refer to the Spring page.

Bootstrapping OpenEJB in Spring

If you wish to use OpenEJB inside Spring you can do so pretty easily. Include OpenEJB and its dependencies in your classpath as you would in a plain embedded scenario then add a custom factory like the following:

...

Just as with Unit Testing, OpenEJB will find and automatically deploy all the EJB beans it finds in the classpath. You can then expose any of these things to other Spring components with custom factory beans.

Injecting OpenEJB-created resources into Spring components

If you want to have any of the Topics, Queues, DataSources, EntityManagers or more that OpenEJB creates injected into components that Spring creates, here's one technique....

...