wso2 / product-micro-integrator

The cloud-native configuration driven runtime that helps developers implement composite microservices.
https://wso2.com/integration/
Apache License 2.0
204 stars 221 forks source link

[MI] Impossible to build with JDK11 or JDK17 without setting the JAVA_TOOL_OPTIONS environment variable #3154

Open gspadotto opened 9 months ago

gspadotto commented 9 months ago

Description

Any 4.x.x version of MI cannot be built with reasonably recent JDKs unless you set the following environment variable:

export JAVA_TOOL_OPTIONS=' -Djdk.util.zip.disableZip64ExtraFieldValidation=true -Djdk.nio.zipfs.allowDotZipEntry=true --add-opens=java.base/java.net=ALL-UNNAMED '

This is due to the fact that the carbon-p2-plugin does not pass VM arguments to the P2ApplicationLauncher class: https://github.com/wso2/maven-tools/blob/v5.1.2/carbon-p2-plugin/src/main/java/org/wso2/maven/p2/RepositoryGenMojo.java#L259-L269

In other terms, the carbon-p2-plugin never invokes this method: https://github.com/eclipse-tycho/tycho/blob/tycho-0.25.0/sisu-equinox/sisu-equinox-launching/src/main/java/org/eclipse/sisu/equinox/launching/internal/P2ApplicationLauncher.java#L80-L84

There is no mention of this in the README.md file.

Steps to Reproduce

Clone the MI repository, checkout a recent tag (v4.2.0, v4.3.0-m1), follow the instructions to build it with either JDK11 or JDK17.

Affected Component

MI

Version

v4.2.0, v4.3.1-m1

Environment Details (with versions)

openjdk version "11.0.22" 2024-01-16 OpenJDK Runtime Environment Temurin-11.0.22+7 (build 11.0.22+7) OpenJDK 64-Bit Server VM Temurin-11.0.22+7 (build 11.0.22+7, mixed mode)

Mac OS Big Sur (11.7.10)

Apache Maven 3.9.3 (21122926829f1ead511c958d89bd2f672198ae9f) Maven home: /usr/local/apache-maven-3.9.3 Java version: 11.0.22, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home Default locale: en_IT, platform encoding: UTF-8 OS name: "mac os x", version: "11.7.10", arch: "x86_64", family: "mac"

Relevant Log Output

JDK11: 

[INFO] Running Equinox P2 Publisher Application for Repository Generation
[INFO] Command line:
    [/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home/bin/java, -jar, /Users/guido/.m2/repository/org/eclipse/tycho/tycho-bundles-external/0.25.0/eclipse/plugins/org.eclipse.equinox.launcher_1.3.200.v20151021-1308.jar, -configuration, /var/folders/w1/8dd3_0415zv9m0cvcy1q4w4c0000gn/T/tycho-p2-runtime9617656297857904510.tmp/configuration, -nosplash, -application, org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher, -source, /Users/guido/WSO2-Source/micro-integrator/p2-profile/target/tmp.1709135275399/featureExtract, -metadataRepository, file:/Users/guido/WSO2-Source/micro-integrator/p2-profile/target/p2-repo, -metadataRepositoryName, micro-integrator-p2-profile, -artifactRepository, file:/Users/guido/WSO2-Source/micro-integrator/p2-profile/target/p2-repo, -artifactRepositoryName, micro-integrator-p2-profile, -publishArtifacts, -publishArtifactRepository, -compress, -append]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.eclipse.osgi.storage.FrameworkExtensionInstaller (file:/Users/guido/.m2/repository/org/eclipse/tycho/tycho-bundles-external/0.25.0/eclipse/plugins/org.eclipse.osgi_3.11.0.v20160309-1913.jar) to method java.net.URLClassLoader.addURL(java.net.URL)
WARNING: Please consider reporting this to the maintainers of org.eclipse.osgi.storage.FrameworkExtensionInstaller
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Generating metadata for ..
Status ERROR: this code=0 publishing result null children=[Status OK: unknown code=0 OK null Status ERROR: org.eclipse.equinox.p2.publisher.eclipse code=0 An error occurred while publishing bundle /Users/guido/WSO2-Source/micro-integrator/p2-profile/target/tmp.1709135275399/featureExtract/plugins/org.wso2.micro.integrator.inbound.endpoint-4.3.0.m1.jar: Invalid CEN header (invalid extra data field size for tag: 0xbdbf at 252545) java.util.zip.ZipException: Invalid CEN header (invalid extra data field size for tag: 0xbdbf at 252545)]
Product publisher application was executed with the following arguments:
-source
/Users/guido/WSO2-Source/micro-integrator/p2-profile/target/tmp.1709135275399/featureExtract
-metadataRepository
file:/Users/guido/WSO2-Source/micro-integrator/p2-profile/target/p2-repo
-metadataRepositoryName
micro-integrator-p2-profile
-artifactRepository
file:/Users/guido/WSO2-Source/micro-integrator/p2-profile/target/p2-repo
-artifactRepositoryName
micro-integrator-p2-profile
-publishArtifacts
-publishArtifactRepository
-compress
-append
[ERROR] P2 publisher return code was 1
org.apache.maven.plugin.MojoFailureException: P2 publisher return code was 1
    at org.wso2.maven.p2.RepositoryGenMojo.generateRepository (RepositoryGenMojo.java:255)
    at org.wso2.maven.p2.RepositoryGenMojo.createRepo (RepositoryGenMojo.java:204)
    at org.wso2.maven.p2.RepositoryGenMojo.execute (RepositoryGenMojo.java:191)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for WSO2 Enterprise Integrator - micro-integrator P2 Profile Generation 4.3.0-m1:
