According to the error message, I looked at the code and found this:
public ECKey getKey() {
return ECKey.fromPrivate(Arrays.copyOf(bytes, 32), isPubKeyCompressed());
}
So, you're calling
getKey() just fine, but something breaks when this method calls
ECKey.fromPrivate(...).
It seems to me that there's something wrong with
bytes, so probably your initialization of
dumpedPrivateKey is wrong. Might want to look into that a bit more.
Thanks to @larry_vw_1955, I think I got it.
that addresses corresponds to hex private key of 0x1.
We can see in the Java code that it doesn't permit private keys zero or one exactly because they're not allowed to be used:
checkArgument(!priv.equals(BigInteger.ZERO));
checkArgument(!priv.equals(BigInteger.ONE));