Invalid CEN header

262 views
Skip to first unread message

Osama Abuhamdan

unread,
Oct 1, 2023, 9:22:19 PM10/1/23
to ONOS Developers
Greetings,

I am facing this issue now too with ONOS 2.5.0 and 2.7.0
org.osgi.framework.BundleException: Unable to cache bundle: mvn:org.onosproject/onos-core-dist/2.5.0
with
Caused by: java.util.zip.ZipException: Invalid CEN header (invalid extra data field size for tag: 0xbfef at 5847)

any thoughts?

Osama Abu Hamdan

unread,
Oct 1, 2023, 9:28:19 PM10/1/23
to ONOS Developers, Osama Abuhamdan
Full Error is:

org.osgi.framework.BundleException: Unable to cache bundle: mvn:org.onosproject/onos-core-dist/2.5.0
        at org.apache.felix.framework.Felix.installBundle(Felix.java:3013)
        at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:167)
        at org.eclipse.equinox.internal.region.BundleIdBasedRegion.installBundle0(BundleIdBasedRegion.java:117)
        at org.eclipse.equinox.internal.region.BundleIdBasedRegion.installBundleAtLocation(BundleIdBasedRegion.java:97)
        at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.installBundle(BundleInstallSupportImpl.java:135)
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installBundle(FeaturesServiceImpl.java:1138)
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:900)
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)

Caused by: java.util.zip.ZipException: Invalid CEN header (invalid extra data field size for tag: 0xbfef at 5847)
        at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1769)
        at java.base/java.util.zip.ZipFile$Source.checkExtraFields(ZipFile.java:1274)
        at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1734)
        at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1463)
        at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1426)
        at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:742)
        at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:859)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:257)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:186)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:200)
        at org.apache.felix.framework.util.SecureAction.openZipFile(SecureAction.java:650)
        at org.apache.felix.framework.util.WeakZipFileFactory$WeakZipFile.<init>(WeakZipFileFactory.java:187)
        at org.apache.felix.framework.util.WeakZipFileFactory$WeakZipFile.<init>(WeakZipFileFactory.java:169)
        at org.apache.felix.framework.util.WeakZipFileFactory.create(WeakZipFileFactory.java:72)
        at org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:84)
        at org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:872)
        at org.apache.felix.framework.cache.BundleArchive.reviseInternal(BundleArchive.java:550)
        at org.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:153)
        at org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:277)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:3009)
        ... 12 more

Raphael

unread,
Oct 30, 2023, 11:06:06 AM10/30/23
to ONOS Developers, Osama Abu Hamdan, Osama Abuhamdan
Greetings,

I found out this issue is linked to the updated version of OpenJDK-11 (11.0.20+) which requires an additional environment variable (JAVA_TOOL_OPTIONS=" -Djdk.util.zip.disableZip64ExtraFieldValidation=true").
I solved it by setting this environment variable.
If the issue persists, the problem can be solved by editing the "options" file in the ONOS installation directory and the following lines: "export JAVA_TOOL_OPTIONS=-Djdk.util.zip.disableZip64ExtraFieldValidation=true"

Alessio Giorgetti

unread,
Jan 15, 2024, 11:59:56 AM1/15/24
to ONOS Developers, Raphael, Osama Abu Hamdan, Osama Abuhamdan
I have the same problem compiling ONOS applications with maven. It appeared because I did update the openjdk-11...

Using the suggested solution removes some errors, but still the application build fails:

[ERROR] /home/alessio/onos-apps/quantum-app/src/main/java/org/quantum/app/QkdLink.java:[1,1] cannot access org.quantum.app
[ERROR]   Invalid CEN header (invalid extra data field size for tag: 0xbfef size: 61373)

Where org.quantum.app is the name of the application and this error is generated by the line

Have you suggestions...? is it possible to downgrade to openjdk 11.0.14... ?

alessio

Raphael

unread,
Jan 17, 2024, 5:41:28 PM1/17/24
to Alessio Giorgetti, ONOS Developers, Osama Abu Hamdan, Osama Abuhamdan
You might succeed by downgrading the JDK, although since the newer versions are often requirements of other packages, it might get updated whenever a system upgrade is performed.
I'd advice to start your JVM with the flag mentioned before (-Djdk.util.zip.disableZip64ExtraFieldValidation=true) above
Reply all
Reply to author
Forward
0 new messages