Fix Classcast (class java.math.BigInteger cannot be cast to class java.lang.String) - PluginResourceDownload.serveFile

XMLWordPrintable

    • Severity 3 - Minor

      Issue Summary

      Classcast in PluginResourceDownload.serveFile with struts

      Steps to Reproduce

      Enabling plugin might cause it

      Expected Results

      No exception

      Actual Results

      The below exception is thrown in the xxxxxxx.log file:

      2022-08-02 08:24:29,917 ERROR [http-nio-8080-exec-9] [[Catalina].[localhost].[/confluence].[file-server]] log Servlet.service() for servlet [file-server] in context with path [/confluence] threw exception
      java.lang.ClassCastException: class java.math.BigInteger cannot be cast to class java.lang.String (java.math.BigInteger and java.lang.String are in module java.base of loader 'bootstrap')
          at com.atlassian.plugin.webresource.ResourceUtils.lambda$getQueryParameters$1(ResourceUtils.java:76)
          at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4390)
          at com.atlassian.plugin.webresource.ResourceUtils.getQueryParameters(ResourceUtils.java:75)
          at com.atlassian.plugin.webresource.impl.support.http.Request.<init>(Request.java:64)
          at com.atlassian.plugin.webresource.servlet.PluginResourceDownload.serveFile(PluginResourceDownload.java:49)
          at com.atlassian.plugin.servlet.AbstractFileServerServlet.doGet(AbstractFileServerServlet.java:28)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

            Assignee:
            Kusal Kithul-Godage
            Reporter:
            Ganesh Gautam
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: