static block in Password class does not initialize due to NPE #120
Labels
good first issue
Good for newcomers
priority: high
status: confirmed
type: bug
Something isn't working
Milestone
Issue Description:
Application throws a NoClassDefFoundError for Password class even though it is present in the final application build.
Steps to reproduce:
Simply use the Password class to create an scrypt hash as mentioned in the password4j getstarted page.
Expected behavior:
Generate a hash without Exception.
Environment:
Additional context:
This is happening because the static block of Password.java is not loading due to an eventual NPE that occurs in the library code. This in turn stops this class from loading and manifests as a java.lang.NoClassDefFoundError in the application.
Please confirm if this is an issue or requires any configuration change.
Exception stack trace:
Caused by: java.lang.NullPointerException
at com.password4j.AlgorithmFinder.getAllPBKDF2Variants(AlgorithmFinder.java:346)
at com.password4j.Utils.printBanner(Utils.java:582)
at com.password4j.Password.(Password.java:37)
Problem in line number 346 of AlgorithmFinder class. The provider creating the problem is ThreadLocalSecurityProvider. The size says 4 but returns null.
The text was updated successfully, but these errors were encountered: