Bug 918442
Summary: | Deploy fail on ZipException("error in opening zip file") when ShrinkWrap.createFromZipFile is used | ||
---|---|---|---|
Product: | [Retired] JBoss Enterprise WFK Platform 2 | Reporter: | thradec |
Component: | Arquillian | Assignee: | Rodney Russ <rruss> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | thradec |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | unspecified | CC: | kpiwko, maschmid, mnovotny |
Target Milestone: | ER1 | ||
Target Release: | 2.3.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-07-16 11:28:29 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
thradec
2013-03-06 09:08:46 UTC
This is a tracking issues for eventual ShrinkWrap update to WFK 2.3.0. It does not affect any of the WFK releases out there. Karel Piwko <kpiwko> made a comment on jira SHRINKWRAP-444 [~mmatloka] here is a SHRINKWRAP-433 related bug you asked for. Michal Matloka <mmatloka> made a comment on jira SHRINKWRAP-444 I was able to reproduce bug (on jboss-as 7.1.3). The following test passes: {code} @RunWith(Arquillian.class) public class MyWorkingTest { @Deployment public static WebArchive createDeployment() { return ShrinkWrap .create(WebArchive.class) .add( new FileAsset( new File( "src\\test\\resources\\hsqldb-1.8.0.10.jar")), "/WEB-INF/lib/hsqldb-1.8.0.10.jar"); } @Test public void empty() { } } {code} And the following does not: {code} @RunWith(Arquillian.class) public class MyNotWorkingTest { @Deployment public static WebArchive createDeployment() { ShrinkWrap .create(WebArchive.class) .add( new FileAsset( new File( "src\\test\\resources\\hsqldb-1.8.0.10.jar")), "/WEB-INF/lib/hsqldb-1.8.0.10.jar").as(ZipExporter.class).exportTo(new File("target\\testABC.war"), true); return ShrinkWrap.createFromZipFile(WebArchive.class, new File("target\\testABC.war")); } @Test public void empty() { } } {code} But manual deployment of testABC.war produced during second test does work, so problem lies probably somewhere around createFromZipFile. Michal Matloka <mmatloka> made a comment on jira SHRINKWRAP-444 I was able to reproduce bug (on jboss-as 7.1.3). The following test passes: {code} @RunWith(Arquillian.class) public class MyWorkingTest { @Deployment public static WebArchive createDeployment() { return ShrinkWrap .create(WebArchive.class) .add( new FileAsset( new File( "src\\test\\resources\\hsqldb-1.8.0.10.jar")), "/WEB-INF/lib/hsqldb-1.8.0.10.jar"); } @Test public void empty() { } } {code} And the following does not: {code} @RunWith(Arquillian.class) public class MyNotWorkingTest { @Deployment public static WebArchive createDeployment() { ShrinkWrap .create(WebArchive.class) .add( new FileAsset( new File( "src\\test\\resources\\hsqldb-1.8.0.10.jar")), "/WEB-INF/lib/hsqldb-1.8.0.10.jar").as(ZipExporter.class).exportTo(new File("target\\testABC.war"), true); return ShrinkWrap.createFromZipFile(WebArchive.class, new File("target\\testABC.war")); } @Test public void empty() { } } {code} But manual deployment of testABC.war produced during second test does work, so problem lies probably somewhere around createFromZipFile. {code} ShrinkWrap .create(WebArchive.class) .add( new FileAsset( new File( "src\\test\\resources\\hsqldb-1.8.0.10.jar")), "/WEB-INF/lib/hsqldb-1.8.0.10.jar").as(ZipExporter.class).exportTo(new File("target\\testABC.war"), true); ShrinkWrap.createFromZipFile(WebArchive.class, new File("target\\testABC.war")).exportTo(new File("target\\testABC2.war"), true); {code} testABC.war has 653KB testABC2.war has 9KB Michal Matloka <mmatloka> made a comment on jira SHRINKWRAP-444 Sorry, my fault. Some types of streams can return less bytes than bufffer can handle, even if there are more data to be returned on next read. Andrew Rubinger <jboss> made a comment on jira SHRINKWRAP-444 Good job, Michal. Though your sample is just a bit broken on *nix filesystems; I'll fix it up and push upstream. Andrew Rubinger <jboss> made a comment on jira SHRINKWRAP-444 Upstream: https://github.com/shrinkwrap/shrinkwrap/commit/d6ba91e868e3e54d0316c38ba7e95b70822fe3fa and https://github.com/shrinkwrap/shrinkwrap/commit/b2a7dd7324538ce8132a942f576dbc37f49c9b30 Andrew Rubinger <jboss> updated the status of jira SHRINKWRAP-444 to Closed verified in shrinkwrap-1.1.2 |