[jboss-user] [EJB/JBoss] - Re: Packing/Descriptors for EJB 3.0 Local access
jaikiran
do-not-reply at jboss.com
Sat Nov 4 02:40:11 EST 2006
In your ejb-jar.xml:
| <session >
| <description>Sample session bean</description>
|
| <ejb-name>HelloWorld</ejb-name>
|
|
| <local-home>packageName.HelloWorldLocalHome</local-home>
| <local>packageName.HelloWorldLocal</local>
| <ejb-class>packageName.HelloWorldSessionBean</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
|
|
|
| </session>
|
Add the following to the web.xml:
| <ejb-local-ref>
| <ejb-ref-name>ejb/MyLocalRefHelloWorld</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| <local-home>packageName.HelloWorldLocalHome</local-home>
| <local>packageName.HelloWorldLocal</local>
| <ejb-link>HelloWorld</ejb-link>
| </ejb-local-ref>
The ejb-link in the web.xml should match the ejb-name in the ejb-jar.xml.
In your code, you will lookup using the ejb-ref-name specified in the web.xml, as follows:
| Context ctx = new InitialContext();
| ctx.lookup("java:comp/env/ejb/MyLocalRefHelloWorld");
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983175#3983175
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983175
More information about the jboss-user
mailing list