For a background job which I would like to run in a J2EE container, I found the suggestion to create a startup servlet and use the Timer Service API to create a managed Timer (in the answers for What tools are there for timed batch processes in J2EE?).
To create a timer, I need a context which implements the timer API. (Example)
In the Servlet class, I override the init method, but it has only access to a ServletContext, but not to a SessionContext. A ServletContext does not have methods to create timers, so I am stuck here.
How can I access the J2EE timer service in the startup code of a servlet?