2 Replies Latest reply on Nov 12, 2006 1:43 AM by jaikiran pai

    Problem with jndi bindings: my SLSB's not bound

    Eetu Blomqvist Newbie

      Hi!

      I have problems with jndi. I cant get reference to my SLSB:s remote interface with lookup.

      The servlet which is using the lookup

      
      Properties props = new Properties();
      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
      props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      
      InitialContext context = new InitialContext(props);
      th=(TuoteHallintaRemote)context.lookup("TuoteHallintaRemote.class.getName()");
      
      


      SLSB code:

      
      @Stateless
      public class TuoteHallintaBean implements TuoteHallintaRemote {
      
       @PersistenceContext(unitName="def")
       protected EntityManager em;
      
       public boolean lisaaTuote(String nimi, Integer hinta) {
      
       Tuote t = new Tuote(nimi, hinta);
       em.persist(t);
       return true;
       }
      
       public Collection<Tuote> listaaTuotteet() {
      
       Query query = em.createQuery("from Tuote t");
       ArrayList al = (ArrayList)query.getResultList();
       return al;
       }
      
      }
      
      


      Remote Interface code:

      
      @Remote
      public interface TuoteHallintaRemote {
      
       public Collection<Tuote> listaaTuotteet();
       public boolean lisaaTuote(String nimi, Integer hinta);
      }
      
      


      Jboss's log says:

      14:42:26,322 INFO [STDOUT] com.hajat.db.TuoteHallintaRemote not bound


      I can't figure this out!