Inspired by the Spring with Stripes integration I made a new one named EJB3 with Stripes.
This extension allows you to inject your EJB beans into your Action beans.
Please fell free to use it, and to visit the Stripes and EJB3 project at Google Code.
Hello,
I’ve got an EJB modul with some entities and SessionBeans for these entities. Next I’ve got web application which uses stripes. But always I use annotation in my ActionBean, e.g.:
I tried to use the EJB Interceptor according to your article, but without success
@EJBBean(”PersonFacade”)
private PersonFacade personFacade;
I’m still getting an exception that it can’t find this EJBBean.
Does it depend on any application server?
The only server I tested with was JBoss AS.
Sorry to ask, but have you confirmed that your bean is binded with the JNDI name “PersonFacade”?
I usually rely on the annotation @LocalBinding for the JNDI binding. e.g.
@LocalBinding(jndiBinding = “PersonFacade”)
public class PersonFacade { … }
Hello All,
It doesn’t work for me either:( I’ve tried EJB Interceptor running on the jboss-4.2.2.GA and even on jboss-5.0.0.Beta4 (the latest one). I’ve got EJB (ear) application with web module and jar module. Same story as kabel described… can’t find this EJBBean.
I’m sure that my beans are loaded by the Jboss server but I’m not under what names they are available.
Samuel, could you tell me which exact version of the Jboss AS you were using.
Did you add any additinal jar’s to the lib?
In which jboss jar the @LocalBinding annotation is provided? I couldn’t find it.
Thanks in advance!
I wish you Happy Easter.
Regards,
Krzysztof
org.jboss.annotation.ejb.LocalBindingclass can be found in jboss-annotations-ejb3.jar that is in the \jboss-4.2.2.GA\server\default\deploy\ejb3.deployer folder.If you don’t use this annotation, JBoss will define the JNDI bindings for you.
You can look at your server.log to check the JNDI bindings that were defined.
Hi Samuel,
I’ve tried to run it again on jboss-4.2.2.GA with @LocalBinding annotation…. and it worked!
I’ve realized that it doesn’t work on the latest jboss-5.0.0.Beta4 even with @LocalBinding feature. You have to pass full jndi name: ear-app-name/YourBeanName/local (or remote) into @EJBBean.
Regards,
Krzysztof
Hi Krzysztof,
Thanks for the info.
JBoss 5.x is yet too buggy.
Cheers
Hi Samuel,
Thanks for your code, but i’m having a problem.
The EJBInterceptor that I include in my package and that is deployed inside WEB-INF/classes of a WAR is crushing during deploy in JBoss 4.2.2 with Java 5. I’ve tried to compile with Java 6 and I get the same error. Could you help me?
2008-06-25 17:55:46,722 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/adssimplex]] Exception starting filter StripesFilter
java.lang.ClassFormatError: Invalid constant pool index 63 in class file pt/ptinovacao/adssimplex/util/EJBInterceptor
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1814)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
at org.jboss.web.tomcat.service.WebAppClassLoader.findClass(WebAppClassLoader.java:139)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
Hi Hugo,
Can you please send me the complete stack trace by mail?