0 Replies Latest reply on Jun 20, 2017 8:16 AM by Aymen Ragoubi

    EJB client context selector may not be changed

    Aymen Ragoubi Newbie

      I am trying to get ejb exposed into jbossAS7.1  within another code running in jetty server :

       

      final Properties jndiProperties = new Properties();

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

      jndiProperties.put(Context.PROVIDER_URL, "remote://127.0.0.1:4447");

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

      jndiProperties.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");

      jndiProperties.put(Context.SECURITY_PRINCIPAL, "ubiant");

      jndiProperties.put(Context.SECURITY_CREDENTIALS, "ubiant2iA");

      ctx = new InitialContext(jndiProperties);

       

      Object b = ctx.lookup("ejb:Hemis/HemisCoreClient//" + "HardwareDataManagement" + "!" + "com.ubiant.hemis.client.ejb.interf.I_HardwareDataManagement");

       

       

      But I am getting this exception:

      EJB client context selector may not be changed

       

      Could someone help me with this ?