1 Reply Latest reply on Sep 11, 2014 4:05 PM by Wolf-Dieter Fink

    Consume EJB registred in Jboss 7.1 in app stand alone or JEE5 in glassfish 2.1

    Danilo Sousa Newbie

      I'm having trouble consuming EBJs Jboss 7.1.1 a legacy project that runs on glassfish 2.1

      I created a stand alone java app to consume the ejbs and it worked OK.


      Properties jndiProps = new Properties();
              jndiProps.put(Context.PROVIDER_URL, "remote://localhost:4447");
              jndiProps.put(Context.SECURITY_PRINCIPAL, "ejb");
              jndiProps.put(Context.SECURITY_CREDENTIALS, "123");
              jndiProps.put("jboss.naming.client.ejb.context", true);
              jndiProps.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
              Context ctx = new InitialContext(jndiProps);
              EjbRemote speaker = (EjbRemote) ctx.
                  System.out.println( speaker.hello() );

      I using Lib




      This worked perfectly, however when I try to do it in my ear design that runs on glassfish 2.1 i have the log

      has unsupported major or minor version numbers, which are greater than those found in the Java Runtime Environment version 1.6.0_65


      I tested the app stand alone in order to consume ejbs without the utilization of libjboss-as-ejb-client-bom, insert the following libs




      was displayed:

      Exception in thread "main" java.lang.NoClassDefFoundError: javax/ejb/NoSuchEJBException

      I believe to be out of a context jee

      someone already consumed ejbs a jboss 7.1.1 By Glasfish 2.1 in application JEE5 or standalone?