IBM Support

PH12946: STRINGINDEXOUTOFBOUNDSEXCEPTION WHEN USING JSF 2.2 IN LIBERTY

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • When using JSF 2.2 in Liberty 19.0.0.3, the following error
    occurs:
    
    [5/31/19 6:54:24:386 EDT] 0000002f
    org.apache.myfaces.webapp.AbstractFacesInitializer      E An
    error occured while initializing MyFaces:
    java.lang.StringIndexOutOfBoundsException: String index out
    of
    range: -1
    
    javax.faces.FacesException:
    java.lang.StringIndexOutOfBoundsException: String index out
    of
    range: -1
    
    at
    org.apache.myfaces.config.DefaultFacesConfigurationProvider.
    getC
    lassloaderFacesConfig(DefaultFacesConfigurationProvider.java
    :342
    )
    
    at
    org.apache.myfaces.config.DefaultFacesConfigurationMerger.ge
    tFac
    esConfigData(DefaultFacesConfigurationMerger.java:101)
    
    at
    org.apache.myfaces.config.FacesConfigurator.configure(FacesC
    onfi
    gurator.java:603)
    
    at
    org.apache.myfaces.webapp.AbstractFacesInitializer.buildConf
    igur
    ation(AbstractFacesInitializer.java:437)
    
    at
    org.apache.myfaces.webapp.Jsp21FacesInitializer.initContaine
    rInt
    egration(Jsp21FacesInitializer.java:74)
    
    at
    org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces
    (Abs
    tractFacesInitializer.java:186)
    
    at
    org.apache.myfaces.webapp.StartupServletContextListener.cont
    extI
    nitialized(StartupServletContextListener.java:119)
    
    at
    com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCr
    eate
    d(WebApp.java:2377)
    
    at
    com.ibm.ws.webcontainer31.osgi.webapp.WebApp31.notifyServlet
    Cont
    extCreated(WebApp31.java:514)
    
    at
    com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java
    :100
    5)
    
    ...
    
    Caused by: java.lang.StringIndexOutOfBoundsException: String
    index out of range: -1
    
    at java.lang.String.substring(String.java:1967)
    
    at
    org.apache.myfaces.view.facelets.util.Classpath._searchFromU
    RL(C
    lasspath.java:246)
    
    at
    org.apache.myfaces.view.facelets.util.Classpath._searchResou
    rce(
    Classpath.java:119)
    
    at
    org.apache.myfaces.view.facelets.util.Classpath.search(Class
    path
    .java:69)
    
    at
    org.apache.myfaces.config.DefaultFacesConfigResourceProvider
    .get
    MetaInfConfigurationResources(DefaultFacesConfigResourceProv
    ider
    .java:90)
    
    at
    org.apache.myfaces.config.DefaultFacesConfigurationProvider.
    getC
    lassloaderFacesConfig(DefaultFacesConfigurationProvider.java
    :312
    )
    
    ... 21 more
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  WebSphere Application Server 9.0 and 8.5.5  *
    *                  users of JavaServer Faces (JSF) and         *
    *                  WebSphere Liberty Profile users of jsf-2.0  *
    *                  and jsf-2.2                                 *
    ****************************************************************
    * PROBLEM DESCRIPTION: The Faces Servlet fails to initialize   *
    *                      due to a                                *
    *                      StringIndexOutOfBoundsException.        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    A StringIndexOutOfBoundsException is sometimes thrown during JSF
    Initialization which then causes an uncaught initialization
    exception.
    For Liberty, this occurs when using loose application
    deployments.
    Below are the two separate stack traces:
    
    Caused by: java.lang.StringIndexOutOfBoundsException: String
    index out of range: 0
        at java.base/java.lang.String.substring(String.java:2628)
        at
    org.apache.myfaces.view.facelets.util.Classpath._searchFromURL(C
    lasspath.java:236)
        at
    org.apache.myfaces.view.facelets.util.Classpath._searchResource(
    Classpath.java:117)
        at
    org.apache.myfaces.view.facelets.util.Classpath.search(Classpath
    .java:69)
    
    SRVE0276E: Error while initializing Servlet [Faces Servlet]:
    javax.servlet.ServletException: SRVE0207E: Uncaught
    initialization exception created by servlet
        at
    com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapp
    er.java:366)
        at
    com.ibm.ws.webcontainer.servlet.ServletWrapper.loadOnStartupChec
    k(ServletWrapper.java:1398)
        at
    com.ibm.ws.webcontainer.webapp.WebApp.doLoadOnStartupActions(Web
    App.java:1145)
        at
    com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinall
    y(WebApp.java:1113)
        at
    com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:101
    4)
        at
    com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:656
    6)
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PH12946

  • Reported component name

    WAS LIBERTY COR

  • Reported component ID

    5725L2900

  • Reported release

    855

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2019-06-07

  • Closed date

    2019-08-21

  • Last modified date

    2019-08-21

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WAS LIBERTY COR

  • Fixed component ID

    5725L2900

Applicable component levels

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"855","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
21 August 2019