LinkException

Discussions

EJB design: LinkException

  1. LinkException (1 messages)

    the code:
    InitialContext initialContext = new InitialContext();
    cachedLocalHome = (mypackage.server.entity.interfaces.SequenceSessionLocalHome) initialContext.lookup("java:comp/env/ejb/SequenceSession");

    the exception:
    javax.naming.LinkException:
    Root exception is javax.naming.NameNotFoundException:
    Unable to resolve 'mypackage.server.entity.interfaces.SequenceSessionLocalHome' Resolved mypackage.server.entity.interfaces; remaining name 'SequenceSessionLocalHome'

    the deployment descriptors:
    a) form the session bean to be called:
     <session >
             <description><![CDATA[Sequence generator]]></description>

             <ejb-name>SequenceSession</ejb-name>

             <local-home>mypackage.server.entity.interfaces.SequenceSessionLocalHome</local-home>
             <local>mypackage.server.entity.interfaces.SequenceSessionLocal</local>
             <ejb-class>mypackage.server.entity.ejb.SequenceSessionSession</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>

    b) from the calling entity bean
             <ejb-local-ref >
                <ejb-ref-name>ejb/SequenceSession</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
                <local-home>mypackage.server.entity.interfaces.SequenceSessionLocalHome</local-home>
                <local>mypaxkage.server.entity.interfaces.SequenceSessionLocal</local>
                <ejb-link>SequenceSession</ejb-link>
             </ejb-local-ref>

    Can anybody tell me, what's going wrong?
    Who tries to resolve "mypackage.server.entity.interfaces.SequenceSessionLocalHome" ?

    Threaded Messages (1)

  2. LinkException[ Go to top ]

    the code:

    > InitialContext initialContext = new InitialContext();
    > cachedLocalHome = (mypackage.server.entity.interfaces.SequenceSessionLocalHome) initialContext.lookup("java:comp/env/ejb/SequenceSession");
    >
    > the exception:
    > javax.naming.LinkException:
    > Root exception is javax.naming.NameNotFoundException:
    > Unable to resolve 'mypackage.server.entity.interfaces.SequenceSessionLocalHome' Resolved mypackage.server.entity.interfaces; remaining name 'SequenceSessionLocalHome'
    >
    > the deployment descriptors:
    > a) form the session bean to be called:
    >  <session >
    >          <description><![CDATA[Sequence generator]]></description>
    >
    >          <ejb-name>SequenceSession</ejb-name>
    >
    >          <local-home>mypackage.server.entity.interfaces.SequenceSessionLocalHome</local-home>
    >          <local>mypackage.server.entity.interfaces.SequenceSessionLocal</local>
    >          <ejb-class>mypackage.server.entity.ejb.SequenceSessionSession</ejb-class>
    >          <session-type>Stateless</session-type>
    >          <transaction-type>Container</transaction-type>
    >
    > b) from the calling entity bean
    >          <ejb-local-ref >
    >             <ejb-ref-name>ejb/SequenceSession</ejb-ref-name>
    >             <ejb-ref-type>Session</ejb-ref-type>
    >             <local-home>mypackage.server.entity.interfaces.SequenceSessionLocalHome</local-home>
    >             <local>mypaxkage.server.entity.interfaces.SequenceSessionLocal</local>
    >             <ejb-link>SequenceSession</ejb-link>
    >          </ejb-local-ref>
    >
    > Can anybody tell me, what's going wrong?
    > Who tries to resolve "mypackage.server.entity.interfaces.SequenceSessionLocalHome" ?

    At the outset it looks like it is related to JNDI name resolution. Perhaps write a small client to test the same or u could look JNDI tree to make sure the name u r looking is published. Hope this helps