Hi,
I have a background service that runs every 10 min.
This service queries the DB for jobs to execute a will load a class with a different business logic according to the job (using Class.forName()). They implement the same Interface, of course.
I declared those classes to be SEAM components but when I try to use the entityManager or Logger I get a NPE.
Answering my own question, I suppose this is because Class.forName() goes under SEAM's injection mechanism and it won't have a chance to inject the dependencies.
I could probably work around that by injecting those myself, after I load the class. Is there a better way to do that?
Thanks!