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

  • SEARCH
  • Home
  • 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 7066327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:04:10+00:00 2026-05-28T05:04:10+00:00

I have webproject on Java EE 5 and Websphere 7.0 I need to create

  • 0

I have webproject on Java EE 5 and Websphere 7.0
I need to create scheduler and start it after deploy application.
What I tried:
I create EJB with interface:

@Local
public interface ISchedulerBean {

    public void executeTimer(Timer timer);
    public void createTimer();
}

stateless session bean implements this interface. Method createTimer creates timer instance from TimerService. This part of code work fine.
Also I need to call method createTimer() after application deploy.
I tried:

  1. Add listener servletContext:

    public class SchedulerInitialiserContextListener implements ServletContextListener {
    //service to lookup ejb
    private WebServiceLocator webServiceLocator;
    private SchedulerService schedulerService;

    public SchedulerInitialiserContextListener() {
    webServiceLocator = new WebServiceLocator();
    schedulerService = webServiceLocator.getSchedulerService();
    }

    public void contextDestroyed(ServletContextEvent ctx) {
    }
    
    public void contextInitialized(ServletContextEvent ctx) {
        schedulerService.createTimer();
    }
    

    }

  2. create Servlet with 1 where inject SchedulerBean in init() method and call createTimer.

But this does not work, because at first webspere deploy web application, call listeners, initialize servlets, and only then deploy ejb.jar in which all ejb are located. I can see that in webshpere log file. So when I try get ejb throw @EJB annotation or lookup I get Exception, beacause ejb has not been found.
May be is other approach to start timer after deploy ejb module or change deploy order?

  • 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-28T05:04:10+00:00Added an answer on May 28, 2026 at 5:04 am

    You can set the startup order of your modules.

    Assuming you develop with Rational Application Developer do the following:

    Right click your ear project and click Java EE -> Open WebSphere Application Server Deployment.

    Look for the Application section, you will see all the modules and you can set the Start weight for each one.

    Make sure your web project containing the Context Listener has the largest value an you should be fine.

    • This operation creates an ibmconfig directory under your ear project’s META-INF, make sure you package it in your build process
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a basic EJB 3.0 (Java EE 5) project in IBM RAD (aka
I have a Java Project , for which I'm now creating a Web interface,
So I have taken over a Java Web project . The application was written
I have a simple java project with this basic structure: IncludeMe src deploy siteSpecific
The class I have written works fine as a normal Java application, but when
I am a newbie trying to create a sample web application using; MySQL Java
I have recently created a web project in Java using eclipse. I have a
I have a web application that comprises the following: A web project (with a
I am a brand new Java developer (I have been working in asp.net) and
I have gwt web project, which must use application.properties (on client side) loaded as

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.