1 2 Previous Next 18 Replies Latest reply on Feb 21, 2013 9:32 AM by Will Tatam

    problem about remote ejb invoking in JBAS7.1

    Joseph Wu Newbie

      good day all,

       

      I have setup the AS 7.1 server using a modified standalone-full-ha.xml (modifications are listed below).I make some remote ejb calls to ejb running on the AS and saw some exceptions(colored red below):

       

      ======================================client logs below======================

      2012-2-24 15:59:24 org.xnio.Xnio <clinit>

      INFO: XNIO Version 3.0.3.GA

      2012-2-24 15:59:24 org.xnio.nio.NioXnio <clinit>

      INFO: XNIO NIO Implementation Version 3.0.3.GA

      2012-2-24 15:59:24 org.jboss.remoting3.EndpointImpl <clinit>

      INFO: JBoss Remoting version 3.2.2.GA

      2012-2-24 15:59:24 org.jboss.ejb.client.remoting.VersionReceiver handleMessage

      INFO: Received server version 1 and marshalling strategies [river]

      2012-2-24 15:59:24 org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate

      INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@186c730, receiver=Remoting connection EJB receiver [connection=Remoting connection <9934d4>,channel=jboss.ejb,nodename=joe-pc]} on channel Channel ID 8ca5bb4e (outbound) of Remoting connection 01e4853f to /127.0.0.1:4447

      2012-2-24 15:59:24 org.jboss.ejb.client.remoting.VersionReceiver handleMessage

      INFO: Received server version 1 and marshalling strategies [river]

      2012-2-24 15:59:24 org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate

      INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@111b910, receiver=Remoting connection EJB receiver [connection=org.jboss.naming.remote.client.cache.ConnectionCache$ConnectionWrapper@1e1dadb,channel=jboss.ejb,nodename=joe-pc]} on channel Channel ID 91a7b2df (outbound) of Remoting connection 005b0668 to localhost/127.0.0.1:4447

      2012-2-24 15:59:25 org.jboss.ejb.client.EJBClient <clinit>

      INFO: JBoss EJB Client version 1.0.2.Final

      2012-2-24 15:59:25 org.jboss.remoting3.remote.RemoteConnection handleException

      ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

      2012-2-24 15:59:25 org.jboss.remoting3.remote.RemoteConnection handleException

      ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

      2012-2-24 15:59:25 MainTest test

      信息: hello: 1330070365026

      2012-2-24 15:59:25 MainTest test

      信息: hello: 1330070365116

       

      =================config and code==============================

      server side things below :

      ---------------------------------------standalone-full-ha.xml modifications---------------------

       

                  <security-realm name="ApplicationRealm">

                      <authentication>

                          <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>

                      </authentication>

                  </security-realm>

      ....

              <subsystem xmlns="urn:jboss:domain:remoting:1.1">

                  <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>

              </subsystem>

      ....

       

                      <security-domain name="my-security-domain" cache-type="default">

                          <authentication>

                              <login-module code="Remoting" flag="optional">

                                  <module-option name="password-stacking" value="useFirstPass"/>

                              </login-module>

                              <login-module code="RealmUsersRoles" flag="required">

                                  <module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>

                                  <module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>

                                  <module-option name="realm" value="ApplicationRealm"/>

                                  <module-option name="password-stacking" value="useFirstPass"/>

                              </login-module>

                          </authentication>

                      </security-domain>

      ....

       

      ------------------------------------application-users.properties----------------------(passwd=123456)

       

      myname=bd66e73f67b3a81bebf618ba2097210d

       

      ------------------------------------application-roles.properties----------------------

      myname=testuserrole

       

      ------------------------------------HellowWorldImpl---------------------

      @Stateless(name = "myname_test_hello")

      @Clustered

      @Remote(HellowWorldRemote.class)

      @Local(HellowWorldLocal.class)

      @SecurityDomain(value = "my-security-domain")

      public class HellowWorldImpl implements HellowWorldRemote, HellowWorldLocal {

       

      @RolesAllowed(value = { "testuserrole" })

      public String hello(String name) {

        String ret = "hello: " + name ;

        log.info(ret + ",hashcode:" + hashCode());

        return ret;

      }

       

      ------------------------------server biz logs------------------------

      ...

      INFO  [com.biz.ejb.impl.HellowWorldImpl] (EJB default - 3) hello: 1330069243765,hashcode:16660345

      ...

       

      ==============================================

       

      client side things below

      ----------------------------------------jboss-ejb-client.properties -------------------------

      endpoint.name=client-endpoint
      remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
      remote.connections=default
      remote.connection.default.host=127.0.0.1
      remote.connection.default.port = 4447
      remote.connection.default.username=myname
      remote.connection.default.password=123456


      java.naming.provider.url=remote://localhost:4447
      java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
      java.naming.factory.url.pkgs=org.jboss.ejb.client.naming

      jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=true
      jboss.naming.client.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS=JBOSS-LOCAL-USER
      jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false

       

      ----------------------------------ctx env setup code ------------------------------------------------

       

        Properties props = new Properties();

        props.load(EJBHomeFactory.class.getResourceAsStream("/jboss-ejb-client.properties"));

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

        props.put(Context.SECURITY_CREDENTIALS,

                                  "123456");

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

        context = new InitialContext(props);

       

      ----------------------------------client side invoking code --------------------------------------

       

         HellowWorldRemote remo=(HellowWorldRemote)EJBHomeFactory.getInstance().lookup("ejb:/testEJB//myname_test_hello!com.biz.ejb.face.HellowWorldRemote", HellowWorldRemote.class);

         log.info(remo.hello(Long.toString(System.currentTimeMillis())));

         log.info(remo.hello(Long.toString(System.currentTimeMillis())));

       

      ================================end ======================

       

       

      Question is , it seemed that I have successfully made calls two times to hello method but why do I have the following log on client side? (server side log shown no exceptions but normal biz logs).Anything wrong or missed for my server/client configurations? how to fix those SaslException ?

       

      2012-2-24 15:59:25 org.jboss.remoting3.remote.RemoteConnection handleException

      ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

       

       

      thank you very much

        • 1. Re: problem about remote ejb invoking in JBAS7.1
          jaikiran pai Master

          Do you see any exception stacktraces?

          • 2. Re: problem about remote ejb invoking in JBAS7.1
            Joseph Wu Newbie

            nope....no stacktraces.Does it mean that I can ignor that? But it is so annoying and break the beauty of my logs......

            • 3. Re: problem about remote ejb invoking in JBAS7.1
              jaikiran pai Master

              Joseph Wu wrote:

               

              nope....no stacktraces.Does it mean that I can ignor that?

              I'm not sure why that error should be showing up.  By the way, you have mixed a lot of things in that code:

               

              1) You are using remote-naming initialcontextfactory to lookup the beans. If that's what you want to use then you don't need jboss-ejb-client.properties and you shouldn't be using the ejb: namespace

              2) If you want to use the ejb: namespace JNDI then you'll need the jboss-ejb-client.properties but you'll have to remove all those unnecessary jboss.naming  and java.naming properties from that file. It just adds to the confusion when you use more than one approach in that one example.

              • 4. Re: problem about remote ejb invoking in JBAS7.1
                Joseph Wu Newbie

                thank you very much for your advice about namespace problems .I will delete those " jboss.naming " and  "java.naming" lines

                • 5. Re: problem about remote ejb invoking in JBAS7.1
                  Jeremy Whiting Expert

                  Hi Jirkiran,

                  I hate to join the conversation as a "me too" participent. But, I am seeing this problem too. So it isn't isolated to Joseph. My application has failed to invoke remote ejb objects since as7.1 final was released.

                   

                  The JEE application is unchanged from before 7.1 final was released. The client invoking the ejb has been configured with Application Realm credentials.

                   

                  What I have found is invocations from the same machine do work. But when the ejb client is on a different machine it fails with this error reported on the client.

                  No exceptions are thrown on the server. This is the error on the client I see

                   

                  Could not register a EJB receiver for connection to remote://hornetq:4447

                  java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

                   

                  Is there anything I should be checking in particular to investigate further ?

                   

                  Regards,

                  Jeremy

                  • 6. Re: problem about remote ejb invoking in JBAS7.1
                    jaikiran pai Master

                    Jeremy Whiting wrote:

                     

                     

                    Could not register a EJB receiver for connection to remote://hornetq:4447

                    java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

                     

                    Is there anything I should be checking in particular to investigate further ?

                     

                    Can you post the server side standalone.xml (mainly the remoting subsystem and the EJB subsystem)? Also have you added a user to the ApplicationRealm (assuming that's the one you are using) using the add-user script? What do your client side properties look like and what does the client side code look like? Also please, post the entire exception stacktrace.

                    • 7. Re: problem about remote ejb invoking in JBAS7.1
                      Jeremy Whiting Expert

                      Hi Jaikiran,

                       

                      Can you post the server side standalone.xml (mainly the remoting subsystem and the EJB subsystem)?

                      ....

                      <subsystem xmlns="urn:jboss:domain:ejb3:1.2">

                                  <session-bean>

                                      <stateless>

                                          <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>

                                      </stateless>

                                      <stateful default-access-timeout="5000" cache-ref="simple"/>

                                      <singleton default-access-timeout="5000"/>

                                  </session-bean>

                                  <mdb>

                                      <resource-adapter-ref resource-adapter-name="hornetq-ra"/>

                                      <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>

                                  </mdb>

                                  <pools>

                                      <bean-instance-pools>

                                          <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

                                          <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

                                      </bean-instance-pools>

                                  </pools>

                                  <caches>

                                      <cache name="simple" aliases="NoPassivationCache"/>

                                      <cache name="passivating" passivation-store-ref="file" aliases="SimpleStatefulCache"/>

                                  </caches>

                                  <passivation-stores>

                                      <file-passivation-store name="file"/>

                                  </passivation-stores>

                                  <async thread-pool-name="default"/>

                                  <timer-service thread-pool-name="default">

                                      <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>

                                  </timer-service>

                                  <remote connector-ref="remoting-connector" thread-pool-name="default"/>

                                  <thread-pools>

                                      <thread-pool name="default">

                                          <max-threads count="10"/>

                                          <keepalive-time time="100" unit="milliseconds"/>

                                      </thread-pool>

                                  </thread-pools>

                                  <iiop enable-by-default="false" use-qualified-name="false"/>

                              </subsystem>

                      ...

                      <subsystem xmlns="urn:jboss:domain:remoting:1.1">

                                  <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>

                              </subsystem>

                      ...

                       

                      Also have you added a user to the ApplicationRealm (assuming that's the one you are using) using the add-user script?

                       

                      Yes, and double checked the entry in application-users.properties

                       

                      What do your client side properties look like

                       

                       

                      endpoint.name=client-endpoint

                      remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

                      remote.connections=default

                      remote.connection.default.host=f16lite

                      remote.connection.default.port=4447

                      remote.connection.username=specejb

                      remote.connection.password=specejbclient

                      remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

                       

                       

                      and what does the client side code look like?

                       

                      I will send it to you directly as it is is copywrited code by SPEC. It is regular EJB call. Passing a couple of string parameters.

                       

                      Also please, post the entire exception stacktrace.

                       

                      Here are a couple of stack traces.

                       

                      Message:

                      Could not register a EJB receiver for connection to remote://f16lite:4447

                      Details:

                      HostSequenceDateMillis
                      f16lite62012-02-20T17:53:231329760403379

                       

                      Logger: org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector

                      ThreadClassMethod
                      10org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelectorsetupEJBReceivers

                      Exception:

                      Message:

                      java.lang.RuntimeException: java.io.IOException: JBREM000202: Abrupt close on Remoting connection 2017b2b2 to f16lite/10.42.0.1:4447

                       

                      Stack Trace:

                      ClassMethodLine
                      org.jboss.ejb.client.remoting.IoFutureHelperget91
                      org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelectorsetupEJBReceivers115
                      org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector<init>77
                      org.jboss.ejb.client.EJBClientContext<clinit>76
                      org.jboss.ejb.client.EJBInvocationHandlerdoInvoke120
                      org.jboss.ejb.client.EJBInvocationHandlerinvoke104
                      $Proxy29setPropertyOnDB
                      org.spec.jent.driver.MfgDriverinitializeRunConfig166
                      org.spec.jent.driver.MfgDriverinitializeAndAudit131
                      sun.reflect.NativeMethodAccessorImplinvoke0
                      sun.reflect.NativeMethodAccessorImplinvoke57
                      sun.reflect.DelegatingMethodAccessorImplinvoke43
                      java.lang.reflect.Methodinvoke616
                      com.sun.faban.driver.engine.AgentThreadinvokePrePost414
                      com.sun.faban.driver.engine.AgentThreadpreRun347
                      com.sun.faban.driver.engine.TimeThreaddoRun87
                      com.sun.faban.driver.engine.AgentThreadrun202

                       

                       

                       

                       

                      Record:21       Level:SEVERE

                       

                      Message:

                      MfgDriverAgent[0].0.initializeAndAudit: No EJB receiver available for handling [appName:specj,modulename:specj.jar,distinctname:] combination

                      Details:

                      HostSequenceDateMillis
                      f16lite72012-02-20T17:53:231329760403396

                       

                      Logger: com.sun.faban.driver.engine.TimeThread.0

                      ThreadClassMethod
                      10com.sun.faban.driver.engine.AgentThreadcheckFatal

                      Exception:

                      Message:

                      java.lang.IllegalStateException: No EJB receiver available for handling [appName:specj,modulename:specj.jar,distinctname:] combination

                       

                      Stack Trace:

                      ClassMethodLine
                      org.jboss.ejb.client.EJBClientContextrequireEJBReceiver530
                      org.jboss.ejb.client.ReceiverInterceptorhandleInvocation84
                      org.jboss.ejb.client.EJBClientInvocationContextsendRequest175
                      org.jboss.ejb.client.EJBInvocationHandlerdoInvoke136
                      org.jboss.ejb.client.EJBInvocationHandlerdoInvoke121
                      org.jboss.ejb.client.EJBInvocationHandlerinvoke104
                      $Proxy29setPropertyOnDB
                      org.spec.jent.driver.MfgDriverinitializeRunConfig166
                      org.spec.jent.driver.MfgDriverinitializeAndAudit131
                      sun.reflect.NativeMethodAccessorImplinvoke0
                      sun.reflect.NativeMethodAccessorImplinvoke57
                      sun.reflect.DelegatingMethodAccessorImplinvoke43
                      java.lang.reflect.Methodinvoke616
                      com.sun.faban.driver.engine.AgentThreadinvokePrePost414
                      com.sun.faban.driver.engine.AgentThreadpreRun347
                      com.sun.faban.driver.engine.TimeThreaddoRun87
                      com.sun.faban.driver.engine.AgentThreadrun202
                      • 8. Re: problem about remote ejb invoking in JBAS7.1
                        jaikiran pai Master

                        Can you give a quick try by adding:

                         

                        remote.connection.default.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS=JBOSS-LOCAL-USER

                        remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false

                         

                        to the properties?

                        • 9. Re: problem about remote ejb invoking in JBAS7.1
                          Jeremy Whiting Expert

                          Certainly yes. I tried again with the properties and the same exceptions occurs.

                          • 10. Re: problem about remote ejb invoking in JBAS7.1
                            jaikiran pai Master

                            Okay, I'm heading out now, so I'll give it a check during the weekend and try reproducing it.

                            • 11. Re: problem about remote ejb invoking in JBAS7.1
                              Jeremy Whiting Expert

                              If you need any further details just ask. I will be checking the forum over the weekend for further things you need.

                               

                              Jeremy

                              • 13. Re: problem about remote ejb invoking in JBAS7.1
                                jaikiran pai Master

                                Jeremy Whiting wrote:

                                 

                                I see this JIRA has already been raised for the issue.

                                 

                                https://issues.jboss.org/browse/AS7-3820

                                 

                                 

                                That's a different issue. It relates to a EJB on one server trying to talk to another on a different server which I believe isn't your case. You are trying to connect from a standalone client to a remote server.

                                • 14. Re: problem about remote ejb invoking in JBAS7.1
                                  Jeremy Whiting Expert

                                  Yes you are right. I will raise a JIRA and work on getting a test case to re-create the issue for client to server invocations.

                                   

                                  Regards,

                                  Jeremy

                                  1 2 Previous Next