JBoss EJB problem


General J2EE: JBoss EJB problem

  1. JBoss EJB problem (7 messages)

    I'm using jboss as application server, my application use session EJBs but I have this error:

    "no ejb-link in web.xml and no jndi-name in jboss-web.xml"

    MY ejb-jar.xml:

          <description>Session Bean ( Stateless )</description>

    MY web.xml:


    Can anyone help me to find why I have that error?
  2. Do you have any specific reason of declaring the ejb-ref in web.xml.
    I never needed to do unless it is a local bean.
    Your ejb-jar shows it is a remote bean & in jboss the jbos.xml is the vendor specific file where you can put your jndi name.

    jboss-web.xml is a webserver level deployment descriptor and of no use while deploying ejbs. just remove the entries from web.xml and it should be able to deploy.

    Even jboss uses the ejb-name as the jndi name if you do not specify in the jboss.xml
  3. Ok I do what you say, and I can deploy it, but when I invoke an EJB method, I get this error:

    "EmpleadoSessionEJB not bound"


    Context ctx = getInitialContext();
    Object objref = ctx.lookup("EmpleadoSessionEJB");
    empleadoHome = (EmpleadoSessionEJBHome) PortableRemoteObject.narrow(objref, EmpleadoSessionEJBHome.class);

    empleadoRemote = empleadoHome.create();


        private Context getInitialContext() throws NamingException
            Properties properties = null;
            String error = "";
            properties = new Properties();
            properties.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
            properties.put("java.naming.provider.url", "jnp://localhost:1099");
            properties.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
                return new InitialContext(properties);
            catch (NamingException e)
                System.out.println("ERROR_DTO " +
                error = "error.servidor.general";
                throw new NamingException(error);

  4. Create jboss.xml and rebuild your ejb[ Go to top ]

    Save this as jboss.xml and rebuild your ejb and deploy.
    Everything else what you have done is perfectly fine.
    Make sure the docype declaration matches your version of JBoss you are using
    <?xml version="1.0"?>

    <!DOCTYPE jboss PUBLIC
          "-//JBoss//DTD JBOSS 3.2//EN"

  5. Create jboss.xml and rebuild your ejb[ Go to top ]

    Thanks for all your help, but I get the same error: "EJB not bound"!!! What else can I do??
  6. How you are ensuring your EJB is deployed?
    Check the jndi tree if you have any means to do that.

    Send the stack trace saying ejb not bound. If possible mail me your bean at dasexpress@hotmail.com
  7. I MADE IT, THANKS FOR ALL YOUR HELP, it was a sintaxis error on the web.xml, THANKS!!!
  8. Not able to use EJB with JBoss.[ Go to top ]

    Can you please tell in detail, how did you fix your problem. I am also facing same problem. If I define ejb in web.xml then deployment fails. When I remove entries from web.xml I am able to deploy but I get ClassCastException at run time. Please advise.