Bug 918442 - Deploy fail on ZipException("error in opening zip file") when ShrinkWrap.createFromZipFile is used
Summary: Deploy fail on ZipException("error in opening zip file") when ShrinkWrap.crea...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise WFK Platform 2
Classification: Retired
Component: Arquillian
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER1
: 2.3.0
Assignee: Rodney Russ
QA Contact: thradec
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-06 09:08 UTC by thradec
Modified: 2016-08-01 01:05 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-16 11:28:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SHRINKWRAP-444 0 Critical Closed Deploy fail on ZipException("error in opening zip file") when ShrinkWrap.createFromZipFile is used 2014-09-04 07:52:06 UTC

Description thradec 2013-03-06 09:08:46 UTC
Detailed description is in upstream jira issue.
https://issues.jboss.org/browse/SHRINKWRAP-444

Comment 1 Karel Piwko 2013-03-06 09:14:38 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.

Comment 2 JBoss JIRA Server 2013-03-06 09:15:58 UTC
Karel Piwko <kpiwko> made a comment on jira SHRINKWRAP-444

[~mmatloka] here is a SHRINKWRAP-433 related bug you asked for.

Comment 3 JBoss JIRA Server 2013-03-06 20:23:25 UTC
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.

Comment 4 JBoss JIRA Server 2013-03-06 20:28:34 UTC
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

Comment 5 JBoss JIRA Server 2013-03-06 22:30:31 UTC
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.

Comment 6 JBoss JIRA Server 2013-03-07 09:01:54 UTC
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.

Comment 8 JBoss JIRA Server 2013-03-07 09:14:58 UTC
Andrew Rubinger <jboss> updated the status of jira SHRINKWRAP-444 to Closed

Comment 9 thradec 2013-03-12 08:55:56 UTC
verified in shrinkwrap-1.1.2


Note You need to log in before you can comment on or make changes to this bug.