Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 268125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T23:39:10+00:00 2026-05-11T23:39:10+00:00

For a background job which I would like to run in a J2EE container,

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T23:39:10+00:00Added an answer on May 11, 2026 at 11:39 pm

    Whenever I hear timer job, I can’t help but think that this should be separated from a Java EE app server. You can use something like Quartz, or an operating system scheduled task, or a batch manager like AutoSys, but embedding it into a servlet seems like a misuse of servlets to me.

    Java EE 5 containers have a TimerService that’s an EJB. Perhaps this will help you sort it out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know which of the options is better and why? *
I have a VB background and I'm converting to C# for my new job.
Coming from a background, I'm familiar with GUI editors that do a poor job
Background I am trying to create a copy of a business object I have
I'm trying to work out how to run a process in a background thread
Passing messages around with actors is great. But I would like to have even
I would like to write an app on Android to upload my GPS location
I have a web service (JAX-RS/Spring) that generates SQL queries which run against a
I would like to show progress of multiple Jobs running in parallel, but in
Background: Trying to set up my dev. environment in new job. Have subversion installed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.