By Hugo Laredo


2019-01-11 11:26:37 8 Comments

We need to deploy a standalone jar in an IBM AIX 6.1. This jar tries to connect to an SFTP server using hierynomus sshj and bouncycastle. When trying to instantiate the KeyAgreement, in execution time, it outputs the following:

Exception in thread "main" java.lang.ExceptionInInitializerError
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:222)
        at java.lang.Class.forNameImpl(Native Method)
        at java.lang.Class.forName(Class.java:172)
        at java.security.Provider$Service$1.run(Provider.java:831)
        at java.security.Provider$Service$1.run(Provider.java:823)
        at java.security.AccessController.doPrivileged(AccessController.java:202)
        at java.security.Provider$Service.newInstance(Provider.java:821)
        at java.security.SecureRandom.<init>(SecureRandom.java:114)
        at javax.crypto.b.<clinit>(Unknown Source)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
        at javax.crypto.KeyAgreement.getInstance(Unknown Source)
        at net.schmizz.sshj.common.SecurityUtils.registerSecurityProvider(SecurityUtils.java:88)
        at net.schmizz.sshj.common.SecurityUtils.register(SecurityUtils.java:267)
        at net.schmizz.sshj.common.SecurityUtils.isBouncyCastleRegistered(SecurityUtils.java:245)
        at net.schmizz.sshj.DefaultConfig.<init>(DefaultConfig.java:78)
        at net.schmizz.sshj.SSHClient.<init>(SSHClient.java:135)
        at com.dxc.seat.eai.EailSftpClient.getConnection(EailSftpClient.java:312)
        at com.dxc.seat.eai.EailSftpClient.startProcess(EailSftpClient.java:200)
        at com.dxc.seat.eai.SFTPFileInput.main(SFTPFileInput.java:17)
Caused by: java.lang.NullPointerException
        at org.bouncycastle.jcajce.provider.drbg.DRBG$NonceAndIV.engineGenerateSeed(Unknown Source)
        at java.security.SecureRandom.generateSeed(SecureRandom.java:343)
        at org.bouncycastle.jcajce.provider.drbg.DRBG$HybridSecureRandom.<init>(Unknown Source)
        at org.bouncycastle.jcajce.provider.drbg.DRBG.createBaseRandom(Unknown Source)
        at org.bouncycastle.jcajce.provider.drbg.DRBG.access$200(Unknown Source)
        at org.bouncycastle.jcajce.provider.drbg.DRBG$Default.<clinit>(Unknown Source)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
        ... 19 more

The JVM used to run this jar is:

java version "1.6.0"
Java(TM) SE Runtime Environment (build pap6460sr9fp1ifix-20110511(SR9 P1+IZ97552))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc64-64 jvmap6460sr9-20110203_74623 (JIT enabled, AOT enabled)
J9VM - 20110203_074623
JIT  - r9_20101028_17488ifx3
GC   - 20101027_AA)
JCL  - 20110203_01

The JVM security settings have been updated by appending the new security provider to the end of the list of providers at java.security and by adding the libraries: bcpkix-jdk15on-1.60.jar bcprov-jdk15on-1.60.jar to the ext directory.

The standalone jar has been built using maven-assembly-plugin.

We wonder why this is happening and how we could fix it.

0 comments

Related Questions

Sponsored Content

15 Answered Questions

[SOLVED] Interview: Can we instantiate abstract class?

5 Answered Questions

[SOLVED] Under what conditions is a JSESSIONID created?

  • 2009-02-27 18:00:12
  • joshjdevl
  • 330403 View
  • 243 Score
  • 5 Answer
  • Tags:   java jsessionid

0 Answered Questions

Scanner.nextLine() need double enter to finish a line in Java6

  • 2017-11-03 08:24:15
  • 核心力量
  • 164 View
  • 2 Score
  • 0 Answer
  • Tags:   java java-6 java-5

1 Answered Questions

[SOLVED] Bespoke JCE Provider on IBM AIX

2 Answered Questions

[SOLVED] Java UTF-8 filenames with IBM JVM (AIX)

  • 2012-10-19 19:04:42
  • Edward Thomson
  • 4461 View
  • 9 Score
  • 2 Answer
  • Tags:   java utf-8 aix j9

1 Answered Questions

Java System.loadLibrary("m") fails on AIX 6.1

2 Answered Questions

[SOLVED] ClassCastException caused by bug in Just In Time?

Sponsored Content