3 Replies Latest reply on Jun 9, 2010 11:08 PM by Sean Whyte

    Trunk JBossWeb breaks backward compatibility

    Sean Whyte Newbie

      The code that is currently in the trunk for JBossWeb breaks backward compatibility because of changes in the AuthenticatorBase class to both the authenticate() and register methods(). These methods have always used  org.apache.catalina.connector.Response instead of the javax.servlet.http.HttpServletResponse. Even the JBoss 2.1.4 release still does it the old way.


      The new AuthenticatorBase class has changed the signatures for authenticate() and register(), while leaving invoke() the same. Obviously, the signature change will break anything that inherits from AuthenticatorBase in the future.


      The authenticate method is less problematic because it is abstract. But the register method is bad because it has all the logic.


      Would it be possible to add a simple method:

      protected void register(Request request, Response response, Principal principal, String authType, String username, String password)
        register(request, (HttpServletResponse) response, principal, authType, username, password);

      This would allow current changes, without breaking any code that has even depended on AuthenticatorBase.


      A similar method for authenticate() would also be nice for the same reasons.


      FYI, the current trunk code for JBossWeb is being used in JBoss 6 M2/M3.

        • 1. Re: Trunk JBossWeb breaks backward compatibility
          Jean-Frederic Clere Master

          The same changes were done in Tomcat due to the new Servlet 3.0 authenticate(HttpServletResponse response) in javax,servlet.http

          • 2. Re: Trunk JBossWeb breaks backward compatibility
            Nick Newman Newbie

            Hi Sean,


            At first glance I didn't think that your suggested change of adding back the "register" with the Request parameter would help.  After all, if you have a Request object you can already pass it to the HttpServletResponse version.


            However I was wrong.  Your suggestions maintains run-time compatibility, so that code compiled under the old signature will run with the new version.


            I made an additional suggestion here: https://community.jboss.org/message/547145#547145




            • 3. Re: Trunk JBossWeb breaks backward compatibility
              Sean Whyte Newbie

              Nick and Jean-Frederic,


              Thanks for the responses. My  intent was to make sure JBoss was aware of the problem with backward  compatibility. Especially before the official JBoss 6 version is  released. I ran into the problem while trying to verify that my company  software still worked with the new JBoss 6 release.


              Moving  forward, I have already implemented a working solution. It required  using reflection and is kind of ugly. But I have spent plenty of time with this  and currently that seems to be the only 'good' solution from my side (without having the original signature).  Since I have no control over what JBoss decides to do, I had to move  forward with the assumption that nothing would happen.


              I  would hope that asking for both method signatures in the  AuthenticatorBase class is not an unreasable request. Maybe this isn't  the right place to ask for the request? If I knew who to talk to about  it I would.