0

I have my java project in Intellij Idea, the app in the project connect to a database (apache derby).

If I run the application not in debug mode I get no errors, no exceptions, it seems to work fine.

If I run the application in Intellij debug mode I get:

java.security.InvalidAlgorithmParameterException: DH key size must be multiple of 64, and can only range from 512 to 8192 (inclusive). The specific key size 256 is not supported

when this happen it asks to open Intellij decompiler. This happen when I try to connect to the database.

I don't understand what is the right behaviour, if there are some problems or not. I have to consider the one in normal run or the one in debug mode? Same jvm version is both the tests.

Thanks for the help

UPDATE: Just to add another thing: if after this exception caught by the debugger I resume the program execution it seems to work with no problem. It doesn't throw it again, at lest from my tests.

res1
  • 3,482
  • 5
  • 29
  • 50
  • Which jre/jdk are you using? Do you use a different configuration for running and debugging? – WoAiNii Dec 08 '22 at 17:24
  • I tried with different jdk versions, 11-17, AdoptOpenJDK/Temurin but still the same. I have the class with main method I run it with "Run App.main()" or "Debug App.main()" or with the run configurations that it creates but it is always the same. In debug mode I get this exception. I run it as jar outside of Intellij and no problems. – res1 Dec 08 '22 at 17:33
  • 1
    I would try adding bouncy castle to your java version, something as described [here](https://stackoverflow.com/questions/40381968/dh-key-size-must-be-multiple-of-64-and-can-only-range-from-512-to-2048-inclusi) – WoAiNii Dec 08 '22 at 20:31
  • Thanks for your informations, I have already tried to add bouncy caste but I was using `Security.addProvider(...)` to register it and this didn't work. If, as in the question you linked, I use `Security.insertProviderAt(..., 1)` it works, no more Exception in debug mode. But this still doesn't explain why the exception happen only in debug mode of Intellij. – res1 Dec 09 '22 at 08:42
  • Try sharing the complete details of the exception you get, maybe there are some clues in those details. – Bryan Pendleton Dec 10 '22 at 23:10

0 Answers0