users@glassfish.java.net

Re: JNDI lookup fails for ejb tier vs. web tier

From: <glassfish_at_javadesktop.org>
Date: Wed, 18 Jun 2008 13:15:32 PDT

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
<enterprise-beans>
  <session>
    <ejb-name>FooBean</ejb-name>
    
    <ejb-local-ref>
        <description>description in descriptor</description>
        <ejb-ref-name>FooBean</ejb-ref-name>
        <local>com...Foo</local>
        <ejb-link>FooBean</ejb-link>
    </ejb-local-ref>
    </session>
  </enterprise-beans>
</ejb-jar>

It's also possible to inject ejb-local-ref with @EJB into a EJB bean class or interceptor class, and look it up in a POJO that is in the same naming context as the injecting component. This way you don't need to declare them in ejb-jar.xml.

-cheng
[Message sent by forum member 'cf126330' (cf126330)]

http://forums.java.net/jive/thread.jspa?messageID=281126