Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-979

Weld 1.1.3-SNAPSHOT and 1.1.2.AS7 fail on JBoss AS 7 with FileNotFoundException on an existing file

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Rejected
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The file WEB-INF/lib/seam-transaction-3.1.0.Beta2.jar exists in my war, but when I deploy my webapp to as7, weld fails with an exception claiming that it doesn't exist:

      09:23:58,398 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/guvnor-webapp-5.4.0-SNAPSHOT]] (MSC service thread 1-5) Exception sending context initialized event to listener instance of class org.jboss.weld.environment.servlet.Listener: java.lang.RuntimeException: Error handling file /content/guvnor-webapp-5.4.0-SNAPSHOT.war/WEB-INF/lib/seam-transaction-3.1.0.Beta2.jar
      	at org.jboss.weld.environment.servlet.deployment.VFSURLScanner.handleArchiveByFile(VFSURLScanner.java:77) [weld-servlet-core-1.1.2.AS7.jar:]
      	at org.jboss.weld.environment.servlet.deployment.URLScanner.handle(URLScanner.java:158) [weld-servlet-core-1.1.2.AS7.jar:]
      	at org.jboss.weld.environment.servlet.deployment.URLScanner.scanResources(URLScanner.java:139) [weld-servlet-core-1.1.2.AS7.jar:]
      	at org.jboss.weld.environment.servlet.deployment.WebAppBeanDeploymentArchive.<init>(WebAppBeanDeploymentArchive.java:62) [weld-servlet-core-1.1.2.AS7.jar:]
      	at org.jboss.weld.environment.servlet.deployment.ServletDeployment.createWebAppBeanDeploymentArchive(ServletDeployment.java:34) [weld-servlet-core-1.1.2.AS7.jar:]
      	at org.jboss.weld.environment.servlet.deployment.ServletDeployment.<init>(ServletDeployment.java:25) [weld-servlet-core-1.1.2.AS7.jar:]
      	at org.jboss.weld.environment.servlet.Listener.createServletDeployment(Listener.java:111) [weld-servlet-core-1.1.2.AS7.jar:]
      	at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:158) [weld-servlet-core-1.1.2.AS7.jar:]
      	at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
      	at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
      	at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765) [jboss-msc-1.0.0.GA.jar:1.0.0.GA]
      	at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291) [jboss-msc-1.0.0.GA.jar:1.0.0.GA]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
      	at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
      Caused by: java.io.FileNotFoundException: seam-transaction-3.1.0.Beta2.jar doesn't exist. (rootURI: file:/content/guvnor-webapp-5.4.0-SNAPSHOT.war/WEB-INF/lib/seam-transaction-3.1.0.Beta2.jar, file: /content/guvnor-webapp-5.4.0-SNAPSHOT.war/WEB-INF/lib/seam-transaction-3.1.0.Beta2.jar)
      	at org.jboss.virtual.plugins.context.file.FileSystemContext.getRoot(FileSystemContext.java:213) [jboss-vfs-2.0.0.GA.jar:]
      	at org.jboss.virtual.VFS.getRoot(VFS.java:259) [jboss-vfs-2.0.0.GA.jar:]
      	at org.jboss.virtual.VFS.getRoot(VFS.java:146) [jboss-vfs-2.0.0.GA.jar:]
      	at org.jboss.weld.environment.servlet.deployment.VFSURLScanner.handleArchiveByFile(VFSURLScanner.java:52) [weld-servlet-core-1.1.2.AS7.jar:]
      	... 15 more
      
      

      Tested with weld 1.1.3-SNAPSHOT and weld 1.1.2.AS7 with jboss AS 7.0.1.

      The webapp deploys correctly to tomcat 6
      and with seam 2 it deployed correctly to jboss as 7.0.1 too.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            alesj Ales Justin added a comment -

            Looks like somehow VFS2 crept in.

            at org.jboss.virtual.plugins.context.file.FileSystemContext.getRoot(FileSystemContext.java:213) [jboss-vfs-2.0.0.GA.jar:]
            at org.jboss.virtual.VFS.getRoot(VFS.java:259) [jboss-vfs-2.0.0.GA.jar:]
            at org.jboss.virtual.VFS.getRoot(VFS.java:146) [jboss-vfs-2.0.0.GA.jar:]

            AS7 uses VFS3, and so should jboss-as-seam-int v6.
            (see SeamProcessor in AS7)

            Show
            alesj Ales Justin added a comment - Looks like somehow VFS2 crept in. at org.jboss.virtual.plugins.context.file.FileSystemContext.getRoot(FileSystemContext.java:213) [jboss-vfs-2.0.0.GA.jar:] at org.jboss.virtual.VFS.getRoot(VFS.java:259) [jboss-vfs-2.0.0.GA.jar:] at org.jboss.virtual.VFS.getRoot(VFS.java:146) [jboss-vfs-2.0.0.GA.jar:] AS7 uses VFS3, and so should jboss-as-seam-int v6. (see SeamProcessor in AS7)
            Hide
            ge0ffrey Geoffrey De Smet added a comment -

            jboss-vfs is a dependency of jboss-as-arquillian-container-managed and jboss-as-server 7.0.1.Final

            $ mvn depdenceny:tree
             
            +- org.jboss.as:jboss-as-arquillian-container-managed:jar:7.0.1.Final:compile
            [INFO] |  +- org.jboss.as:jboss-as-arquillian-common:jar:7.0.1.Final:compile
            ...
            [INFO] |  |  +- org.jboss.as:jboss-as-jmx:jar:7.0.1.Final:compile
            ...
            [INFO] |  |  |  \- org.jboss.as:jboss-as-server:jar:7.0.1.Final:compile
            ...
            [INFO] |  |  |     \- org.jboss:jboss-vfs:jar:2.0.0.GA:compile
            ...
            

            Show
            ge0ffrey Geoffrey De Smet added a comment - jboss-vfs is a dependency of jboss-as-arquillian-container-managed and jboss-as-server 7.0.1.Final $ mvn depdenceny:tree   +- org.jboss.as:jboss-as-arquillian-container-managed:jar:7.0.1.Final:compile [INFO] | +- org.jboss.as:jboss-as-arquillian-common:jar:7.0.1.Final:compile ... [INFO] | | +- org.jboss.as:jboss-as-jmx:jar:7.0.1.Final:compile ... [INFO] | | | \- org.jboss.as:jboss-as-server:jar:7.0.1.Final:compile ... [INFO] | | | \- org.jboss:jboss-vfs:jar:2.0.0.GA:compile ...
            Hide
            alesj Ales Justin added a comment -

            I don't get v2 of VFS:

            Skywalker:as alesj$ pwd
            /Users/alesj/projects/as7/as
            Skywalker:as alesj$ mvn dependency:tree | grep vfs:jar:2
            Skywalker:as alesj$

            But this is trunk/head, so it might just got fixed.

            Show
            alesj Ales Justin added a comment - I don't get v2 of VFS: Skywalker:as alesj$ pwd /Users/alesj/projects/as7/as Skywalker:as alesj$ mvn dependency:tree | grep vfs:jar:2 Skywalker:as alesj$ But this is trunk/head, so it might just got fixed.
            Hide
            ge0ffrey Geoffrey De Smet added a comment - - edited

            Jboss AS 7.0.2.Final also uses jboss-vfs 2:

            [INFO] +- org.jboss.as:jboss-as-arquillian-container-managed:jar:7.0.2.Final:test
            [INFO] |  +- org.jboss.as:jboss-as-arquillian-common:jar:7.0.2.Final:test
            ...
            [INFO] |  |  +- org.jboss.as:jboss-as-jmx:jar:7.0.2.Final:test
            [INFO] |  |  |  \- org.jboss.as:jboss-as-server:jar:7.0.2.Final:test
            ...t
            [INFO] |  |  |     \- org.jboss:jboss-vfs:jar:2.0.0.GA:test
            

            The JBoss Nexus repo directly contradicts this:
            It says that org.jboss.as:jboss-as-server:jar:7.0.2.Final:compile
            depends on org.jboss:jboss-vfs:jar:3.0.1.GA:compile
            https://repository.jboss.org/nexus/index.html#nexus-search;gav~~jboss-as-server~7.0.2.Final~~
            How is that possible?

            Update: the correct version is indeed 3.0.1.GA, our parent parent pom was overriding the jboss-vfs dependency to 2 for everything.
            https://github.com/droolsjbpm/droolsjbpm-build-bootstrap/commit/cd8e64a05ec4dae8ba77806e6810faf8fdf14549

            Show
            ge0ffrey Geoffrey De Smet added a comment - - edited Jboss AS 7.0.2.Final also uses jboss-vfs 2: [INFO] +- org.jboss.as:jboss-as-arquillian-container-managed:jar:7.0.2.Final:test [INFO] | +- org.jboss.as:jboss-as-arquillian-common:jar:7.0.2.Final:test ... [INFO] | | +- org.jboss.as:jboss-as-jmx:jar:7.0.2.Final:test [INFO] | | | \- org.jboss.as:jboss-as-server:jar:7.0.2.Final:test ...t [INFO] | | | \- org.jboss:jboss-vfs:jar:2.0.0.GA:test The JBoss Nexus repo directly contradicts this: It says that org.jboss.as:jboss-as-server:jar:7.0.2.Final:compile depends on org.jboss:jboss-vfs:jar:3.0.1.GA:compile https://repository.jboss.org/nexus/index.html#nexus-search;gav~~jboss-as-server~7.0.2.Final~~ How is that possible? Update: the correct version is indeed 3.0.1.GA, our parent parent pom was overriding the jboss-vfs dependency to 2 for everything. https://github.com/droolsjbpm/droolsjbpm-build-bootstrap/commit/cd8e64a05ec4dae8ba77806e6810faf8fdf14549
            Hide
            ge0ffrey Geoffrey De Smet added a comment - - edited

            Outside of arquillian, when deploying directly to JBoss AS 7.0.2, I get trouble with the seam-transaction-3.1.0.Beta2.jar again (and debugging shows that the other seam jars would suffer from it too)

            10:25:29,772 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/guvnor-webapp-5.4.0-SNAPSHOT]] (MSC service thread 1-8) Exception sending context initialized event to listener instance of class org.jboss.weld.environment.servlet.Listener: java.lang.RuntimeException: Error handling file /content/guvnor-webapp-5.4.0-SNAPSHOT.war/WEB-INF/lib/seam-transaction-3.1.0.Beta2.jar
            	at org.jboss.weld.environment.servlet.deployment.URLScanner.handleArchiveByFile(URLScanner.java:187) [weld-servlet-core-1.1.2.Final.jar:]
            	at org.jboss.weld.environment.servlet.deployment.URLScanner.handle(URLScanner.java:158) [weld-servlet-core-1.1.2.Final.jar:]
            	at org.jboss.weld.environment.servlet.deployment.URLScanner.scanResources(URLScanner.java:139) [weld-servlet-core-1.1.2.Final.jar:]
            	at org.jboss.weld.environment.servlet.deployment.WebAppBeanDeploymentArchive.<init>(WebAppBeanDeploymentArchive.java:62) [weld-servlet-core-1.1.2.Final.jar:]
            	at org.jboss.weld.environment.servlet.deployment.ServletDeployment.createWebAppBeanDeploymentArchive(ServletDeployment.java:34) [weld-servlet-core-1.1.2.Final.jar:]
            	at org.jboss.weld.environment.servlet.deployment.ServletDeployment.<init>(ServletDeployment.java:25) [weld-servlet-core-1.1.2.Final.jar:]
            	at org.jboss.weld.environment.servlet.Listener.createServletDeployment(Listener.java:112) [weld-servlet-core-1.1.2.Final.jar:]
            	at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:159) [weld-servlet-core-1.1.2.Final.jar:]
            	at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
            	at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
            	at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
            	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
            	at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
            	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
            	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
            	at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
            Caused by: java.util.zip.ZipException: error in opening zip file
            	at java.util.zip.ZipFile.open(Native Method) [:1.6.0_26]
            	at java.util.zip.ZipFile.<init>(ZipFile.java:127) [:1.6.0_26]
            	at java.util.zip.ZipFile.<init>(ZipFile.java:144) [:1.6.0_26]
            	at org.jboss.weld.environment.servlet.deployment.URLScanner.handleArchiveByFile(URLScanner.java:174) [weld-servlet-core-1.1.2.Final.jar:]
            	... 15 more
            

            Deleting that jar from my local repo and forcing a redownload didn't fix it.

            Show
            ge0ffrey Geoffrey De Smet added a comment - - edited Outside of arquillian, when deploying directly to JBoss AS 7.0.2, I get trouble with the seam-transaction-3.1.0.Beta2.jar again (and debugging shows that the other seam jars would suffer from it too) 10:25:29,772 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/guvnor-webapp-5.4.0-SNAPSHOT]] (MSC service thread 1-8) Exception sending context initialized event to listener instance of class org.jboss.weld.environment.servlet.Listener: java.lang.RuntimeException: Error handling file /content/guvnor-webapp-5.4.0-SNAPSHOT.war/WEB-INF/lib/seam-transaction-3.1.0.Beta2.jar at org.jboss.weld.environment.servlet.deployment.URLScanner.handleArchiveByFile(URLScanner.java:187) [weld-servlet-core-1.1.2.Final.jar:] at org.jboss.weld.environment.servlet.deployment.URLScanner.handle(URLScanner.java:158) [weld-servlet-core-1.1.2.Final.jar:] at org.jboss.weld.environment.servlet.deployment.URLScanner.scanResources(URLScanner.java:139) [weld-servlet-core-1.1.2.Final.jar:] at org.jboss.weld.environment.servlet.deployment.WebAppBeanDeploymentArchive.<init>(WebAppBeanDeploymentArchive.java:62) [weld-servlet-core-1.1.2.Final.jar:] at org.jboss.weld.environment.servlet.deployment.ServletDeployment.createWebAppBeanDeploymentArchive(ServletDeployment.java:34) [weld-servlet-core-1.1.2.Final.jar:] at org.jboss.weld.environment.servlet.deployment.ServletDeployment.<init>(ServletDeployment.java:25) [weld-servlet-core-1.1.2.Final.jar:] at org.jboss.weld.environment.servlet.Listener.createServletDeployment(Listener.java:112) [weld-servlet-core-1.1.2.Final.jar:] at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:159) [weld-servlet-core-1.1.2.Final.jar:] at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.1.Final] at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.1.Final] at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765) at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26] at java.lang.Thread.run(Thread.java:662) [:1.6.0_26] Caused by: java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method) [:1.6.0_26] at java.util.zip.ZipFile.<init>(ZipFile.java:127) [:1.6.0_26] at java.util.zip.ZipFile.<init>(ZipFile.java:144) [:1.6.0_26] at org.jboss.weld.environment.servlet.deployment.URLScanner.handleArchiveByFile(URLScanner.java:174) [weld-servlet-core-1.1.2.Final.jar:] ... 15 more Deleting that jar from my local repo and forcing a redownload didn't fix it.
            Hide
            ge0ffrey Geoffrey De Smet added a comment - - edited

            The zip exception is trying to access a file that doesn't exist (both with weld 1.1.2.AS7 and 1.1.2.Final):

              /content/guvnor-webapp-5.4.0-SNAPSHOT.war/WEB-INF/lib/seam-transaction-3.1.0.Beta2.jar
            

            The problem is in org.jboss.weld.environment.servlet.deployment.URLScanner#scanResources:
            it does:

            Enumeration<URL> urlEnum = classLoader.getResources(resourceName);
            String urlPath = urlEnum.nextElement() // returns "vfs:/content/..."
                   .getFile(); // returns "/content/..."
            

            and urlPath is "/content/guvnor-webapp-5.4.0-SNAPSHOT.war/WEB-INF/lib/seam-transaction-api-3.1.0.Beta2.jar/META-INF/beans.xml"
            because the classloader is an instance of org.jboss.modules.ModuleClassLoader.

            The rest of the problem is in org.jboss.weld.environment.servlet.deployment.URLScanner#handle which does:

              File file = new File(urlPath);
            

            which boils down to a non existing file:

              new File("/content/guvnor-webapp-5.4.0-SNAPSHOT.war/WEB-INF/lib/seam-transaction-3.1.0.Beta2.jar");
            

            Show
            ge0ffrey Geoffrey De Smet added a comment - - edited The zip exception is trying to access a file that doesn't exist (both with weld 1.1.2.AS7 and 1.1.2.Final): /content/guvnor-webapp-5.4.0-SNAPSHOT.war/WEB-INF/lib/seam-transaction-3.1.0.Beta2.jar The problem is in org.jboss.weld.environment.servlet.deployment.URLScanner#scanResources: it does: Enumeration<URL> urlEnum = classLoader.getResources(resourceName); String urlPath = urlEnum.nextElement() // returns "vfs:/content/..." .getFile(); // returns "/content/..." and urlPath is "/content/guvnor-webapp-5.4.0-SNAPSHOT.war/WEB-INF/lib/seam-transaction-api-3.1.0.Beta2.jar/META-INF/beans.xml" because the classloader is an instance of org.jboss.modules.ModuleClassLoader. The rest of the problem is in org.jboss.weld.environment.servlet.deployment.URLScanner#handle which does: File file = new File(urlPath); which boils down to a non existing file: new File("/content/guvnor-webapp-5.4.0-SNAPSHOT.war/WEB-INF/lib/seam-transaction-3.1.0.Beta2.jar");
            Hide
            ge0ffrey Geoffrey De Smet added a comment -

            The jboss-vfs 2 is a red harring: it's not causing the issue.

            • 1) Even outside arquillian, when deployed to jboss AS 7.0.2 the ZipException occurs.
            • 2) Even after adding this to my pom, the ZipException occurs in the arquillian tests:

                  <dependency>
                    <groupId>org.jboss</groupId>
                    <artifactId>jboss-vfs</artifactId>
                    <version>3.0.1.GA</version>
                    <scope>test</scope>
                  </dependency>
              

            Show
            ge0ffrey Geoffrey De Smet added a comment - The jboss-vfs 2 is a red harring: it's not causing the issue. 1) Even outside arquillian, when deployed to jboss AS 7.0.2 the ZipException occurs. 2) Even after adding this to my pom, the ZipException occurs in the arquillian tests: <dependency> <groupId>org.jboss</groupId> <artifactId>jboss-vfs</artifactId> <version>3.0.1.GA</version> <scope>test</scope> </dependency>
            Hide
            ge0ffrey Geoffrey De Smet added a comment -

            Workaround: remove WEB-INF/lib/weld-servlet.jar and remove WeldListener decleration from your web.xml.
            That breaks your app on all other appservers though.

            Show
            ge0ffrey Geoffrey De Smet added a comment - Workaround: remove WEB-INF/lib/weld-servlet.jar and remove WeldListener decleration from your web.xml. That breaks your app on all other appservers though.
            Hide
            ge0ffrey Geoffrey De Smet added a comment -

            Closing this issue, as it's a known hoop to jump through.
            The issue WELD-983 is about removing that hoop.

            Show
            ge0ffrey Geoffrey De Smet added a comment - Closing this issue, as it's a known hoop to jump through. The issue WELD-983 is about removing that hoop.

              People

              • Assignee:
                Unassigned
                Reporter:
                ge0ffrey Geoffrey De Smet
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development