Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine if plugins can fix recent issue with installing certain features on later Java versions #1716

Open
cherylking opened this issue Aug 11, 2023 · 5 comments
Labels

Comments

@cherylking
Copy link
Member

Saw this in a recent build:

Error: [ERROR] Failed to execute goal io.openliberty.tools:liberty-maven-plugin:3.8.3-SNAPSHOT:install-feature (install-server-features) on project assembly-archive-update-it: Error installing features for server test: CWWKF1287E: The com.ibm.websphere.appserver.jsp-2.3 feature cannot be installed because the com.ibm.ws.jsp_1.0.32.jar file inside of the Enterprise Subsystem Archive (ESA) file is not a bundle file. The ESA root must contain only bundle files and directories. If you created the ESA file, verify that the file contents are correct.

Someone on another team some a similar error in one of their builds:

Execution failed for task ':installFeature'.
> io.openliberty.tools.common.plugins.util.PluginExecutionException: CWWKF1287E: The com.ibm.websphere.appserver.internal.jaxrs-1.1 feature cannot be installed because the com.ibm.websphere.appserver.thirdparty.jaxrs_1.0.59.jar file inside of the Enterprise Subsystem Archive (ESA) file is not a bundle file. The ESA root must contain only bundle files and directories. If you created the ESA file, verify that the file contents are correct.

The issue is with more recent versions of Java doing more checks on zip archives. @pnickoll Found setting system property -Djdk.util.zip.disableZip64ExtraFieldValidation=true causes the error to be ignored and the feature can install correctly.

Determine if/can the plugin specify this property when installing features to avoid the error.

#1715 bypasses the issue by updating the failing test case to use newer versions of Liberty.

@cherylking cherylking added the bug label Aug 11, 2023
@cherylking
Copy link
Member Author

@jjiwooLim Is this something that we can pass along when installing features?

@jjiwooLim
Copy link
Contributor

I was finally able to reproduce this error on my enviorment with JDK 11.0.20 and 17.0.8.

Improved ZIP64 Extra Field Validation (JDK-8302483 (not public)) was added in following versions:
Java 11.0.20
Java 17.0.8
Java 20.0.2

With these newer JDK versions, running install-feature goal using Liberty 21.0.0.3 and below produces the error. The problematic features I noticed were jsp-2.3 and jaxrs-1.1 so far. Repackaging the jar files using any Java version fixes the problem.

Unfortunately setting the system property -Djdk.util.zip.disableZip64ExtraFieldValidation=true did not fix the problem. I am still investigating but I think it's related to when the zipFile class is loaded.

@cherylking
Copy link
Member Author

With these newer JDK versions, running install-feature goal using Liberty 21.0.0.3 and below produces the error.

@jjiwooLim Please note that the first person to report this problem was using 21.0.0.12 version of Liberty. I don't know what version of Java was being used. I've asked in the original Slack thread and will post here when I find out.

@jjiwooLim
Copy link
Contributor

@cherylking
I was able to find a way to set JVM args on Maven and Gradle so that it's picked up by the Java process.

For Maven,
export MAVEN_OPTS="-Djdk.util.zip.disableZip64ExtraFieldValidation=true"

For Gradle,

export JAVA_TOOL_OPTIONS="-Djdk.util.zip.disableZip64ExtraFieldValidation=true"
#then stop the running gradle daemon to start a fresh daemon
gradle --stop

This has to be done on users side as setting the system property inside a Java class doesn't work. For more info, please check https://connortumbleson.com/2023/07/31/invalid-cen-header/ .

Using the environment variable above, I was able to install features successfully on Maven and Gradle.

@cherylking
Copy link
Member Author

Looks like a recent PR may resolve this new validation error for our scenario in a future Java fixpack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants