9 Replies Latest reply on Jul 7, 2003 6:37 PM by cjboss

    comp not boud

    cjboss

      I am new in jboss. I run application client and obtain the next error:

      javax.naming.NameNotFoundException
      comp not bound

      any can help me.

        • 1. Re: comp not boud
          haraldgliebe

          JBoss, currently doesn't have a client container, so you can't use the java:comp/env namespace from an application client. Use the jndi-name of the EJBs directly.

          Regards,
          Harald

          • 2. Re: comp not boud
            cjboss

            JBoss, currently doesn't have a client container, so you can't use the java:comp/env namespace from an application client. Use the jndi-name of the EJBs directly.

            can use the java:comp/env/ejb/persona to EntityBean and java:comp/env/ejb/coorporacion to SessionBean

            • 3. Re: comp not boud
              cjboss

              I change for jndi and obtain the next error

              javax.naming.NameNotFoundException
              MiCoorporacion not bound

              any can help me.

              • 4. Re: comp not boud
                darranl

                Looks like the name you are looking up is not the same as the name that the bean is bound under.

                Can you post your jboss.xml and the code you are using to lookup the bean.

                • 5. Re: comp not boud
                  cjboss

                  My file jboss.xml

                  <?xml version="1.0"?>


                  <enterprise-beans>

                  <ejb-name>PersonaEJB</ejb-name>
                  <jndi-name>MiPersona</jndi-name>


                  <ejb-name>CoorporacionEJB</ejb-name>
                  <jndi-name>MiCoorporacion</jndi-name>
                  <ejb-ref>
                  <ejb-ref-name>ejb/persona</ejb-ref-name>
                  <jndi-name>MiPersona</jndi-name>
                  </ejb-ref>

                  </enterprise-beans>

                  • 6. Re: comp not boud
                    cjboss

                    My code in resumen:

                    public class EJBLocalizador
                    {
                    public static final String CMP_NEGOCIO_PERSONA = "MiCoorporacion";

                    public static CoorporacionHome gIObtenerCoorporacionHome()
                    throws NamingException {
                    Context loInicial = new InitialContext();
                    Object loReferencia = loInicial.lookup(CMP_NEGOCIO_PERSONA);
                    return (CoorporacionHome)
                    PortableRemoteObject.narrow(loReferencia, CoorporacionHome.class);
                    }

                    }

                    public class HerenciaClienteCMP
                    {
                    public static void main(String[] args) {
                    CoorporacionHome lICoorporacionHome;
                    Coorporacion lICoorporacion;

                    try {

                    lICoorporacionHome = EJBLocalizador.gIObtenerCoorporacionHome();
                    lICoorporacion = lICoorporacionHome.create();
                    System.exit(0);
                    }
                    catch (NamingException e) {
                    System.out.println("Namig: " + e.getMessage());
                    e.printStackTrace();
                    }
                    catch (Exception e) {
                    System.out.println("Error: " + e.getMessage());
                    }

                    }
                    }

                    • 7. Re: comp not boud

                      Goto http://localhost:8080/jmx-console
                      click on JNDIView and then click list.
                      You should see what its bound into global jndi at the bottom.
                      Is your ejb there with the name you expect?

                      Regards,
                      Adrian

                      • 8. Re: comp not boud
                        cjboss

                        I do click in http://localhost:8080/jmx-console and later do click:

                        service=JNDIView
                        not exist the JNDI the my EJB

                        in jboss.j2ee
                        not exist the JNDI the my EJB


                        • 9. Re: comp not boud
                          cjboss

                          I resolve this problem.

                          I work with interface local have that use
                          <ejb-local-ref>
                          <\ejb-local-ref>
                          in ejb-jar.xml

                          Thanks you for help me