Uploaded image for project: 'ShrinkWrap'
  1. ShrinkWrap
  2. SHRINKWRAP-365

FileExistException - Existing WAR cannot be deployed with ShrinkWrap.createFromZipFile

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Minor
    • None
    • 1.0.0-beta-5
    • api
    • None
    • Hide
      • Place an existing war file which should be tested in an Arquillian test in some location
      • Try to create a deployment from this war file with:
        {{return ShrinkWrap.createFromZipFile(WebArchive.class, new File("dependency"File.separatorChar"test.war"));
        }}
      Show
      Place an existing war file which should be tested in an Arquillian test in some location Try to create a deployment from this war file with: {{return ShrinkWrap.createFromZipFile(WebArchive.class, new File("dependency" File.separatorChar "test.war")); }}
    • Hide
      • Use more verbose API calls:
           
        @Deployment(testable=false)
           public static WebArchive createTestArchive() throws Exception {
               return ShrinkWrap.getDefaultDomain().getArchiveFactory().create(WebArchive.class, "test.war").as(ZipImporter.class).importFrom(new ZipFile(new File("target/dependency/test.war"))).as(WebArchive.class).addAsManifestResource(new ByteArrayAsset(new byte[0]), ArchivePaths.create("beans.xml"));
           }
        
      Show
      Use more verbose API calls: @Deployment(testable= false ) public static WebArchive createTestArchive() throws Exception { return ShrinkWrap.getDefaultDomain().getArchiveFactory().create(WebArchive.class, "test.war" ).as(ZipImporter.class).importFrom( new ZipFile( new File( "target/dependency/test.war" ))).as(WebArchive.class).addAsManifestResource( new ByteArrayAsset( new byte [0]), ArchivePaths.create( "beans.xml" )); }
    • Low

    Description

      • Deploying a Web archive from a ZIP fails
      • Code:
           @Deployment(testable=false)
           public static WebArchive createTestArchive() throws Exception {
             return ShrinkWrap.createFromZipFile(WebArchive.class, new File("dependency"+File.separatorChar+"test.war"));
           }
        
      • test.war is the file to use, but the new deployment is being tried to create at the same location

      Attachments

        Activity

          People

            Unassigned Unassigned
            ka_oh Karsten Ohme (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: