5 Replies Latest reply on Apr 4, 2002 8:22 AM by samsonov

    Lookup problem with local interfaces

    samsonov

      Hi folks,
      I have seen all topics in the forum about this problem.
      I try difference combination but can't get working results.
      My code is:
      InterestLocal interestLocal;
      InterestLocalHome home = (InterestLocalHome)jndiContext.lookup("local/Interest");
      interestLocal = home.create();

      This call I make from servlet.I'm using JBoss2.4.4-jakarta4.0.1
      My ear-jar.xml have next:
      <enterprise-beans>
      <session>
      <display-name>Interest</display-name>
      <ejb-name>Interest</ejb-name>
      <home>org.jboss.docs.interest.InterestHome</home>
      <remote>org.jboss.docs.interest.Interest</remote>
      <local-home>org.jboss.docs.interest.InterestLocalHome</local-home>
      <local>org.jboss.docs.interest.InterestLocal</local>
      <ejb-class>org.jboss.docs.interest.InterestBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Bean</transaction-type>
      </session>
      </enterprise-beans>

      web.xml is
      <ejb-local-ref>
      <ejb-ref-name>ejb/local/Interest</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <local-home>org.jboss.docs.interest.InterestLocalHome</local-home>
      <local>org.jboss.docs.interest.InterstLocal</local>
      </ejb-local-ref>

      What's wrong, please help!
      Andrew

        • 1. Re: Lookup problem with local interfaces

          You've misspelt InterestLocal in the web.xml
          Also, you don't have an <ejb-link> are you specifying
          the <jndi-name> in jboss-web.xml?

          You can look for error messages in log/server.log

          Regards,
          Adrian

          • 2. Re: Lookup problem with local interfaces
            samsonov

            I fix grammar error in the file web.xml. I have now
            web.xml

            <ejb-ref>
            <ejb-ref-name>ejb/Interest</ejb-ref-name>
            <ejb-ref-type>Session</ejb-ref-type>
            org.jboss.docs.interest.InterestHome
            org.jboss.docs.interest.Interest
            <ejb-link>Interest</ejb-link>
            </ejb-ref>
            <ejb-local-ref>
            <ejb-ref-name>ejb/local/Interest</ejb-ref-name>
            <ejb-ref-type>Session</ejb-ref-type>
            <local-home>org.jboss.docs.interest.InterestLocalHome</local-home>
            org.jboss.docs.interest.InterestLocal
            <ejb-link>Interest</ejb-link>
            </ejb-local-ref>

            jboss-web.xml

            <jboss-web>
            <ejb-ref>
            <ejb-ref-name>ejb/Interest</ejb-ref-name>
            <jndi-name>interest/Interest</jndi-name>
            </ejb-ref>
            </jboss-web>

            jboss.xml


            <enterprise-beans>

            <ejb-name>Interest</ejb-name>
            <jndi-name>interest/Interest</jndi-name>

            </enterprise-beans>


            I make call
            InterestLocalHome home = (InterestLocalHome) jndiContext.lookup("java:comp/env/ejb/local/Interest");
            interestLocal = home.create();

            and I have error
            [ERROR,EmbeddedCatalinaServiceSX] ----- Root Cause -----
            javax.naming.NameNotFoundException: local not bound

            What's wrong?

            Andrew

            • 3. Re: Lookup problem with local interfaces

              Open http://yourServe:8082 and check the jndi names with the sevice 'service=JNDIView'

              • 4. Re: Lookup problem with local interfaces

                I've checked the source, there is no
                <ejb-local-ref> support in 2.4.4 for the web container.
                It is NOT fixed for 2.4.5
                It is fixed in 3.0beta

                You might want to report this as a bug.

                There is another bug in the web container where it uses
                <ejb-link> as a jndi name that somebody else came
                across.
                This is also fixed in 3.0

                Regards,
                Adrian

                • 5. Re: Lookup problem with local interfaces
                  samsonov

                  Thanks, I try run my ear under jboss3beta-jakarta4.0.1 and it works.

                  Andrew