EJB3 <ejb-local-ref> not working
843830Nov 9 2007 — edited May 19 2008Hi
I'm trying to use a local interface of an ejb3 in a Servlet and annotatig with @EJB won't work (jboss-4.2.2.GA) so I'm trying to inject the bean in java:comp/env/ via web.xml.
But wen I try to use <ejb-local-ref> :
<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">
<display-name>Web Interface</display-name>
.............................................
<ejb-local-ref>
<ejb-ref-name>ejb/UserBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>com.website.Statefull.UserBeanLocal</local>
</ejb-local-ref>
</web-app>
jboss complains:
org.jboss.deployment.DeploymentException: Failed to parse WEB-INF/web.xml; - nes
ted throwable: (org.jboss.deployment.DeploymentException: expected one local-hom
e tag)
at org.jboss.web.AbstractWebContainer.parseMetaData(AbstractWebContainer
.java:755)
at org.jboss.web.AbstractWebContainer.init(AbstractWebContainer.java:356
)
So I'm guessing it's complaining about <local> tag and it expects <local-home> tag (priori to ejb 3?).
But I don't understand why, I set the id="WebApp_ID" version="2.5".
Can anybody tell me what I'm doing wrong?
Thanks!