It is possible to use Google Guice (any other DI framework) for injecting EJBs in Java EE 5? By default Java EE 5 uses JNDI to injecting EJBs.

有帮助吗?

解决方案

I have no direct experience with Guice - but yes, it's possible to use other frameworks for injecting EJBs in a JEE5 application. For instance, Seam does just that. So in principle, it should be possible as there isn't an inherent restriction in the kind of objects that can be injected, as long as the framework takes care of all the lookup details.

UPDATE:

Take a look at this post detailing how to inject EJBs using Guice.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top