5 Replies Latest reply on Aug 28, 2015 3:59 PM by Wasee Qazi

    EJB invocation in wildfly 9.x from standalone application

    Wasee Qazi Newbie

      I am getting below during lookup below is my code i also kept jboss-ejb-client.properties in class path below is properties file i am passing to Initial context.

       

         Properties jndiProps = new Properties();

          jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");

          jndiProps.put(Context.PROVIDER_URL,"http-remoting://localhost:4447");

          jndiProps.put(Context.SECURITY_PRINCIPAL, "admin");

          jndiProps.put(Context.SECURITY_CREDENTIALS, "admin");

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

          Context  ctx = new InitialContext(jndiProps);

      EJBSessionRemote libraryRemote= (EJBSessionRemote) ctx.lookup("EJBComponenet/EJBSession!com.test.EJBSessionRemote");

       

       

      javax.naming.NamingException: Failed to connect to any server. Servers tried: [http-remoting://localhost:4447]

        at org.jboss.naming.remote.client.HaRemoteNamingStore.failOverSequence(HaRemoteNamingStore.java:213)