3 Replies Latest reply on Nov 15, 2007 9:09 AM by adrian.brock

    Weird issue with interceptors

      There's something wrong with the hotdeployment of interceptors.

      If I run the bank ejb3 test from a fresh boot then the interceptor test works.
      However if I rerun the test it fails.

      Looks like the interceptors are not getting re-initialised when you redeploy the jar?

      I'll take a quick look to see if it is easy to figure out rather than
      embedded somewhere deep in aop. ;-)

      NOTE: These are interceptors from the deployment descriptor
      (which doesn't change), so I doubt this is a classloading issue.

        • 1. Re: Weird issue with interceptors

           

          "adrian@jboss.org" wrote:

          If I run the bank ejb3 test from a fresh boot then the interceptor test works.
          However if I rerun the test it fails.


          You've also got to rebuild the bank.jar to make the test pass.

          It looks like the problem is because EJBContainer::isBusinessMethod() is returning false
          when EJB3InterceptorsFactory invokes to see if it should apply interceptors.

          But I also see this return false when the test passes? And I haven't
          figured out why the test passes only when I rebuild the jar?????

          Also this code looks wrong to me. Since it doesn't take into account Covariant
          return types. It should be testing whether the return type is assignable
          not equal.

           private static boolean isCallable(Method method, Method other)
           {
           if ((method.getDeclaringClass().isAssignableFrom(other.getDeclaringClass())) && (method.getName() == other.getName()))
           {
           if (!method.getReturnType().equals(other.getReturnType()))
           return false;
           Class[] params1 = method.getParameterTypes();
           Class[] params2 = other.getParameterTypes();
           if (params1.length == params2.length)
           {
           for (int i = 0; i < params1.length; i++)
           {
           if (params1 != params2)
           return false;
           }
           return true;
           }
           }
           return false;
           }
          


          • 2. Re: Weird issue with interceptors

            The problem was fairly trivial an obvious, I've fixed it here:
            http://jira.jboss.com/jira/browse/EJBTHREE-1111

            For the test passing when it shouldn't, I've left it open as something to investigate
            http://jira.jboss.com/jira/browse/EJBTHREE-1112

            • 3. Re: Weird issue with interceptors

              Re: reopened EJBTHREE-1111

              Ok, I misread the spec. The requirement in the spec to implement the remote interface
              is for the EJBContainer to do on the proxy.

              I was actually looking up what it said about the return type (see above)
              when I saw that line and misinterpreted it.
              In hindsight its obviously wrong, since it wasn't even true in EJB2.1

              But at least the test is passing, so I'll know where I break things
              when I do annotation/metadata refactoring. ;-)

              It's most interesting because it fixes a test that looks at the transaction timeout
              config from jboss.xml

              I'll leave EJBTHREE-1111 open until we find out the real fix is found.