4 Replies Latest reply on Apr 3, 2007 3:56 PM by Jörg Pfründer

    Newbie@Seam: Can not access Sessionbean from Servlet

    Jörg Pfründer Newbie


      I have deployed the tutorials and tried to generate own beans with the Eclipse Hibernate Tools. The Webapp works fine, I can create and find records in the database. There is only one ugly error in the log: "StateManager" not yet installed. I do not know if this is critical.
      Then I tried to write an own Servlet where I wanted to use the sessionbeans, but I always get a javax.naming.NameNotFoundException.

      The Bean is registered, I can use it with the JSP pages and I can see it in the JMX-Console:

      | +- SessionEditorBean (class: org.jnp.interfaces.NamingContext)
      | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
      | | +- local (class: java.lang.Object)

      My code:

      InitialContext ic= new InitialContext();
      bean = ic.lookup("seamapp/sessionEditor/local");

      public class SessionEditorBean implements SessionEditor {

      I have tried the Bean's classname as JNDI name but it didn't help. Has anyone an idea?
      Thank you very much.