Topic
2 replies Latest Post - ‏2013-05-14T07:13:54Z by Adrian
Adrian
Adrian
3 Posts
ACCEPTED ANSWER

Pinned topic wlp-8.5.next beta : servletContext.getResourcePaths throws FileNotFoundException on windows when a utility jar contains a blank in its path

‏2013-05-13T16:05:00Z |

On windows, with wlp-1.0.1.20130309-1525/websphere-kernel_1.0.1 (WAS 8.5 liberty profil .next beta).

 

When I call servletContext.getResourcePaths in my webapp and the webapp contains a utility jar with a blank in its path I got :

 

[ERROR   ] SRVE8043E: Une exception d'E-S s'est produite lors de la recherche du nom de fichier [META-INF/resources/WEB-INF/faces-views/] dans le fichier jarFile [] java.io.FileNotFoundException: C:\Program%20Files\Developpements\eclipse-liberty.next.b\workspace\test-blank\WebContent\WEB-INF\lib\test.jar (Le chemin d'accès spécifié est introuvable)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at com.ibm.ws.webcontainer.util.MetaInfResourcesFileUtils.getResourcePaths(MetaInfResourcesFileUtils.java:281)
at [internal classes]
at tmp.pag.FacesViewsInitializerListener.contextInitialized(FacesViewsInitializerListener.java:24)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:2241)
at [internal classes]
This happens when using JSF with omnifaces 1.2 (which calls servletContext.getResourcePaths)

 

I'm attaching a sample project for Eclipse.

To reproduce the error :

 

Here's the code for the sample ServletContextListener calling getResourcePaths :

 

@WebListener
public class FacesViewsInitializerListener implements ServletContextListener {
public static final String WEB_INF_VIEWS = "/WEB-INF/faces-views/";
 
@Override
    public void contextInitialized(ServletContextEvent context) {
        ServletContext servletContext = context.getServletContext();
        servletContext.getResourcePaths(WEB_INF_VIEWS);
    }
 
@Override
public void contextDestroyed(ServletContextEvent arg0) {
}
}

 

Thanks,

Adrian

Attachments

  • bergmark
    bergmark
    42 Posts
    ACCEPTED ANSWER

    Re: wlp-8.5.next beta : servletContext.getResourcePaths throws FileNotFoundException on windows when a utility jar contains a blank in its path

    ‏2013-05-13T16:34:24Z  in response to Adrian

    Thank you for reporting this issue on the beta!  I believe this is the same problem reflected in PM86037:

    http://www-01.ibm.com/support/docview.wss?uid=swg1PM86037

    • Adrian
      Adrian
      3 Posts
      ACCEPTED ANSWER

      Re: wlp-8.5.next beta : servletContext.getResourcePaths throws FileNotFoundException on windows when a utility jar contains a blank in its path

      ‏2013-05-14T07:13:54Z  in response to bergmark

      Thanks bergmark !

      Sorry, didn't see this PMR before raising this issue ;(