1 Reply Latest reply on Nov 4, 2001 3:05 AM by Scott Stark

    Multithreaded access

    David Roy Newbie

      I am trying to have multiple threads in a program hammer a session bean of mine that is running in JBoss 2.4.3. I am using jboss security, but the client does not authenticate, so it automatically obtains the unauthenticatedIdentity of "nobody".

      When I run just 1 thread, everything works perfectly. My configuration appears to be solid. But when I run 2+ threads, I get exceptions thrown in com.sun.security.auth.login.ConfigFile.getAppConfigurationEntry on the JBoss side.

      I have set the multi-threaded=true flag in the auth.conf file that the server uses, but to no avail.

      Is it possible to have multithreaded secure access to jboss? It appears that ConfigFile is not thread safe at all. Does JBoss make any attempt to access it from only one thread or have synchronized access to it?

        • 1. Re: Multithreaded access
          Scott Stark Master

          The default login config class from Sun is not thread safe. We had a workaround to ensure the initial load of
          the config file was accessed by a single thread but that was dropped for some reason. The simple workaround
          is to create a MBean that is loaded on startup to simply to a JAAS login. It does not even have to use a
          valid login as this will simply force the load of the auth.conf file in the MBean startup thread and allow
          for multi-threaded access. Alternatively, simply have
          a single client make a request against a secured bean and then start your multi-threaded tests.