2 Replies Latest reply on Apr 30, 2015 3:57 PM by D P

    Exception while invoking home.create method of EJB1.1 on JBoss 7.1.1

    D P Apprentice

      I am getting error -

      java.lang.IllegalArgumentException: Could not find ejb PatientEJB in app: PatientInfoEAR module: PatientInfoEJB distinct name:

      while calling home.create method of entity bean.

       

      I am looking up object using

      Object objref = context.lookup("ejb:PatientInfoEAR/PatientInfoEJB//PatientEJB!"+interfaceName);

       

      Also creating  InitialContext using below code.

       

                  Properties jndiProps = new Properties();

                  jndiProps.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.as.naming.InitialContextFactory");

                  jndiProps.setProperty(Context.PROVIDER_URL,"remote://localhost:4447");

                  jndiProps.setProperty("jboss.naming.client.ejb.context", "true");

                  jndiProps.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

                 

                  Context context = new InitialContext(jndiProps);

       

      Am I doing anything wrong.

       

      Thanks

        • 1. Re: Exception while invoking home.create method of EJB1.1 on JBoss 7.1.1
          Jay SenSharma Master

          Looks like you are using  Remoting based Client  rather than using the EJBClientContext based API so you should  not use the "ejb:" prefix before the JNDI name so can you try the following:

           

                 Hashtable<String, String> env = new Hashtable<String, String>();
                  env.put("java.naming.factory.initial", "org.jboss.naming.remote.client.InitialContextFactory");       // New InitialContextFactory
                  env.put("java.naming.provider.url", "remote://localhost:4447");
                  env.put("jboss.naming.client.ejb.context", "true");
                  env.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
                  env.put(Context.SECURITY_PRINCIPAL, "ejbUser");                                                        // ApplicationRealm User
                  env.put(Context.SECURITY_CREDENTIALS, "ejbPassword");
          
                  InitialContext context = new InitialContext(env);
                  Object objref = context.lookup("PatientInfoEAR/PatientInfoEJB//PatientEJB!"+interfaceName);
          

           

           

          AS 7.1.1 is too old.  Better if you try the later versions of it.

          • 2. Re: Exception while invoking home.create method of EJB1.1 on JBoss 7.1.1
            D P Apprentice

            Thanks for reply,

             

            From the http://jbossas.jboss.org/downloads/ download page I can see JBoss AS 7.1.1.Final as the latest application server.

            where can I find later JBoss AS versions.

             

            Thanks,