file:/dev/random generated exception: null

Daniel Fisher daniel.fisher at
Tue Oct 21 08:18:29 PDT 2003

On Mon, 20 Oct 2003 17:23:51 -0600
Greg Lewis <glewis at> wrote:

> On Mon, Oct 20, 2003 at 11:08:39AM -0400, Daniel Fisher wrote:
> > Looks like you ran out of random bytes in /dev/random, which is not
> > uncommon.
> > If you want to avoid this error use /dev/urandom.
> >
> However, doing so will get you much lower quality random numbers.
> Depending on how much you value security this may not be acceptable.
> I'd try rndcontrol(8) first, as Alexey mentioned.

In my experience /dev/urandom is the only way to guarantee that ssl
connections do not fail due to lack of random bytes.
This is a common problem on servers which make a lot of separate ssl
connections and cannot gather enough entropy to keep up.
However, if the load on your application allows using /dev/random you
should do so.
Just keep in mind you may see these errors every so often.
There are also other ways to gather entropy, but I can't vouch for them:

Daniel Fisher

More information about the freebsd-java mailing list