This content has been marked as final.
Show 6 replies
-
1. Re: EJB reference in Servlet always null
alrubinger Mar 10, 2009 6:38 PM (in response to buki79)@EJB.mappedName is a vendor-specific (non-portable) attribute which in JBoss EJB3 is used to denote the JNDI target; you're using it as the target EJB name.
@EJB should be sufficient. Likewise you don't need to specify @Stateful.name (the default is the bean impl class getSimpleName()).
S,
ALR -
2. Re: EJB reference in Servlet always null
buki79 Mar 11, 2009 3:33 AM (in response to buki79)Hi,
I tried it with "name" in the servlet, too. It didn't work either.
Best regards,
Andreas -
3. Re: EJB reference in Servlet always null
alrubinger Mar 11, 2009 3:41 AM (in response to buki79)web.xml version? Doesn't sound like injection is even getting setup; not a problem with target resolution.
-
4. Re: EJB reference in Servlet always null
buki79 Mar 11, 2009 4:14 AM (in response to buki79)Sorry, I forgot to mention.
They should be correct, as I use Version 2.5
web.xml:<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
application.xml (EAR):<?xml version="1.0" encoding="ASCII"?> <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">
Best regards -
5. Re: EJB reference in Servlet always null
jaikiran Mar 11, 2009 4:22 AM (in response to buki79)"buki79" wrote:
Hi,
I use JBoss 4.2.2
Ah, so you use JBossAS-4.2.x. Injection of EJBs in servlets in this version isn't supported. See this sticky http://www.jboss.org/index.html?module=bb&op=viewtopic&t=107353 -
6. Re: EJB reference in Servlet always null
buki79 Mar 11, 2009 5:00 AM (in response to buki79)Ah, ok. Thanks alot!! I only read that JBoss 4.2 supports EJB3, so I thought injection works.