interesting problem:
I have a Domain Class which looks like
class Dummy {
String key = (''+new Date()).encodeAsSHA256()
}
When I try to start my App, I get a long stacktrace / error message stating
Invocation of init method failed; nested exception is org.hibernate.InstantiationException: could not instantiate test objectmad.Dummy
...
Caused by MissingMethodException: No signature of method: java.lang.String.encodeAsSHA256() is applicable for argument types: () values: []
now, if I remove the .encodeAsSHA256(), start the application in dev mode and re-insert the encode, it works 🙂
So basically, the code works @ runtime, but it seems that @ initialisation time, the String class isn’t ready for the encoders yet.
Any idea how I can fix this without creating a custom constructor?
found a solution: the encoder can also be invoked directly, but you have to know the right package…
…solves the problem…