[jboss-user] [EJB 3.0] - EJB3 <ejb-local-ref> not working

daedalus_hammer do-not-reply at jboss.com
Fri Nov 9 21:43:55 EST 2007


Hi
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>
com.website.Statefull.UserBeanLocal
</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  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!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103399#4103399

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103399



More information about the jboss-user mailing list