Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-1325

OpenAM fails to setup when deployed under the root uri ( '/' )

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.0, 11.0.0, 12.0.0, 13.0.0
    • Fix Version/s: 14.5.0
    • Component/s: configurator
    • Labels:
    • Environment:
      tomcat 6.0.35
    • Sprint:
      AM Sustaining Sprint 21, AM Sustaining Sprint 28, AM Sustaining Sprint 29, AM Sustaining Sprint 37, AM Sustaining Sprint 38
    • Story Points:
      3
    • Support Ticket IDs:

      Description

      I've tried to deploy openam 10 on tomcat 6.0.35 and kept getting

      ERROR: AMSetupServlet.configure: error
      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      at java.lang.String.substring(String.java:1958)
      at java.lang.String.substring(String.java:1925)
      at com.sun.identity.setup.ServicesDefaultValues.tagSwap(ServicesDefaultValues.java:560)
      at com.sun.identity.setup.ServicesDefaultValues.tagSwap(ServicesDefaultValues.java:534)

      After some debugging I found the bug

      The problem is that i was deploying under the root uri "/"

      This line in ServicesDefaultValues is the problem:

      setDeployURI(request.getContextPath(), map);

      In that case, the request getContextPath() is an empty string, which then blows up later when it attempts to do

      orig = orig.replaceAll("@" + key + "@", value.substring(1));

      value in this case being "CONSOLE_URI", which has been set to empty string

      So fix is easy, something along the lines of:

      String ctxPath = request.getContextPath();
      if( ctxPath == null || ctxPath.isEmpty() )

      { ctxPath = "/"; }

      setDeployURI(ctxPath, map);

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                markdr Mark de Reeper
                Reporter:
                ymenager ymenager
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2h Original Estimate - 2h
                  2h
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 28h
                  28h