[INFO] 
[INFO] WSO2 Enterprise Integrator - micro-integrator P2 Profile Generation FAILURE [  8.801 s]

JDK17:
[INFO] Running Equinox P2 Publisher Application for Repository Generation
[INFO] Command line:
    [/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/java, -jar, /Users/guido/.m2/repository/org/eclipse/tycho/tycho-bundles-external/0.25.0/eclipse/plugins/org.eclipse.equinox.launcher_1.3.200.v20151021-1308.jar, -configuration, /var/folders/w1/8dd3_0415zv9m0cvcy1q4w4c0000gn/T/tycho-p2-runtime6692016478991399324.tmp/configuration, -nosplash, -application, org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher, -source, /Users/guido/WSO2-Source/micro-integrator/p2-profile/target/tmp.1709135391475/featureExtract, -metadataRepository, file:/Users/guido/WSO2-Source/micro-integrator/p2-profile/target/p2-repo, -metadataRepositoryName, micro-integrator-p2-profile, -artifactRepository, file:/Users/guido/WSO2-Source/micro-integrator/p2-profile/target/p2-repo, -artifactRepositoryName, micro-integrator-p2-profile, -publishArtifacts, -publishArtifactRepository, -compress, -append]
java.lang.ExceptionInInitializerError
    at org.eclipse.osgi.storage.Storage.<init>(Storage.java:100)
    at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:87)
    at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:66)
    at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:303)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:239)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:670)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:609)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1516)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1489)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.net.URLClassLoader.addURL(java.net.URL) accessible: module java.base does not "opens java.net" to unnamed module @57d5872c
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
    at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
    at org.eclipse.osgi.storage.FrameworkExtensionInstaller.findMethod(FrameworkExtensionInstaller.java:51)
    at org.eclipse.osgi.storage.FrameworkExtensionInstaller.findMethod(FrameworkExtensionInstaller.java:58)
    at org.eclipse.osgi.storage.FrameworkExtensionInstaller.findAddURLMethod(FrameworkExtensionInstaller.java:42)
    at org.eclipse.osgi.storage.FrameworkExtensionInstaller.<clinit>(FrameworkExtensionInstaller.java:36)
    ... 14 more
An error has occurred. See the log file
null.
[ERROR] P2 publisher return code was 13
org.apache.maven.plugin.MojoFailureException: P2 publisher return code was 13
    at org.wso2.maven.p2.RepositoryGenMojo.generateRepository (RepositoryGenMojo.java:255)
    at org.wso2.maven.p2.RepositoryGenMojo.createRepo (RepositoryGenMojo.java:204)
    at org.wso2.maven.p2.RepositoryGenMojo.execute (RepositoryGenMojo.java:191)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for WSO2 Enterprise Integrator - micro-integrator P2 Profile Generation 4.3.0-m1:
[INFO] 
[INFO] WSO2 Enterprise Integrator - micro-integrator P2 Profile Generation FAILURE [  5.366 s]

Related Issues

https://github.com/wso2/micro-integrator/issues/3012 https://github.com/eclipse-tycho/tycho/discussions/3112

Suggested Labels

Affected/MI-4.x.x

dbalasse commented 8 months ago

Upvote

gspadotto commented 7 months ago

@chamilaadhi any comment/remark about https://github.com/wso2/maven-tools/pull/118 ?

I am trying to build MI on a private branch of v4.3.0-m1 but I would need to know how this dependency has been built, in order for me to create an equivalent but more recent Equinox runtime to start from: https://mvnrepository.com/artifact/org.eclipse.equinox/org.eclipse.equinox.executable/3.5.0.v20110530-7P7NFUFFLWUl76mart

