Bug 1316994 - java.lang.RuntimeException: java.util.zip.ZipException: duplicate entry: when building kxml
java.lang.RuntimeException: java.util.zip.ZipException: duplicate entry: when...
Status: CLOSED ERRATA
Product: Red Hat Software Collections
Classification: Red Hat
Component: xmvn (Show other bugs)
rh-maven35
Unspecified Unspecified
unspecified Severity unspecified
: alpha
: 3.0
Assigned To: Mikolaj Izdebski
Jan Kepler
:
Depends On:
Blocks: 1448496
  Show dependency treegraph
 
Reported: 2016-03-11 11:34 EST by Severin Gehwolf
Modified: 2017-10-24 05:53 EDT (History)
2 users (show)

See Also:
Fixed In Version: rh-maven35-xmvn-3.0.0-5.2.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-10-24 05:53:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
kxml2 compat package spec with failing %mvn_install macro (6.87 KB, text/x-matlab)
2016-03-11 11:34 EST, Severin Gehwolf
no flags Details
Reproducer (1.30 KB, application/zip)
2017-10-05 05:20 EDT, Mikolaj Izdebski
no flags Details

  None (edit)
Description Severin Gehwolf 2016-03-11 11:34:06 EST
Created attachment 1135303 [details]
kxml2 compat package spec with failing %mvn_install macro

Description of problem:
When attempting to build kxml as a compat package, xmvn fails in the install phase with:

DEBUG] Assigning installer for each installable artifact
[DEBUG] Installing artifacts
[DEBUG] Installing net.sf.kxml:kxml2:pom:2.3.0 using org.fedoraproject.xmvn.tools.install.impl.DefaultArtifactInstaller
[TRACE] Native code not found inside /builddir/build/SOURCES/kxml2-2.3.0.pom
[TRACE] Trying to inject manifest to net.sf.kxml:kxml2:pom:2.3.0
[TRACE] Manifest injection skipped: no pre-existing manifest found to update
[INFO] Installing artifact net.sf.kxml:kxml2:pom:2.3.0
[DEBUG] Installing net.sf.kxml:kxml2:jar:2.3.0 using org.fedoraproject.xmvn.tools.install.impl.DefaultArtifactInstaller
[TRACE] Native code not found inside /builddir/build/BUILD/kxml-2.3.0/dist/kxml2-2.3.0.jar
[TRACE] Trying to inject manifest to net.sf.kxml:kxml2:jar:2.3.0
[TRACE] Injected field JavaPackages-GroupId: net.sf.kxml
[TRACE] Injected field JavaPackages-ArtifactId: kxml2
[TRACE] Not injecting field JavaPackages-Extension (it has default value "jar")
[TRACE] Not injecting field JavaPackages-Classifier (it has default value "")
[TRACE] Injected field JavaPackages-Version: 2.3.0
Unhandled exception
java.lang.RuntimeException: java.util.zip.ZipException: duplicate entry: META-INF/services/org.xmlpull.v1.XmlPullParserFactory
	at org.fedoraproject.xmvn.tools.install.impl.JarUtils.injectManifest(JarUtils.java:213)
	at org.fedoraproject.xmvn.tools.install.impl.DefaultArtifactInstaller.install(DefaultArtifactInstaller.java:82)
	at org.fedoraproject.xmvn.tools.install.impl.DefaultInstaller.installArtifact(DefaultInstaller.java:235)
	at org.fedoraproject.xmvn.tools.install.impl.DefaultInstaller.install(DefaultInstaller.java:345)
	at org.fedoraproject.xmvn.tools.install.cli.InstallerCli.run(InstallerCli.java:53)
	at org.fedoraproject.xmvn.tools.install.cli.InstallerCli.main(InstallerCli.java:72)
Caused by: java.util.zip.ZipException: duplicate entry: META-INF/services/org.xmlpull.v1.XmlPullParserFactory
	at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:232)
	at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:109)
	at org.fedoraproject.xmvn.tools.install.impl.JarUtils.injectManifest(JarUtils.java:203)
	... 5 more
RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.TZHhK0 (%install)
    Bad exit status from /var/tmp/rpm-tmp.TZHhK0 (%install)
Child return code was: 1
EXCEPTION: Command failed. See logs for output.
 # bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps  /builddir/build/SPECS/kxml2.spec 
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py", line 88, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.4/site-packages/mockbuild/util.py", line 547, in do
    raise exception.Error("Command failed. See logs for output.\n # %s" % (command,), child.returncode)
mockbuild.exception.Error: Command failed. See logs for output.
 # bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps  /builddir/build/SPECS/kxml2.spec 
LEAVE do --> EXCEPTION RAISED

The spec file I've used is attached. It seems maven30-xmvn needs a backport of:
https://github.com/mizdebsk/xmvn/commit/9a326bd401d3f82ce09be69fec55d48fb39d3bea

An SRPM and full log of the failure is here:
https://copr.fedorainfracloud.org/coprs/jerboaa/thermostat-latest/build/167520/
Comment 4 Mikolaj Izdebski 2017-10-05 05:20 EDT
Created attachment 1334726 [details]
Reproducer

java -cp $(build-classpath xmvn objectweb-asm slf4j/api slf4j/simple):rep.jar rep.DuplicateManifestReproducer rep.jar
Comment 7 errata-xmlrpc 2017-10-24 05:53:38 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:3022

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