On Jul 24, 2009, at 11:19 AM, David Sells wrote:

Hi David et al,

I'm wondering if the Spring-Integration example is deployable. The program
compiles and runs through its' JUnit tests but when I try to deploy:

         openejb deploy spring-integration-1.0.jar

(Note that the Calculator example deploys correctly)

I get the following exception.  I don't see a way around this problem:

Thanks, David S.

org.apache.openejb.OpenEJBException: No provider available for resource-ref
'null' of type 'org.superbiz.spring.Theaters' for 'CineplexImpl'.

The example really shows a standalone java application that boots Spring which in turn boots OpenEJB as an embedded container. In this scenario the Spring context and the EJB applications are essentially getting booted at the same time; first the Spring context then the OpenEJB and side of things are kicked off via an ApplicationContextAware object configured in the Spring xml. So essentially Spring boots OpenEJB which is itself a spring bean that is ApplicationContextAware and can then import/export all sorts of things to and from the Spring context.

The details on how to do the reverse haven't been worked on yet -- definite area for contribution if anyone is interested.

When you go to deploy an application that uses Spring into OpenEJB or Tomcat+OpenEJB, then for all intense purposes Spring and the Spring context do not exist yet and nothing can be imported/exported and the result errors saying things your application expects can't be found.

This could be solved by having OpenEJB aggressively boot your spring application for your at deploy time while it's booting your application. Then the same import/export could be done and all things would work bi-directionally. We could potentially look for a Spring file named META-INF/openejb-spring.xml (or something like that) and boot it with the application. Then all the existing import/export code we have could be executed things would work fine.

Not something I have time to work on but more than happy to help anyone who does. Happy to clock in some dev list, irc, or even skype time if someone wanted to give it a go.

-David



Reply via email to