Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-14072

AbstractInvocationHandler.handleInvocationException wraps SecurityExceptions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 21.0.0.Final
    • Web Services
    • None
    • Hide
      The original purpose was to analyse the need for WFLY-14039. This has been done and solved.
      Show
      The original purpose was to analyse the need for WFLY-14039 . This has been done and solved.
    • ---
    • ---

      The Class
      https://github.com/wildfly/wildfly/blob/master/webservices/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java has a central method handleInvocationException to deal with exceptions.

      Currently security exceptions are caught and wrapped into a InvocationTargetException.

      The proposed solution is to rethrow it.

       

      protected void handleInvocationException(final Throwable t) throws Exception {
            if (t instanceof MBeanException) {
               throw ((MBeanException) t).getTargetException();
            }
            if (t instanceof Exception) {
               if (t instanceof InvocationTargetException) {
                  throw (Exception) t;
               } else if (t instanceof SecurityException) {
                   throw (Exception) t;
               }  else {
                  SOAPFaultException ex = findSoapFaultException(t);
                  if (ex != null) {
                     throw new InvocationTargetException(ex);
                  }
                  throw new InvocationTargetException(t);
               }
            }
            if (t instanceof Error) {
               throw (Error) t;
            }
            throw new UndeclaredThrowableException(t);
          }
      

       

      This is a pre-step to analyse and fix WFLY-14039

              rhn-engineering-ema Jim Ma
              xf01213 Boris Unckel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: