CNFE for loading class using classLoader from JCommander due to wrong META-INF/MANIFEST.MF
See original GitHub issueJcommander Version
1.72
Description:
- Run
jar -xvf jcommander-1.73.jar
- Check for
META-INF/MANIFEST.MF
content - This causes problem to load any class from jcommander using
this.getClass().getClassLoader().loadClass(ParameterException.class.getName());
Reproducer Project https://github.com/dipak-pawar/jcommander-classloading/tree/jcommander_classloader
Expected output Class should load fine.
Actual Content - META-INF/MANIFEST.MF
Manifest-Version: 1.0
Bundle-Description: A Java library to parse command line options
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0
Export-Package: com.beust.jcommander.converters;version="1.73",com.beu
st.jcommander.defaultprovider;version="1.73",com.beust.jcommander;ver
sion="1.73",com.beust.jcommander.internal;version="1.73",com.beust.jc
ommander.validators;version="1.73"
Build-Date: 2018-02-23
Bundle-SymbolicName: jcommander
Bundle-Version: 1.73
Bundle-Name: com.beust.jcommander
Bundle-ManifestVersion: 2
Bnd-LastModified: 1519401535143
Created-By: 1.8.0_121 (Oracle Corporation)
Tool: Bnd-3.5.0.201709291849
Manifest-Version: 1.0
Bundle-Description: A Java library to parse command line options
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0
Export-Package: com.beust.jcommander.converters;version="1.73",com.beu
st.jcommander.defaultprovider;version="1.73",com.beust.jcommander;ver
sion="1.73",com.beust.jcommander.internal;version="1.73",com.beust.jc
ommander.validators;version="1.73"
Build-Date: 2018-02-23
Bundle-SymbolicName: jcommander
Bundle-Version: 1.73
Bundle-Name: com.beust.jcommander
Bundle-ManifestVersion: 2
Bnd-LastModified: 1519401551333
Created-By: 1.8.0_121 (Oracle Corporation)
Tool: Bnd-3.5.0.201709291849
Expected Content - META-INF/MANIFEST.MF
Manifest-Version: 1.0
Bundle-Description: A Java library to parse command line options
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0
Export-Package: com.beust.jcommander.converters;version="1.73",com.beu
st.jcommander.defaultprovider;version="1.73",com.beust.jcommander;ver
sion="1.73",com.beust.jcommander.internal;version="1.73",com.beust.jc
ommander.validators;version="1.73"
Build-Date: 2018-02-23
Bundle-SymbolicName: jcommander
Bundle-Version: 1.73
Bundle-Name: com.beust.jcommander
Bundle-ManifestVersion: 2
Bnd-LastModified: 1519401535143
Created-By: 1.8.0_121 (Oracle Corporation)
Tool: Bnd-3.5.0.201709291849
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Wrong resource url when using URLClassloader to load test ...
The Problem : This test reads a file using a ClassLoader.getSystemClassLoader().getResourceAsStream(), now the expected path of this file should ...
Read more >ScrapResidentailProxies.jar - Hybrid Analysis
Contains ability to find and load resources of a specific module ... Remote Access Related ... Creates a writable file in a temporary...
Read more >java-sig-commits - February 2015 - Fedora Mailing-Lists
[Bug 1144270] New: SBT doesn't start correctly in some 32-bit machines due to low memory. by Red Hat Bugzilla.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@cbeust Unfortunately, this seems to have reappeared for release 1.75:
Also mentioned here: https://github.com/cbeust/jcommander/commit/85cb6f7217e15f62225185ffd97491f34b7b49bb#commitcomment-32810824
Fixed in 1.78.