Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4571

Quarkus: GraalVM Native never use JAR resource

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3-next-M7, 4.0.0-RC5
    • 2.3-next-M8, 4.0.0
    • Extension Feature
    • None

    Description

      tandraschko I need some advice. I have 99% of functionality now working in GraalVM native image I am down to my last issue.   It use using Tag Library in Faces config is blowing up in Native Mode and here is why when its resolving the Facelet URL.

      It is listed in faces-config.xml like this..

          <tag>
              <tag-name>tabscode</tag-name>
              <source>resources/tags/tabscode.xhtml</source>
          </tag> 

      DEV MODE (works):

      Source URL = file:/C:/dev/primefaces/quarkus-faces/src/main/resources/META-INF/resources/template/template.xhtml Path = ./config.xhtml
      
      Facelet URL = file:/C:/dev/primefaces/quarkus-faces/src/main/resources/META-INF/resources/template/config.xhtml
      
      Facelet URL = file:/C:/dev/primefaces/quarkus-faces/target/classes/META-INF/resources/tags/tabscode.xhtml

      PROD JAR MODE (works):

      Source URL = jar:file:/C:/dev/primefaces/quarkus-faces/target/quarkus-app/app/quarkus-faces.jar!/META-INF/resources/template/template.xhtml Path = ./config.xhtml
      
      Facelet URL = jar:file:/C:/dev/primefaces/quarkus-faces/target/quarkus-app/app/quarkus-faces.jar!/META-INF/resources/template/config.xhtml
      
      Facelet URL = jar:file:/C:/dev/primefaces/quarkus-faces/target/quarkus-app/app/quarkus-faces.jar!/META-INF/resources/tags/tabscode.xhtml

      GRAALVM NATIVE MODE (fails):

      Source URL = resource:/META-INF/resources/template/template.xhtml Path = ./config.xhtml
      
      Facelet URL = resource:/META-INF/resources/template/config.xhtml
      
      Facelet URL = jar:file:/project/quarkus-faces-runner.jar!/META-INF/resources/tags/tabscode.xhtml

      As you can see tabscode then blows up with...

      java.nio.file.NoSuchFileException: /project/quarkus-faces-runner.jar
              at java.base@17.0.6/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
              at java.base@17.0.6/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:148)
              at java.base@17.0.6/sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
              at java.base@17.0.6/java.nio.file.Files.readAttributes(Files.java:1851)
              at java.base@17.0.6/java.util.zip.ZipFile$Source.get(ZipFile.java:1264)
              at java.base@17.0.6/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:709)
              at java.base@17.0.6/java.util.zip.ZipFile.<init>(ZipFile.java:243)
              at java.base@17.0.6/java.util.zip.ZipFile.<init>(ZipFile.java:172)
              at java.base@17.0.6/java.util.jar.JarFile.<init>(JarFile.java:347)
              at java.base@17.0.6/sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:103)
              at java.base@17.0.6/sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:72)
              at java.base@17.0.6/sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:168)
              at java.base@17.0.6/sun.net.www.protocol.jar.JarFileFactory.getOrCreate(JarFileFactory.java:91)
              at java.base@17.0.6/sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:132)
              at java.base@17.0.6/sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:175)
              at java.base@17.0.6/java.net.URL.openStream(URL.java:1161)
              at org.apache.myfaces.view.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:824)
              at org.apache.myfaces.view.facelets.compiler.Compiler.compile(Compiler.java:80)
              at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory._createFacelet(DefaultFaceletFactory.java:344)
              at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.lambda$new$0(DefaultFaceletFactory.java:105)
              at org.apache.myfaces.view.facelets.impl.CacheELFaceletCacheImpl.getFacelet(CacheELFaceletCacheImpl.java:137)
              at org.apache.myfaces.view.facelets.impl.CacheELFaceletCacheImpl.getFacelet(CacheELFaceletCacheImpl.java:45)

      Basically I was hoping you could point to me in the code based 1 or two spots where in GRAAL mode I can override anything that is a JAR to be "resource:/META-INF" instead of a JAR ever  I can do it with a GraalVM Substitution but was hoping for some guidance on where to look at the best spot. 

       

      Attachments

        Activity

          People

            melloware Melloware
            melloware Melloware
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: