Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-1371

Knox upgarde from pre-1.0.0 fails because of error "unable to compile class for redirecting.jsp"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1.0
    • None
    • None

    Description

      When upgrading Knox, the JSP files are not upgraded and the packages they reference are not part of the adapter package, as a result we get the following error in gateway.log after upgrading

      2018-06-30 06:29:39,984 ERROR knox.gateway (GatewayServlet.java:doFilter(177)) - Gateway processing failed: org.apache.jasper.JasperException: Unable to compile class for JSP:
      
      An error occurred at line: 16 in the generated java file: [/var/lib/knox/data-3.0.0.0-1565/deployments/knoxsso.topo.1644772c408/%2Fknoxauth/META-INF/temp/jsp/org/apache/jsp/redirecting_jsp.java]
      Only a type can be imported. org.apache.hadoop.gateway.topology.Topology resolves to a package
      
      An error occurred at line: 17 in the generated java file: [/var/lib/knox/data-3.0.0.0-1565/deployments/knoxsso.topo.1644772c408/%2Fknoxauth/META-INF/temp/jsp/org/apache/jsp/redirecting_jsp.java]
      Only a type can be imported. org.apache.hadoop.gateway.topology.Service resolves to a package
      
      An error occurred at line: 18 in the generated java file: [/var/lib/knox/data-3.0.0.0-1565/deployments/knoxsso.topo.1644772c408/%2Fknoxauth/META-INF/temp/jsp/org/apache/jsp/redirecting_jsp.java]
      Only a type can be imported. org.apache.hadoop.gateway.util.RegExUtils resolves to a package
      
      An error occurred at line: 43 in the jsp file: /redirecting.jsp
      Topology cannot be resolved to a type
      40:
      41: <script type="text/javascript" src="js/knoxauth.js"></script>
      42: <%
      43: Topology topology = (Topology)request.getSession().getServletContext().getAttribute("org.apache.hadoop.gateway.topology");
      44: String whitelist = null;
      45: Collection services = topology.getServices();
      46: for (Object service : services) {
      
      An error occurred at line: 43 in the jsp file: /redirecting.jsp
      Topology cannot be resolved to a type
      40:
      41: <script type="text/javascript" src="js/knoxauth.js"></script>
      42: <%
      43: Topology topology = (Topology)request.getSession().getServletContext().getAttribute("org.apache.hadoop.gateway.topology");
      44: String whitelist = null;
      45: Collection services = topology.getServices();
      46: for (Object service : services) {
      
      An error occurred at line: 47 in the jsp file: /redirecting.jsp
      Service cannot be resolved to a type
      44: String whitelist = null;
      45: Collection services = topology.getServices();
      46: for (Object service : services) {
      47: Service svc = (Service)service;
      48: if (svc.getRole().equals("KNOXSSO")) {
      49: Map<String, String> params = svc.getParams();
      50: whitelist = params.get("knoxsso.redirect.whitelist.regex");
      
      An error occurred at line: 47 in the jsp file: /redirecting.jsp
      Service cannot be resolved to a type
      44: String whitelist = null;
      45: Collection services = topology.getServices();
      46: for (Object service : services) {
      47: Service svc = (Service)service;
      48: if (svc.getRole().equals("KNOXSSO")) {
      49: Map<String, String> params = svc.getParams();
      50: whitelist = params.get("knoxsso.redirect.whitelist.regex");
      
      An error occurred at line: 56 in the jsp file: /redirecting.jsp
      RegExUtils cannot be resolved
      53: if (whitelist == null)
      
      { 54: whitelist = ""; 55: }
      
      56: boolean validRedirect = RegExUtils.checkWhitelist(whitelist, request.getParameter("originalUrl"));
      57: if (validRedirect) {
      58: %>
      59: <script>

      Attachments

        Activity

          People

            smore Sandeep More
            smore Sandeep More
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: