0 Replies Latest reply on Oct 5, 2006 2:09 AM by zzzz8

    Looking up a Seam component in the JNDI ENC

    zzzz8

      Hi,

      I originally posted this question on the Seam forum, but was redirected to this forum. Here's the http://www.jboss.com/index.html?module=bb&op=viewtopic&t=91810 to the original post.

      I'll repost my question here, but it essentially has to do with my problem in looking up a Seam component via JNDI on Tomcat. I would appreciate any help. Thanks!

      "zzzz8" wrote:
      I'm running Seam in Tomcat (EJB 3 embedded) and my client program cannot perform the lookup. I'm not sure if I'm missing something in my configuration files. My jndi.properties has the following (which is the default content in the jndi.properties file given in the Seam examples):

      java.naming.factory.initial org.jnp.interfaces.LocalOnlyContextFactory
      java.naming.factory.url.pkgs org.jboss.naming:org.jnp.interfaces


      My stateless session bean is defined like this:

      @Name("TestConnection")
      @Stateless
      public final class TestConnectionBean implements TestConnectionLocal {
      ...
      }


      In my client code which is used to lookup the Seam component, I have the following:

      TestConnectionLocal connection = null;
      try {
       InitialContext ctx = new InitialContext();
       connection = (TestConnectionLocal) ctx.lookup("java:comp/env/ejb/TestConnectionBean/local");
      ....
      }


      When I try invoking it from my client code, I get the typical NameNotFoundException error:

      javax.naming.NameNotFoundException: Name TestConnectionBean is not bound in this Context


      I've noticed the following on startup on the Tomcat console:

      INFO 30-09 18:54:08,523 (Component.java:<init>:217) -Component: TestConnection, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: test.TestConnectionBean, JNDI: TestConnectionBean/local


      I've tried a couple of different contexts without success:

      java:comp/env/TestConnectionBean/local
      TestConnectionBean/local
      etc...

      The Tomcat JMX console (and I'm also using MC4J) don't seem to show the Seam components anywhere... What am I doing wrong? Thanks!
      [/url]