Reputation: 21
I am new to ws02, I am trying to build ws02 micro integrator from Ubuntu 22.04 terminal + Maven 3.6.3 + JDK 17.0.10+7. I am facing problems, getting error "Invalid CEN header" during the compilation. I explain all steps I did.
Downloaded JAVA JDK 17.0.10+7 OpenJDK17U-jdk_x64_linux_hotspot_17.0.10_7.tar
from https://adoptium.net/en-GB/temurin/releases/?os=linux&arch=x64&package=jdk&version=17
Set JAVA HOME path in .bashrc
jammy@Tasconnect-016:~$ echo $JAVA_HOME
/opt/jdk-17.0.10+7
Verified Java version
jammy@Tasconnect-016:~$ java --version
openjdk 17.0.10 2024-01-16
OpenJDK Runtime Environment Temurin-17.0.10+7 (build 17.0.10+7)
OpenJDK 64-Bit Server VM Temurin-17.0.10+7 (build 17.0.10+7, mixed mode, sharing)
Verified maven version 3.6.3
jammy@Tasconnect-016:/$ mvn --version
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.18, vendor: Eclipse Adoptium, runtime: /opt/jdk-11.0.18+10
Cloned the repo from https://github.com/wso2/micro-integrator
jammy@Tasconnect-016:~/mi$ git clone https://github.com/wso2/micro-integrator.git
List branches for mi 4.2.0 version
jammy@Tasconnect-016:~/mi/micro-integrator$ git branch -r | grep "4.2.0"
origin/master-4.2.0
origin/release-4.2.0-alpha-l895
origin/release-4.2.0-d731
origin/release-4.2.0-m1-p301
7 . Checked out branch "origin/release-4.2.0-d731" - assuming this is the release version branch for MI 4.2.0
jammy@Tasconnect-016:~/mi/micro-integrator$ git checkout origin/release-4.2.0-d731
8. Gave command , wanted to skip jacoco tests
mvn clean package -Dskip.jacoco.check=true
9 . Got below error " Invalid CEN header " at
[INFO] data-services ...................................... SUCCESS [ 0.013 s]
[INFO] WSO2 Carbon - Data Services Common ................. SUCCESS [ 0.216 s]
[INFO] WSO2 Carbon - Data Services SQL Driver ............. SUCCESS [ 30.548 s]
[INFO] WSO2 Carbon - Data Services Core ................... SUCCESS [01:18 min]
[INFO] WSO2 Micro Integrator - Mediation Initializer ...... FAILURE [ 47.939 s]
[INFO] extensions ......................................... SKIPPED
[INFO] WSO2 Micro Integrator - Transport Handlers ......... SKIPPED
[ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:3.3.0:bundle (default-bundle) on project org.wso2.micro.integrator.initializer: Error calculating classpath for project MavenProject: org.wso2.ei:org.wso2.micro.integrator.initializer:4.2.0 @ /home/jammy/mi/micro-integrator/components/org.wso2.micro.integrator.initializer/pom.xml: The JAR/ZIP file (/home/jammy/mi/micro-integrator/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/target/org.wso2.micro.integrator.inbound.endpoint-4.2.0.jar) seems corrupted, error: Invalid CEN header (invalid extra data field size for tag: 0xbfef at 242516) -> [Help 1]
So search for this org.wso2.micro.integrator.inbound.endpoint-4.2.0.jar file inside ~/.m2/repository . But found no such file .
But I found the file inside ~/mi/micro-integrator/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/target .
Deleted it rm -f org.wso2.micro.integrator.inbound.endpoint-4.2.0.jar . Rebuild with "mvn package -Dskip.jacoco.check=true" again same error .
Now again I went back to ~/.m2 folder and I searched for all files with string "inbound.endpoint". Found 3 entries with suffix *-4.7.175.jar" not exactly "4.2.0.jar"
grep: ./org/wso2/carbon/mediation/org.wso2.carbon.inbound.endpoint.persistence/4.7.175/org.wso2.carbon.inbound.endpoint.persistence-4.7.175.jar: binary file matches
grep: ./org/wso2/carbon/mediation/org.wso2.carbon.inbound.endpoint.osgi/4.7.175/org.wso2.carbon.inbound.endpoint.osgi-4.7.175.jar: binary file matches
grep: ./org/wso2/carbon/mediation/org.wso2.carbon.inbound.endpoint/4.7.175/org.wso2.carbon.inbound.endpoint-4.7.175.jar: binary file matches
Deleted these 3 files
Re-ran the command mvn package -Dskip.jacoco.check=true ( without clean because I did not want to rebuild all previously built JARs) . But again same error thrown "Invalid CEN .
How can I fix this problem?
Upvotes: 2
Views: 701
Reputation: 14604
The following is from the README of the source repo. Hence try downgrading to JDK 11.
Please note that the product can be build using only JDK 11 but the integration tests can be run in either JDK 11 or 17.
Upvotes: 0