2 Replies Latest reply on Nov 4, 2003 8:01 AM by rsczepan

    somthing wrong with lookup

    rsczepan Newbie

      I try to get an LocalHome - Object.

      KreditkarteLocalHome kreditHome = (KreditkarteLocalHome) ctx.lookup("java:comp/env/ejb/KreditkarteLocalHome");

      But I get a ClassCastException, so I tried:

      Object kreditHome = ctx.lookup("java:comp/env/ejb/KreditkarteLocalHome");

      That works fine. The Object I get back is another Entity - Bean programmed by myself (I used Reflection to found out this).

      If I delete this Object (which i get back) in the ejb-jar.xml and i try:

      KreditkarteLocalHome kreditHome = (KreditkarteLocalHome) ctx.lookup("java:comp/env/ejb/KreditkarteLocalHome");

      I get an FinderException: could not dereference Object

      Is there anybody who can help me?

      Thanks Ralf



        • 1. Re: somthing wrong with lookup
          Jon Barnett Master

          The dereferencing error usually occurs because your resolution of the component's local reference to the global JNDI object is incorrect. Check jmx-console -> jndiview -> list to check your EJB for correct resolution. As to the first problem, it sounds like you are resolving to the wrong end-point, obtaining the wrong local home. Check your bindings again. We are working in the dark so you might want to post your relevant ejb-jar.xml and jboss.xml for the caller (or web.xml and jboss-web.xml if the caller is a servlet/JSP).

          • 2. Re: somthing wrong with lookup
            rsczepan Newbie

            Thanks, I found the Mistake.
            I have had the wrong
            <ejb-link>wrongName</ejb-link>
            in the <ejb-local-ref> in the Session-Bean.

            Gruss Ralf