tags:

views:

15

answers:

0

I have sun-ejb-jar.xml

   <ejb>
        <ejb-name>TestBean</ejb-name>
        <ejb-ref>
            <ejb-ref-name>ejb/TestLocal</ejb-ref-name>
            <jndi-name>ejb/TestLocal</jndi-name>
        </ejb-ref>
    </ejb>

</enterprise-beans>

and ejb-jar.xml

http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">

         <enterprise-beans>
             <session>
                 <ejb-name>TestBean</ejb-name>
                 <ejb-local-ref>
                    <ejb-ref-name>ejb/TestLocal</ejb-ref-name>
                    <ejb-ref-type>Session</ejb-ref-type>
                    <local>com.clients.TestLocal</local>
                    <ejb-link>TestBean</ejb-link>
                </ejb-local-ref>
            </session>

         </enterprise-beans>

trying to get EJB using

ic = new InitialContext();

=(TestLocal)ic.lookup("java:comp/env/ejb/TestLocal");

@Local public interface TestLocal ;;;;

@Stateless

public class TestBean implements TestLocal

;;;;;

it throw NameNotFoundException exception

when trying to get this EJB inside another EJB class not inside servlet class.

Please help me.

related questions