[ 
https://issues.apache.org/jira/browse/MYFACES-4292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16858859#comment-16858859
 ] 

Bill Lucy commented on MYFACES-4292:
------------------------------------

I was able to reproduce this by following along with 
[https://github.com/OpenLiberty/open-liberty/issues/5898]

What's happening is a similar case to the existing comment - so I think the 
patch is fine.
_// This can happen if the classloader provided us a URL that it thinks exists_
_// but really doesn't.  In particular, if a JAR contains META-INF/MANIFEST.MF_
_// but not META-INF/, some classloaders may incorrectly report that META-INF/_
_// exists and we'll end up here.  Just ignore this case._

> String Out of Bounds Exception Thrown
> -------------------------------------
>
>                 Key: MYFACES-4292
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4292
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-344
>    Affects Versions: 2.2.12
>            Reporter: Volodymyr Siedlecki
>            Priority: Minor
>             Fix For: 2.2.13
>
>         Attachments: MYFACES-4292.diff
>
>
> When deploying an application, the placement of the MANIFEST.MF file in a 
> loose application xml can cause a java.lang.StringIndexOutOfBoundsException 
> during MyFaces initialization. This problem occurs with the following path: 
> /tmp/war/MANIFEST.MF 
> This issue was solved in JSF 2.3 with MYFACES-4273, but not in JSF 2.2.
> By moving the catch block to the outer try block in 
> myfaces/view/facelets/util/Classpath.java, the 
> StringIndexOutOfBoundsException will be caught, and the  faces initialization 
> will continue normally.  
> Stack Trace:
> 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(Classpath.java:246)
>      at 
> org.apache.myfaces.view.facelets.util.Classpath._searchResource(Classpath.java:119)
>      at 
> org.apache.myfaces.view.facelets.util.Classpath.search(Classpath.java:69)
>      at 
> org.apache.myfaces.config.DefaultFacesConfigResourceProvider.getMetaInfConfigurationResources(DefaultFacesConfigResourceProvider.java:90)
>      at 
> org.apache.myfaces.config.DefaultFacesConfigurationProvider.getClassloaderFacesConfig(DefaultFacesConfigurationProvider.java:312)
>      … 21 more



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to