@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()).
I tried it with "name" in the servlet, too. It didn't work either.
web.xml version? Doesn't sound like injection is even getting setup; not a problem with target resolution.
Sorry, I forgot to mention.
They should be correct, as I use Version 2.5
<?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">
<?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">
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
Ah, ok. Thanks alot!! I only read that JBoss 4.2 supports EJB3, so I thought injection works.