Weird error : java.lang.NoSuchFieldError: id_blake2s256

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Weird error : java.lang.NoSuchFieldError: id_blake2s256

Subhayan Dutta
Hello,

I am trying to write an app which stores the user data in one App
Engine environment, which generates a unique JWT token and the same
token is used in other App Engine environments to validate the user.
Simple enough, right ?

Now the JWTToken gets created (and I am able to decode is locally on
my env as well as I have the keys to decrypt it). However, on the app
engine, it throws up an weird exception as shown below. Note that all
the jars have been added to the Eclipse app engine project. Also, the
other app engine project which also uses the same APIs to generate the
token, appears to work fine. Any clues will be of immense help.

The code fails on the following line:

java.security.Security.addProvider(new BouncyCastleProvider())

Exception is as follows (I could not add the complete stacktrace as it
has references to our code which cannot be exposed)

java.lang.NoSuchFieldError: id_blake2s256
at com.google.appengine.runtime.Request.process-e3210445ee703a77(Request.java)
at org.bouncycastle.jcajce.provider.digest.Blake2s$Mappings.configure(Unknown
Source)
at org.bouncycastle.jce.provider.BouncyCastleProvider.loadAlgorithms(Unknown
Source)
at org.bouncycastle.jce.provider.BouncyCastleProvider.setup(Unknown Source)
at org.bouncycastle.jce.provider.BouncyCastleProvider.access$000(Unknown Source)
at org.bouncycastle.jce.provider.BouncyCastleProvider$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(AccessController.java:32)
at org.bouncycastle.jce.provider.BouncyCastleProvider.<init>(Unknown Source)

This issue is also posted at:
https://stackoverflow.com/questions/49768064/java-lang-nosuchfielderror-id-blake2s256-while-using-bouncycastle

Thanks and regards
Subhayan Dutta

Reply | Threaded
Open this post in threaded view
|

Re: Weird error : java.lang.NoSuchFieldError: id_blake2s256

David Hook-3

There's another version of Bouncy Castle in the class path somewhere.

Regards,

David

On 11/04/18 16:51, Subhayan Dutta wrote:

> Hello,
>
> I am trying to write an app which stores the user data in one App
> Engine environment, which generates a unique JWT token and the same
> token is used in other App Engine environments to validate the user.
> Simple enough, right ?
>
> Now the JWTToken gets created (and I am able to decode is locally on
> my env as well as I have the keys to decrypt it). However, on the app
> engine, it throws up an weird exception as shown below. Note that all
> the jars have been added to the Eclipse app engine project. Also, the
> other app engine project which also uses the same APIs to generate the
> token, appears to work fine. Any clues will be of immense help.
>
> The code fails on the following line:
>
> java.security.Security.addProvider(new BouncyCastleProvider())
>
> Exception is as follows (I could not add the complete stacktrace as it
> has references to our code which cannot be exposed)
>
> java.lang.NoSuchFieldError: id_blake2s256
> at com.google.appengine.runtime.Request.process-e3210445ee703a77(Request.java)
> at org.bouncycastle.jcajce.provider.digest.Blake2s$Mappings.configure(Unknown
> Source)
> at org.bouncycastle.jce.provider.BouncyCastleProvider.loadAlgorithms(Unknown
> Source)
> at org.bouncycastle.jce.provider.BouncyCastleProvider.setup(Unknown Source)
> at org.bouncycastle.jce.provider.BouncyCastleProvider.access$000(Unknown Source)
> at org.bouncycastle.jce.provider.BouncyCastleProvider$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(AccessController.java:32)
> at org.bouncycastle.jce.provider.BouncyCastleProvider.<init>(Unknown Source)
>
> This issue is also posted at:
> https://stackoverflow.com/questions/49768064/java-lang-nosuchfielderror-id-blake2s256-while-using-bouncycastle
>
> Thanks and regards
> Subhayan Dutta
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Weird error : java.lang.NoSuchFieldError: id_blake2s256

Subhayan Dutta
Following are the list of bouncycastle jars on the classpath:

bc-fips-1.0.1.jar

bcpg-jdk15on-159.jar

bcpkix-fips-1.0.1.jar

bcpkix-jdk15on-159.jar

bcprov-ext-jdk15on-159.jar


Also, the app works when it is run locally. Any clues ?

Thanks and regards
Subhayan

On Wed, Apr 11, 2018 at 2:31 PM, David Hook <[hidden email]> wrote:

>
> There's another version of Bouncy Castle in the class path somewhere.
>
> Regards,
>
> David
>
> On 11/04/18 16:51, Subhayan Dutta wrote:
>> Hello,
>>
>> I am trying to write an app which stores the user data in one App
>> Engine environment, which generates a unique JWT token and the same
>> token is used in other App Engine environments to validate the user.
>> Simple enough, right ?
>>
>> Now the JWTToken gets created (and I am able to decode is locally on
>> my env as well as I have the keys to decrypt it). However, on the app
>> engine, it throws up an weird exception as shown below. Note that all
>> the jars have been added to the Eclipse app engine project. Also, the
>> other app engine project which also uses the same APIs to generate the
>> token, appears to work fine. Any clues will be of immense help.
>>
>> The code fails on the following line:
>>
>> java.security.Security.addProvider(new BouncyCastleProvider())
>>
>> Exception is as follows (I could not add the complete stacktrace as it
>> has references to our code which cannot be exposed)
>>
>> java.lang.NoSuchFieldError: id_blake2s256
>> at com.google.appengine.runtime.Request.process-e3210445ee703a77(Request.java)
>> at org.bouncycastle.jcajce.provider.digest.Blake2s$Mappings.configure(Unknown
>> Source)
>> at org.bouncycastle.jce.provider.BouncyCastleProvider.loadAlgorithms(Unknown
>> Source)
>> at org.bouncycastle.jce.provider.BouncyCastleProvider.setup(Unknown Source)
>> at org.bouncycastle.jce.provider.BouncyCastleProvider.access$000(Unknown Source)
>> at org.bouncycastle.jce.provider.BouncyCastleProvider$1.run(Unknown Source)
>> at java.security.AccessController.doPrivileged(AccessController.java:32)
>> at org.bouncycastle.jce.provider.BouncyCastleProvider.<init>(Unknown Source)
>>
>> This issue is also posted at:
>> https://stackoverflow.com/questions/49768064/java-lang-nosuchfielderror-id-blake2s256-while-using-bouncycastle
>>
>> Thanks and regards
>> Subhayan Dutta
>>
>>
>
>