Skip to content

gradle - bouncycastle classversion conflict on NISTObjectIdentifiers #314

@nora-h-papercut

Description

@nora-h-papercut

I'm encountering an issue that seems to be related to the bouncycastle providers on the classpath - jsign uses LTS-2.73.7, but gradle (8.14.3) appears to be trying to interact with the builtin version (or another on my classpath), which is different and lacks certain fields.

Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.bouncycastle.cms.CMSSignedData
	at net.jsign.cat.CatalogFile.<init>(CatalogFile.java:94)
	at net.jsign.cat.CatalogFile.<init>(CatalogFile.java:79)
	at net.jsign.cat.CatalogFile.isCatalogFile(CatalogFile.java:64)
	at net.jsign.spi.CatalogSignableProvider.isSupported(CatalogSignableProvider.java:38)
	at net.jsign.Signable.of(Signable.java:182)
	at net.jsign.SignerHelper.sign(SignerHelper.java:438)
	at net.jsign.SignerHelper.execute(SignerHelper.java:305)
	at net.jsign.SignerHelper.execute(SignerHelper.java:299)
	at net.jsign.JsignGradlePlugin$1.doCall$original(JsignGradlePlugin.java:51)
	at net.jsign.JsignGradlePlugin$1.doCall(JsignGradlePlugin.java)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
...
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.NoSuchFieldError: Class org.bouncycastle.asn1.nist.NISTObjectIdentifiers does not have member field 'org.bouncycastle.asn1.ASN1ObjectIdentifier id_slh_dsa_sha2_128s' [in thread "Daemon worker Thread 8"]
	at org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder.<clinit>(Unknown Source)
	at org.bouncycastle.cms.CMSSignedData.<clinit>(Unknown Source)
	... 214 more

I'm not 100% on what would cause this behaviour and whether there's a reasonable workaround where I can manually depend on the LTS to get it to be used - and/or whether there's an issue with the way the gradle plugin has its dependencies declared in the published version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions