ICEfaces
  1. ICEfaces
  2. ICE-9836

Classpath.getAlternativeJarFile(...) causes Bad file descriptor under WebSphere 8.5

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-1.8.2.GA_P07
    • Fix Version/s: EE-1.8.2.GA_P08
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Windows 7, Websphere 8.5.5.1, JSF 1.2
    • Assignee Priority:
      P1
    • Support Case References:
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      You can overwrite the com.sun.facelets.util.Classpath Class with the patch from the RI (decoding the URL to remove the %20's) and put in in your WebProject src-folder:


      private static JarFile getAlternativeJarFile(URL url) throws IOException {
      String urlFile = url.getFile();
      // Trim off any suffix - which is prefixed by "!/" on Weblogic
      int separatorIndex = urlFile.indexOf("!/");

      // OK, didn't find that. Try the less safe "!", used on OC4J
      if (separatorIndex == -1) {
      separatorIndex = urlFile.indexOf('!');
      }

      if (separatorIndex != -1) {
      String jarFileUrl = urlFile.substring(0, separatorIndex);
      // And trim off any "file:" prefix.
      if (jarFileUrl.startsWith("file:")) {
      jarFileUrl = jarFileUrl.substring("file:".length());
      // https://java.net/jira/browse/FACELETS-306
      jarFileUrl = URLDecoder.decode(jarFileUrl, "UTF-8");
      }
      return new JarFile(jarFileUrl);
      }
      return null;
      }
      Show
      You can overwrite the com.sun.facelets.util.Classpath Class with the patch from the RI (decoding the URL to remove the %20's) and put in in your WebProject src-folder: private static JarFile getAlternativeJarFile(URL url) throws IOException { String urlFile = url.getFile(); // Trim off any suffix - which is prefixed by "!/" on Weblogic int separatorIndex = urlFile.indexOf("!/"); // OK, didn't find that. Try the less safe "!", used on OC4J if (separatorIndex == -1) { separatorIndex = urlFile.indexOf('!'); } if (separatorIndex != -1) { String jarFileUrl = urlFile.substring(0, separatorIndex); // And trim off any "file:" prefix. if (jarFileUrl.startsWith("file:")) { jarFileUrl = jarFileUrl.substring("file:".length()); // https://java.net/jira/browse/FACELETS-306 jarFileUrl = URLDecoder.decode(jarFileUrl, "UTF-8"); } return new JarFile(jarFileUrl); } return null; }

      Description

      There is a bug in the method com.sun.facelets.uitl.Classpath#getAlternativeJarFile(java.net.URL) that causes a FileNotFoundException when referencing Jars in folders containing blanks in the name.

      the problem only appears on WebSphere 8.5 (coudn't reproduce it on WebSphere 7)

      This bug is already resolved in the Standard Facelets RI in Version 1.1.15 (see: https://java.net/jira/browse/FACELETS-306)

      In the icefaces-facelets.jar of the current ICEfacesEE 1.8.2 GA_P07 the bug still exists.

      When I call my application following exception occurs:

      [13.02.14 10:37:00:352 CET] 000000ca compiler E Compiler Initialization Error
                                       java.io.FileNotFoundException: C:\Program%20Files\MyAppLib\myJar.jar (Das System kann den angegebenen Pfad nicht finden.)
      at java.util.zip.ZipFile.open(Native Method)
      at java.util.zip.ZipFile.<init>(ZipFile.java:151)
      at java.util.jar.JarFile.<init>(JarFile.java:150)
      at java.util.jar.JarFile.<init>(JarFile.java:87)
      at com.sun.facelets.util.Classpath.getAlternativeJarFile(Classpath.java:214)
      at com.sun.facelets.util.Classpath.search(Classpath.java:71)
      at com.sun.facelets.compiler.TagLibraryConfig.loadImplicit(TagLibraryConfig.java:428)
      at com.sun.facelets.compiler.Compiler.initialize(Compiler.java:91)
      at com.sun.facelets.compiler.Compiler.compile(Compiler.java:108)
      at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:218)
      at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:149)
      at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:100)
      at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:269)
      at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:157)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:51)
      at com.icesoft.faces.context.View$2$1.respond(View.java:86)
      at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:242)
      at com.icesoft.faces.context.View$2.serve(View.java:120)
      at com.icesoft.faces.context.View.servePage(View.java:193)
      at com.icesoft.faces.webapp.http.core.MultiViewServer.service(MultiViewServer.java:139)
      at com.icesoft.faces.webapp.http.common.ServerProxy.service(ServerProxy.java:43)
      at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet$4.service(MainSessionBoundServlet.java:187)
      at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:51)
      at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:55)
      at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:106)
      at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:55)
      at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:204)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
      at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1071)
      at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:909)
      at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)
      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)
      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)

        Activity

        Hide
        Mircea Toma added a comment -

        Update icefaces-faceletes.jar library with a version that received https://java.net/jira/browse/FACELETS-306 fixes. Also applied FACELETS-306 fixes to our svn/repo/3rd/facelets-1.1 respository

        Show
        Mircea Toma added a comment - Update icefaces-faceletes.jar library with a version that received https://java.net/jira/browse/FACELETS-306 fixes. Also applied FACELETS-306 fixes to our svn/repo/3rd/facelets-1.1 respository
        Hide
        Mircea Toma added a comment -

        The https://java.net/jira/browse/FACELETS-306 fixes were wrongly applied svn/repo/3rd/facelets-1.1 directory which contains an unused version of facelets.

        Show
        Mircea Toma added a comment - The https://java.net/jira/browse/FACELETS-306 fixes were wrongly applied svn/repo/3rd/facelets-1.1 directory which contains an unused version of facelets.
        Hide
        Mircea Toma added a comment -

        Applied https://java.net/jira/browse/FACELETS-306 fixes to svn/repo/3rd/facelets directory instead which contains a later version of facelets. This version can handle the virtual file system used by JBoss and thus tag libraries can be found in the classpath.

        Also updated icefaces-facelets.jar in ICEfaces 1.8 trunk.

        Show
        Mircea Toma added a comment - Applied https://java.net/jira/browse/FACELETS-306 fixes to svn/repo/3rd/facelets directory instead which contains a later version of facelets. This version can handle the virtual file system used by JBoss and thus tag libraries can be found in the classpath. Also updated icefaces-facelets.jar in ICEfaces 1.8 trunk.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Carsten Bansemir
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: