3 Replies Latest reply on Sep 3, 2016 4:39 AM by mayerw01

    urgent problem with EJB invocations from a remote client using JNDI ?!!!

    kayvan.jamshidi

      I wrote a war application deployed on wildfly 9.0.2 final based on "EJB invocations from a remote client using JNDI" example on jboss documentation that connect to remote EJB inside war deployment on wildfly 10 .

      BUT!!! I stuck with this , getting this exception :

      ERROR [org.jboss.remoting.remote.connection] (Remoting "client-endpoint" I/O-1) JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed:

         DIGEST-MD5: javax.security.sasl.SaslException: DIGEST-MD5: Cannot perform callback to acquire realm, authentication ID or password [Caused by javax.security.auth.callback.UnsupportedCallbackException]

      14:00:27,058 WARN  [org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector] (ServerService Thread Pool -- 65) Could not register a EJB receiver for connection to remote ip server:7273: java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed:

         DIGEST-MD5: javax.security.sasl.SaslException: DIGEST-MD5: Cannot perform callback to acquire realm, authentication ID or password [Caused by javax.security.auth.callback.UnsupportedCallbackException]


      i used adduser script for create user pass in applicationrealm mode and i watched standalone-full.xml in subsystem remoting section that applicationrealm used for realm . so then it doesnt any problem with this. i should add any more config to standalone-full.xml to work fine my apps.

      any help so appreciated.

        • 1. Re: urgent problem with EJB invocations from a remote client using JNDI ?!!!
          mayerw01

          You should add the credentials to the jboss-ejb-client.properties

           

          remote.connection.default.username=username

          remote.connection.default.password=password

          • 2. Re: urgent problem with EJB invocations from a remote client using JNDI ?!!!
            kayvan.jamshidi

            private static Context createRemoteEjbContext(String host, String port) throws NamingException {

             

              Hashtable<Object, Object> props = new Hashtable<>();

             

              props.put(INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
               props.put("jboss.naming.client.ejb.context", true);

              props.put("org.jboss.ejb.client.scoped.context", true);
               props.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", false);

              props.put("remote.connections", "default");

              props.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", false);

              props.put(Context.SECURITY_PRINCIPAL, "username");

              props.put(Context.SECURITY_CREDENTIALS, "password");

              props.put(PROVIDER_URL, "http-remoting://" + host + ":" + port);

              props.put("remote.connection.default.host", host);

              props.put("remote.connection.default.port", port);

              props.put("remote.connection.default.connect.timeout", "15000");
               return new InitialContext(props);

            }

            already i have this config.

            • 3. Re: urgent problem with EJB invocations from a remote client using JNDI ?!!!
              mayerw01

              I experienced some issues when using this approach in the quickstart-10.x.

              Did you try to configure the boss-ejb-client.properties file instead?