Is the a reason why Guice injection doesn't work in a ServletConextListener?
Here is my code:
public class QuartzContextListener implements ServletContextListener {
@Inject
private DataAccess dataAccess;
@Override
public void contextInitialized(ServletContextEvent arg0) {
System.out.println(dataAccess);
}
@Override
public void contextDestroyed(ServletContextEvent arg0) {
}
Of course that:
- In all other places of the app injection is working OK.
- The above listener appears AFTER the Guice initialization.
Any idea?