1753325 Members
5820 Online
108792 Solutions
New Discussion юеВ

KRNG error

 
Prabu_3
Frequent Advisor

KRNG error

I have installed KRNG11i product on HP-UX 11.11v1 (PA-RISC) system. This depot constitutes (PHKL_27750, RandomNumGen, RandomNumGenDyn) products. Installation was successful (with kernel rebuild + reboot). On the same server, I have installed Java 1.5 also.

I have an Java application which uses random number generation. When I try to start this application, I am getting the following error :

==============================================
Caused by: java.security.ProviderException: setSeed() failed
at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:223)
at sun.security.provider.NativePRNG$RandomIO.access$100(NativePRNG.java:108)
at sun.security.provider.NativePRNG.engineSetSeed(NativePRNG.java:92)
at java.security.SecureRandom.setSeed(SecureRandom.java:400)
... 8 more
Caused by: java.io.IOException: No such device
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:247)
at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:221)
... 12 more
==============================================

After getting this error, the application will not come up. If I remove the KRNG package, this error vanishes.

I would like to know is there a way to bringup my Java application along with KRNG package installed. If so, can you please share it..
2 REPLIES 2
Matti_Kurkela
Honored Contributor

Re: KRNG error

It seems the setSeed() is failing.
In effect, your Java application is trying to set the seed value of the in-kernel system-wide random number generator. That should not be allowed unless you're running your Java application as root.

Furthermore, seeding the KRNG should not be necessary (except maybe when the system boots). KRNG gets its randomness from things like network packet arrival times and/or SCSI I/O completion times, taking some of the last bits/digits of the timestamps (I don't remember the exact process, but it was something like this).

If you can configure or change the application so that it won't try to setSeed() when using NativePRNG or at least won't abort if it fails, that might solve your problem.
MK
Prabu_3
Frequent Advisor

Re: KRNG error

I got a solution that if we run the application using

-D java.security.egd=/dev/random

we will not get the error message.