7 Replies Latest reply on Dec 18, 2009 11:28 AM by jaikiran

    Problem connecting from JBoss 5.0.1 to 4.2.3

    lolmegafroi

      Hi,


      I want to deploy a web service using the newer JBoss AS 5.0.1 GA. With this webservice I need to log in to a JBoss 4.2.3 AS running an J2EE-application which provides the ws with data.

      But when trying to log in, the JBoss 5 tries not to connect to the given JBoss 4 but to itself!

      Using a standalone Java application works just fine.

      Is there any incompatiblity between JBoss 5 and 4?

      Does anyone has a clue what might be the source of that problem?

        • 1. Re: Problem connecting from JBoss 5.0.1 to 4.2.3
          jaikiran

          But when trying to log in, the JBoss 5 tries not to connect to the given JBoss 4 but to itself!

          How do you login? Post any relevant code and logs.

          • 2. Re: Problem connecting from JBoss 5.0.1 to 4.2.3
            lolmegafroi

            Hello jaikiran,

             

            basically I do the following:

             

            login(String login, String password, String server, String domain) {

            System.setProperty("java.security.auth.login.config", "<some_config_file>");

            System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");

            System.setProperty("java.naming.provider.url", "<login-server-ip>:1099");


            CallbackHandler handler = new AppCallbackHandler(login, password.toCharArray(), server, domain);

            LoginContext lc = new LoginContext("myloginpolicy", handler);

            lc.login();

            }

             

            For the following log I've copied the relevant application-policy section from the target's JBoss (4) conf/login-config.xml to the JBoss I want to login from (5) (had to strip it)

            So, the error output from the source JBoss with which I try to connect is:

             

            15:34:22,629 ERROR [<MyLoginClass>] Exception occurred

            javax.security.auth.login.LoginException: The login module class could not be found: de.jexam.server.jboss.security.MyServerLoginModule

            at javax.security.auth.login.LoginContext.invoke(LoginContext.java:808)

            at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)

            at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)

            at java.security.AccessController.doPrivileged(Native Method)

            at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)at javax.security.auth.login.LoginContext.login(LoginContext.java:579)

            at <MyLoginClass>.login(<MyLoginClass>.java)

            ...

             

            post changed - log was hidden

            • 3. Re: Problem connecting from JBoss 5.0.1 to 4.2.3
              jaikiran
              Did the forum mess up your post? I don't see any logs in your post.
              • 4. Re: Problem connecting from JBoss 5.0.1 to 4.2.3
                lolmegafroi
                *fixed*
                • 5. Re: Problem connecting from JBoss 5.0.1 to 4.2.3
                  jaikiran

                  In which jar does this class de.jexam.server.jboss.security.MyServerLoginModule reside on JBoss AS-5? And where is that jar placed?

                  • 6. Re: Problem connecting from JBoss 5.0.1 to 4.2.3
                    lolmegafroi
                    it is only located in security.jar under JBoss4.2.3.GA/server/config/default/lib
                    • 7. Re: Problem connecting from JBoss 5.0.1 to 4.2.3
                      jaikiran

                      lolmegafroi wrote:

                       

                      it is only located in security.jar under JBoss4.2.3.GA/server/config/default/lib

                      You should have that on the AS-5 instance, since that's where this login code is running