9 Replies Latest reply on May 12, 2010 10:08 AM by jaikiran pai

    EOFException from ShrinkWrap Deployment into MCAnn

    Andrew Rubinger Master

      Using the new EJBContainer APIs running inside of AS, I'm getting an error on deployment from mcann.

       

      The flow is:

       

      ShrinkWrap Archive > Mounted as ArchiveFileSystem VirtualFile > Passed to VFSDeployment > MainDeployer

       

      Works fine in unit tests outside AS where the mcann deployers are not installed.

       

      Anyone can give me some context as to what they're trying to do, and why they're using GZIPInputStream?  ShrinkWrap archives are exported using ZipOutputStream.

       

      S,

      ALR

       

      17:10:06,779 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to PostClassLoader: name=vfs:///3d533beb-db50-47da-9e20-4b2133017456/outputSlsb.jar/ state=ClassLoader mode=Manual requiredState=PostClassLoader: org.jboss.deployers.spi.DeploymentException: Exception visiting module
          at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [jboss-deployers-core-spi-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.deployers.vfs.plugins.annotations.AnnotationRepositoryDeployer.visitModule(AnnotationRepositoryDeployer.java:109) [jboss-deployers-vfs-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.deployers.vfs.plugins.annotations.AnnotationRepositoryDeployer.deploy(AnnotationRepositoryDeployer.java:154) [jboss-deployers-vfs-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.deployers.vfs.plugins.annotations.AnnotationRepositoryDeployer.deploy(AnnotationRepositoryDeployer.java:47) [jboss-deployers-vfs-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.deployers.vfs.spi.deployer.AbstractOptionalVFSRealDeployer.deploy(AbstractOptionalVFSRealDeployer.java:57) [jboss-deployers-vfs-spi-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.deployers.spi.deployer.helpers.AbstractOptionalRealDeployer.internalDeploy(AbstractOptionalRealDeployer.java:74) [jboss-deployers-spi-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [jboss-deployers-spi-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [jboss-deployers-impl-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1857) [jboss-deployers-impl-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1575) [jboss-deployers-impl-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1516) [jboss-deployers-impl-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377) [jboss-dependency-2.2.0.Alpha9.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042) [jboss-dependency-2.2.0.Alpha9.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081) [jboss-dependency-2.2.0.Alpha9.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320) [jboss-dependency-2.2.0.Alpha9.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244) [jboss-dependency-2.2.0.Alpha9.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137) [jboss-dependency-2.2.0.Alpha9.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:937) [jboss-dependency-2.2.0.Alpha9.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:652) [jboss-dependency-2.2.0.Alpha9.jar:2.2.0.Alpha9]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:2008) [jboss-deployers-impl-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1101) [jboss-deployers-impl-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [jboss-deployers-impl-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          at org.jboss.shrinkwrap.vdf.impl.ShrinkWrapDeployerImpl.deploy(ShrinkWrapDeployerImpl.java:184) [shrinkwrap-extension-vdf-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
          at org.jboss.ejb3.embedded.impl.base.JBossEJBContainerBase.deploy(JBossEJBContainerBase.java:273) [jboss-ejb3-embedded-impl-base-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]
          at org.jboss.jbossas.embedded.testsuite.servlet.EmbeddedEjbCallingServlet.doGet(EmbeddedEjbCallingServlet.java:101) [:]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Beta2.jar:1.0.0.Beta2]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Beta2.jar:1.0.0.Beta2]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:336) [jbossweb-3.0.0-beta-4.jar:]
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [jbossweb-3.0.0-beta-4.jar:]
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:293) [jbossweb-3.0.0-beta-4.jar:]
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [jbossweb-3.0.0-beta-4.jar:]
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183) [jboss-as-tomcat-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95) [jboss-as-tomcat-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) [jboss-as-tomcat-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) [jboss-as-tomcat-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [jbossweb-3.0.0-beta-4.jar:]
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-3.0.0-beta-4.jar:]
          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [jboss-as-tomcat-6.0.0-SNAPSHOT.jar:6.0.0-SNAPSHOT]
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-3.0.0-beta-4.jar:]
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-3.0.0-beta-4.jar:]
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:872) [jbossweb-3.0.0-beta-4.jar:]
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-3.0.0-beta-4.jar:]
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [jbossweb-3.0.0-beta-4.jar:]
          at java.lang.Thread.run(Thread.java:619) [:1.6.0_14]
      Caused by: java.io.EOFException
          at java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:207) [:1.6.0_14]
          at java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:197) [:1.6.0_14]
          at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:136) [:1.6.0_14]
          at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:58) [:1.6.0_14]
          at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:68) [:1.6.0_14]
          at org.jboss.mcann.scanner.AbstractAnnotationScanner.reattach(AbstractAnnotationScanner.java:120) [mcann-core-1.0.0.Alpha2.jar:1.0.0.Alpha2]
          at org.jboss.mcann.scanner.AbstractAnnotationScanner.scan(AbstractAnnotationScanner.java:74) [mcann-core-1.0.0.Alpha2.jar:1.0.0.Alpha2]
          at org.jboss.deployers.vfs.plugins.annotations.AnnotationRepositoryDeployer.visitModule(AnnotationRepositoryDeployer.java:104) [jboss-deployers-vfs-2.2.0.Alpha4.jar:2.2.0.Alpha4]
          ... 42 more
        • 1. Re: EOFException from ShrinkWrap Deployment into MCAnn
          Ales Justin Master
          Anyone can give me some context as to what they're trying to do, and why they're using GZIPInputStream? 

          Weird, it looks like it's assuming that there exists a pre-indexed version of AnnotationRepository.

          e.g. this is a notion from Papaki, where one would do standalone scan, and serialize pre-indexed repo instance into a jar

           

          You need to check why it returns non-null input stream from this code:

           

          protected InputStream getMcAnnInputStream(URL url)
             {
                try
                {
          
                   String urlString = url.toExternalForm();
                   if (urlString.endsWith("/") == false)
                      urlString += "/";
                   urlString += AnnotationRepository.MCANN_PATH;
                   URL mcannURL = new URL(urlString);
                   return mcannURL.openStream();
                }
                catch (IOException e)
                {
                   if (log.isTraceEnabled())
                      log.trace("Cannot access mcann.ser file: " + e);
                   return null;
                }
             }
          
          1 of 1 people found this helpful
          • 2. Re: EOFException from ShrinkWrap Deployment into MCAnn
            Andrew Rubinger Master

            Added some logging output:

             

            [alr@localhost trunk]$ svn di
            Index: core/src/main/java/org/jboss/mcann/scanner/AbstractAnnotationScanner.java
            ===================================================================
            --- core/src/main/java/org/jboss/mcann/scanner/AbstractAnnotationScanner.java    (revision 104694)
            +++ core/src/main/java/org/jboss/mcann/scanner/AbstractAnnotationScanner.java    (working copy)
            @@ -70,8 +70,10 @@
                         for (URL url : urls)
                         {
                            InputStream is = getMcAnnInputStream(url);
            -               if (is != null)
            +               if (is != null){
            +                  log.info("Attempting to scan :" + url);
                               reattach(repository, is);
            +               }
                            else
                               list.add(url);
                         }

             

            ...yields:

             

            16:30:28,635 INFO  [org.jboss.mcann.AnnotationScanner] Attempting to scan :vfs:/1fc8987a-6585-442e-a443-327b12f25237/outputSlsb.jar/

             

            Indicates that we assume we can get a GZIP InputStream from the URL handed as a compressed object from an existing AnnotationRepository in "reattach()".

             

            S,

            ALR

            • 3. Re: EOFException from ShrinkWrap Deployment into MCAnn
              Andrew Rubinger Master

              Ales Justin wrote:


              You need to check why it returns non-null input stream from this code

               

              Yep, I'll do this tonight and figure out what exception went down.

               

              S,

              ALR

              • 4. Re: EOFException from ShrinkWrap Deployment into MCAnn
                Andrew Rubinger Master
                :21:29,623 WARN  [org.jboss.mcann.AnnotationScanner] Could not read URL vfs:/tmp/webservice.war/WEB-INF/classes/: java.io.FileNotFoundException: /home/alr/business/jboss/wc/jbossas/branches/TEMP_EJB3_EMBEDDABLE_JBAS-7964/embedded/../build/target/jboss-6.0.0-SNAPSHOT/server/all/tmp/vfs/automount3bf9bcad4fd3218f/webservice.war-c267207452f55097/WEB-INF/classes/META-INF/mcann.ser (No such file or directory)
                    at java.io.FileInputStream.open(Native Method) [:1.6.0_14]
                    at java.io.FileInputStream.<init>(FileInputStream.java:106) [:1.6.0_14]
                    at org.jboss.vfs.spi.RealFileSystem.openInputStream(RealFileSystem.java:67) [jboss-vfs-3.0.0.CR5.jar:3.0.0.CR5]
                    at org.jboss.vfs.VirtualFile.openStream(VirtualFile.java:236) [jboss-vfs-3.0.0.CR5.jar:3.0.0.CR5]
                    at org.jboss.vfs.protocol.VirtualFileURLConnection.getInputStream(VirtualFileURLConnection.java:73) [jboss-vfs-3.0.0.CR5.jar:3.0.0.CR5]
                    at java.net.URL.openStream(URL.java:1009) [:1.6.0_14]
                    at org.jboss.mcann.scanner.AbstractAnnotationScanner.getMcAnnInputStream(AbstractAnnotationScanner.java:107) [mcann-core-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT]

                 

                S,

                ALR

                • 5. Re: EOFException from ShrinkWrap Deployment into MCAnn
                  Ales Justin Master

                  mcann.jar is actually going away with new scanning lib,

                  so the missing trailing slash will be fixed, if that helps.

                  • 6. Re: EOFException from ShrinkWrap Deployment into MCAnn
                    Andrew Rubinger Master

                    It's actually not a trailing slash issue; I edited the previous post.

                     

                    It can't read as a URL inside the VFS URL.  I'm gonna try to duplicate that as a unit test in the ShrinkWrap VFS3 integration module.

                    • 7. Re: EOFException from ShrinkWrap Deployment into MCAnn
                      Andrew Rubinger Master

                      As I said, this isn't the issue, but you probably still want to apply this:

                       

                      [alr@localhost trunk]$ svn di core/src/
                      Index: core/src/main/java/org/jboss/mcann/AnnotationRepository.java
                      ===================================================================
                      --- core/src/main/java/org/jboss/mcann/AnnotationRepository.java    (revision 104694)
                      +++ core/src/main/java/org/jboss/mcann/AnnotationRepository.java    (working copy)
                      @@ -46,7 +46,7 @@
                          static final String MCANN_METADATA_BINARY = "mcann.ser";
                       
                          /** The full McAnn file path */
                      -   static final String MCANN_PATH = "META-INF" + MCANN_METADATA_BINARY;
                      +   static final String MCANN_PATH = "META-INF/" + MCANN_METADATA_BINARY;
                       
                          /**
                           * Merge repositories.
                      • 8. Re: EOFException from ShrinkWrap Deployment into MCAnn
                        Andrew Rubinger Master

                        Cool, thanks for the pointer Ales.  Found a bug in our ShrinkWrap/VFS3 integration bit.

                         

                        https://jira.jboss.org/jira/browse/SHRINKWRAP-169

                         

                        S,

                        ALR

                        • 9. Re: EOFException from ShrinkWrap Deployment into MCAnn
                          jaikiran pai Master

                          Just a FYI - A similar exception seems to affect even non-Shrinkwrap deployments in 6.0.0.M3 http://community.jboss.org/message/542556#542556. Haven't yet looked into the details of that yet.