1 Reply Latest reply on May 15, 2006 11:27 AM by J-C jc

    Name not found exception

    Tomasz Zab?ocki Newbie

      Here is my problem

      I'm using jboss 4.0.4 RC2 and EJB3

      Here is my EJB interface

      package pl.tuz.polisy.ejb;

      import javax.annotation.EJB;
      import javax.ejb.Local;
      import pl.tuz.polisy.par.*;

      public interface TUZControl
      {
      public void mergeGrupaUstawowa(GrupaUstawowa grupaUstawowa);
      }

      and the implementation

      @Stateless
      public class TUZControlBean implements TUZControl
      {
      @PersistenceContext(unitName="TUZPolisy")
      EntityManager em;

      public void mergeGrupaUstawowa(GrupaUstawowa grupaUstawowa)
      {
      em.persist(grupaUstawowa);
      }
      }

      Here is how i access the ejb

      package pl.tuz.polisy.web;

      import javax.naming.InitialContext;
      import pl.tuz.polisy.ejb.TUZControl;
      import pl.tuz.polisy.ejb.TUZControlBean;

      public class Utils
      {
      public static TUZControl getTUZControl()
      {
      try
      {
      InitialContext ctx = new InitialContext();
      return (TUZControl) ctx.lookup(TUZControlBean.class.getName());
      }
      catch (Exception e)
      {
      e.printStackTrace();
      return null;
      }
      }
      }

      and the trace:

      04:57:20,250 INFO [STDOUT] javax.naming.NameNotFoundException: pl.tuz.polisy.ej
      b.TUZControlBean not bound
      04:57:20,250 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(Naming
      Server.java:514)
      04:57:20,250 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(Naming
      Server.java:522)
      04:57:20,250 INFO [STDOUT] at org.jnp.server.NamingServer.getObject(NamingS
      erver.java:528)
      04:57:20,250 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServ
      er.java:281)
      04:57:20,250 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(Namin
      gContext.java:610)
      04:57:20,250 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(Namin
      gContext.java:572)
      04:57:20,250 INFO [STDOUT] at javax.naming.InitialContext.lookup(Unknown So
      urce)
      04:57:20,250 INFO [STDOUT] at pl.tuz.polisy.web.Utils.getTUZControl(Utils.j
      ava:14)
      04:57:20,250 INFO [STDOUT] at pl.tuz.polisy.web.TUZServlet.doGet(TUZServlet
      .java:76)
      04:57:20,250 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpSe
      rvlet.java:697)
      04:57:20,250 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpSe
      rvlet.java:810)
      04:57:20,250 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterCha
      in.internalDoFilter(ApplicationFilterChain.java:252)
      04:57:20,250 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterCha
      in.doFilter(ApplicationFilterChain.java:173)
      04:57:20,250 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilte
      r.doFilter(ReplyHeaderFilter.java:81)
      04:57:20,250 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterCha
      in.internalDoFilter(ApplicationFilterChain.java:202)
      04:57:20,250 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterCha
      in.doFilter(ApplicationFilterChain.java:173)
      04:57:20,250 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve
      .invoke(StandardWrapperValve.java:213)
      04:57:20,250 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve
      .invoke(StandardContextValve.java:178)
      04:57:20,250 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipal
      Valve.invoke(CustomPrincipalValve.java:39)
      04:57:20,250 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssocia
      tionValve.invoke(SecurityAssociationValve.java:159)
      04:57:20,250 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValv
      e.invoke(JaccContextValve.java:59)
      04:57:20,250 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.in
      voke(StandardHostValve.java:126)
      04:57:20,250 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.i
      nvoke(ErrorReportValve.java:105)
      04:57:20,250 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.
      invoke(StandardEngineValve.java:107)
      04:57:20,250 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.s
      ervice(CoyoteAdapter.java:148)
      04:57:20,250 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.proc
      ess(Http11Processor.java:856)
      04:57:20,250 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http1
      1ConnectionHandler.processConnection(Http11Protocol.java:744)
      04:57:20,250 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.pr
      ocessSocket(PoolTcpEndpoint.java:527)
      04:57:20,250 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerT
      hread.run(MasterSlaveWorkerThread.java:112)
      04:57:20,250 INFO [STDOUT] at java.lang.Thread.run(Unknown Source)

      any clues?

      tzablock