JBoss 6.
I’m led to believe that I can mark a class as @Stateless and also annotate it as a resteasy webservice.
All good so far and my code seems to deploy and run.
But, as ever… my EntityManager isn’t injected and remains null. I’ve tried creating another class without resteasy annotations, marking it as @Stateless, injecting EntityManager and having that injected into my resteasy web service, but this time the injection of the other stateless session bean is null.
Should I be able to inject an EntityManager into an @Stateless resteasy web service? If not, how can I get hold of one – I haven’t had any luck creating a stateless session bean and injecting that into the servlet instead?
Thanks in advance.
I’ve managed to skirt around it by using an InitialContext lookup on the session bean from the servlet.