I have reached the point where you can build MI v4.3.0-m1 with jdk 17 (with JAVA_TOOL_OPTIONS set) but there are still some issues when "materialising" the product (I think those are due to inconsistent Import/Export packages and Service Component Runtime not being used/set properly):

    [INFO] --- wso2-carbon-p2:5.2.50-SNAPSHOT:p2-profile-gen (3-p2-profile-generation) @ micro-integrator-p2-profile ---
    [INFO] Running Equinox P2 Director Application
    Installing org.wso2.micro.integrator.server.feature.group 4.3.0.m1.
    Installing org.wso2.micro.integrator.initializer.feature.group 4.3.0.m1.
    Installing org.apache.synapse.wso2.feature.group 4.0.0.wso2v98.
    Installing org.apache.synapse.transport.fix.feature.group 4.0.0.wso2v98.
    Installing org.apache.synapse.transport.nhttp.feature.group 4.0.0.wso2v98.
    Installing org.apache.synapse.transport.vfs.feature.group 4.0.0.wso2v98.
    Installing org.apache.synapse.transport.vfs.smb2.feature.group 4.0.0.wso2v98.
    Installing org.wso2.micro.integrator.mediators.server.feature.group 4.3.0.m1.
    Installing org.wso2.carbon.relay.server.feature.group 4.7.197.
    Installing org.wso2.carbon.mediator.smooks.server.feature.group 4.7.197.
    Installing org.wso2.carbon.mediator.datamapper.server.feature.group 4.7.197.
    Installing org.wso2.carbon.mediator.datamapper.engine.feature.group 4.7.197.
    Installing org.wso2.carbon.transports.sap.feature.group 4.7.36.
    Installing org.wso2.micro.integrator.websocket.feature.group 4.3.0.m1.
    Installing org.wso2.micro.integrator.inbound.endpoints.server.feature.group 4.3.0.m1.
    Installing org.wso2.micro.integrator.mediation.ntask.feature.group 4.3.0.m1.
    Installing org.wso2.micro.integrator.identity.xacml.mediator.feature.group 4.3.0.m1.
    Installing org.wso2.micro.integrator.mediator.dataservice.feature.group 4.3.0.m1.
    Installing org.wso2.carbon.core.runtime.feature.group 4.8.1.
    Installing org.wso2.micro.integrator.ntask.core.feature.group 4.3.0.m1.
    Installing org.wso2.carbon.databridge.datapublisher.feature.group 5.2.52.
    Installing org.wso2.micro.integrator.analytics.messageflow.data.publisher.feature.group 4.3.0.m1.
    Installing org.wso2.micro.integrator.observability.feature.group 4.3.0.m1.
    Installing org.apache.axis2.transport.jms.feature.group 2.0.0.wso2v69.
    Installing org.apache.axis2.transport.mail.feature.group 2.0.0.wso2v69.
    Installing org.apache.axis2.transport.tcp.feature.group 2.0.0.wso2v69.
    Installing org.apache.axis2.transport.udp.feature.group 2.0.0.wso2v69.
    Installing org.apache.axis2.transport.xmpp.feature.group 2.0.0.wso2v69.
    Installing org.apache.axis2.transport.rabbitmq.feature.group 2.0.0.wso2v69.
    Installing org.apache.axis2.transport.mqtt.feature.group 2.0.0.wso2v69.
    Installing org.wso2.ciphertool.feature.group 1.1.15.
    Installing org.wso2.micro.integrator.security.server.feature.group 4.3.0.m1.
    Installing org.wso2.micro.integrator.crypto.feature.group 4.3.0.m1.
    Installing org.wso2.micro.integrator.dataservices.server.feature.group 4.3.0.m1.
    Installing org.wso2.transport.http.netty.feature.group 6.3.49.
    Installing org.wso2.micro.integrator.logging.updater.feature.group 4.3.0.m1.
    Installation failed.
    Cannot complete the install because one or more required items could not be found.
        Software being installed: org.wso2.micro.integrator.analytics.messageflow.data.publisher.feature 4.3.0.m1 (org.wso2.micro.integrator.analytics.messageflow.data.publisher.feature.group 4.3.0.m1)
        Missing requirement: org.wso2.micro.integrator.analytics.messageflow.data.publisher 4.3.0.m1 (org.wso2.micro.integrator.analytics.messageflow.data.publisher 4.3.0.m1) requires 'osgi.service; (objectClass=org.wso2.micro.integrator.core.services.Axis2ConfigurationContextService)' but it could not be found
        Cannot satisfy dependency:
            From: org.wso2.micro.integrator.analytics.messageflow.data.publisher.feature 4.3.0.m1 (org.wso2.micro.integrator.analytics.messageflow.data.publisher.feature.group 4.3.0.m1)
            To: org.eclipse.equinox.p2.iu; org.wso2.micro.integrator.analytics.messageflow.data.publisher [4.3.0.m1,4.3.0.m1]
    [ERROR] [77228b40-702e-4ebd-b12f-4a78cf9e1a64][plugin>org.wso2.maven:carbon-p2-plugin:5.2.50-SNAPSHOT] Cannot complete the install because one or more required items could not be found.
yasirjanjua commented 4 months ago

@gspadotto do you know how to build the Dashboard?

gspadotto commented 4 months ago

@yasirjanjua I usually build all the components.

The only references (in master) to a Dashboard are here and here, so I suppose that the component to build is this.

I have not found the Dashboard UI in the code of this repository.