EasyBeans

Allow injection of @EJB in servlets when EasyBeans is embedded in Tomcat

Details

  • Description:
    Well, as reported on the list many times, we should be able to inject @EJB fields in servlets

Activity

Repository Revision Date User Message
EasyBeans #2984 Mon Apr 28 01:16:38 CEST 2008 benoitf Our war is using Java SE delegation model.
It may avoid to have classcastexception or classes that are not instance of given interfaces due to different classloader
Part of EZB-258 as @EJB annotaton is already include in Tomcat and then we shouldn't use EasyBeans annotation in this case
Files Changed
MODIFY /trunk/easybeans/assemblies/ee/war/src/main/webapp/META-INF/context.xml
Repository Revision Date User Message
EasyBeans #2986 Mon Apr 28 01:30:33 CEST 2008 benoitf EZB-258 : Allows to inject @EJB in servlets when EasyBeans is embedded in Tomcat
The tomcat deployer is now in its own module. It doesn't use anymore reflection. With maven we can import the package that are needed.
The war is analyzed to search annotations.
The NamingContext listener of tomcat is extended: This allows at the end of Tomcat binding to add our own JNDI ENC.
Of course, we need to do this by setting the context to writable mode and after we put back the read-only mode.
Files Changed
ADD /trunk/easybeans/modules/deployer/web/tomcat/6.0.x/src/main/java/org
MODIFY /trunk/easybeans/modules/ee/web-app/pom.xml
ADD /trunk/easybeans/modules/deployer/web/tomcat/6.0.x/src/main/java/org/ow2/easybeans/deployer/web/tomcat/Tomcat6Deployer.java
ADD /trunk/easybeans/modules/deployer/web/tomcat/6.0.x/src
ADD /trunk/easybeans/modules/deployer/web/tomcat/6.0.x/src/main
MODIFY /trunk/easybeans/.classpath
MODIFY /trunk/easybeans/modules/core/src/main/java/org/ow2/easybeans/deployer/AbsWebContainerDeployer.java
MODIFY /trunk/easybeans/modules/core/src/main/java/org/ow2/easybeans/deployer/JettyDeployer.java
ADD /trunk/easybeans/modules/deployer/web/tomcat/6.0.x/src/main/java
DEL /trunk/easybeans/modules/core/src/main/java/org/ow2/easybeans/deployer/TomcatDeployer.java
ADD /trunk/easybeans/modules/deployer/web/tomcat/6.0.x
ADD /trunk/easybeans/modules/deployer/web/tomcat/6.0.x/src/main/java/org/ow2/easybeans
MODIFY /trunk/easybeans/modules/ee/web-app/src/main/java/org/ow2/easybeans/server/war/EasyBeansContextListener.java
ADD /trunk/easybeans/modules/deployer
ADD /trunk/easybeans/modules/deployer/web/tomcat/6.0.x/pom.xml
ADD /trunk/easybeans/modules/deployer/web/tomcat/6.0.x/src/main/java/org/ow2/easybeans/deployer
MODIFY /trunk/easybeans/modules/pom.xml
ADD /trunk/easybeans/modules/deployer/web/tomcat/6.0.x/src/main/java/org/ow2/easybeans/deployer/web/tomcat
ADD /trunk/easybeans/modules/deployer/web
ADD /trunk/easybeans/modules/deployer/web/tomcat
ADD /trunk/easybeans/modules/deployer/web/tomcat/6.0.x/src/main/java/org/ow2
ADD /trunk/easybeans/modules/deployer/web/tomcat/6.0.x/src/main/java/org/ow2/easybeans/deployer/web
MODIFY /trunk/easybeans/pom.xml
ADD /trunk/easybeans/modules/deployer/web/tomcat/6.0.x/src/main/java/org/ow2/easybeans/deployer/web/tomcat/EasyBeansNamingContextListener.java
Hide
Florent BENOIT added a comment - 28/Apr/08 1:32 AM
This is now working with Tomcat6
Of course, with tomcat 5.5 it can't work as it is not handling injection
Show
Florent BENOIT added a comment - 28/Apr/08 1:32 AM This is now working with Tomcat6 Of course, with tomcat 5.5 it can't work as it is not handling injection
Florent BENOIT made changes - 28/Apr/08 1:32 AM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]

People

Dates

  • Created:
    28/Apr/08 1:11 AM
    Updated:
    28/Apr/08 1:32 AM
    Resolved:
    28/Apr/08 1:32 AM