org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 29 in the jsp file: /includes/decorators/header.jsp Generated servlet error: Type mismatch: cannot convert from Object to KeyboardShortcutManager

Atlassian JIRA | Joachim Ooi [Atlassian] | 7 years ago
  1. 0

    [JRA-21377] Type mismatch: cannot convert from Object to KeyboardShortcutManager - Atlassian JIRA

    atlassian.com | 1 year ago
    org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 29 in the jsp file: /includes/decorators/header.jsp Generated servlet error: Type mismatch: cannot convert from Object to KeyboardShortcutManager
  2. 0

    This bug has already being scheduled to be fixed in JIRA 4.2, so this is just for the record. As far as the investigation goes, this problem only occurs in JIRA EAR/WAR installation type and using JDK 1.5+. Here are the steps to reproduce the problem: - Download JIRA 4.1 war. - Install and configure. - Attempt to run. - First attempt at resolving the default splash page results in exceptions thrown. The following stack trace is thrown: {noformat} ... org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 29 in the jsp file: /includes/decorators/header.jsp Generated servlet error: Type mismatch: cannot convert from Object to KeyboardShortcutManager at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328) at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297) ... {noformat} It seems that there is a fundamental issue with the JSP code itself when being used with JDK 1.5+. The affected file is {{header.jsp}} file which is located in <JIRA_install>/atlassian-jira/includes/decorators/ directory: *Original:* {noformat} ... ... WebResourceManager webResourceManager = ComponentManager.getInstance().getWebResourceManager(); final KeyboardShortcutManager shortcutManager = ComponentManager.getComponentInstanceOfType(KeyboardShortcutManager.class); ... {noformat} *Fixed:* {noformat} ... WebResourceManager webResourceManager = ComponentManager.getInstance().getWebResourceManager(); final KeyboardShortcutManager shortcutManager = (KeyboardShortcutManager) ComponentManager.getComponentInstanceOfType(KeyboardShortcutManager.class); ... {noformat} There needs to be an explicit cast made to {{KeyboardShortcutManager}}. Cheers.

    Atlassian JIRA | 7 years ago | Joachim Ooi [Atlassian]
    org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 29 in the jsp file: /includes/decorators/header.jsp Generated servlet error: Type mismatch: cannot convert from Object to KeyboardShortcutManager
  3. 0

    This bug has already being scheduled to be fixed in JIRA 4.2, so this is just for the record. As far as the investigation goes, this problem only occurs in JIRA EAR/WAR installation type and using JDK 1.5+. Here are the steps to reproduce the problem: - Download JIRA 4.1 war. - Install and configure. - Attempt to run. - First attempt at resolving the default splash page results in exceptions thrown. The following stack trace is thrown: {noformat} ... org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 29 in the jsp file: /includes/decorators/header.jsp Generated servlet error: Type mismatch: cannot convert from Object to KeyboardShortcutManager at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328) at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297) ... {noformat} It seems that there is a fundamental issue with the JSP code itself when being used with JDK 1.5+. The affected file is {{header.jsp}} file which is located in <JIRA_install>/atlassian-jira/includes/decorators/ directory: *Original:* {noformat} ... ... WebResourceManager webResourceManager = ComponentManager.getInstance().getWebResourceManager(); final KeyboardShortcutManager shortcutManager = ComponentManager.getComponentInstanceOfType(KeyboardShortcutManager.class); ... {noformat} *Fixed:* {noformat} ... WebResourceManager webResourceManager = ComponentManager.getInstance().getWebResourceManager(); final KeyboardShortcutManager shortcutManager = (KeyboardShortcutManager) ComponentManager.getComponentInstanceOfType(KeyboardShortcutManager.class); ... {noformat} There needs to be an explicit cast made to {{KeyboardShortcutManager}}. Cheers.

    Atlassian JIRA | 7 years ago | Joachim Ooi [Atlassian]
    org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 29 in the jsp file: /includes/decorators/header.jsp Generated servlet error: Type mismatch: cannot convert from Object to KeyboardShortcutManager
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Tomcat 8 FORM not working

    Stack Overflow | 2 years ago | Mandy
    org.apache.jasper.JasperException: /login.jsp (line: 1, column: 1) File [] not found
  6. 0

    JSP Page becomes too long to get compile

    Stack Overflow | 5 years ago
    org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 320 in the generated java file The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit Stacktrace:

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.apache.jasper.JasperException

      Unable to compile class for JSP An error occurred at line: 29 in the jsp file: /includes/decorators/header.jsp Generated servlet error: Type mismatch: cannot convert from Object to KeyboardShortcutManager

      at org.apache.jasper.compiler.DefaultErrorHandler.javacError()
    2. GWT dev
      Compiler.compile
      1. org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
      2. org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
      3. org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
      4. org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
      4 frames