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 6805083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:32:39+00:00 2026-05-26T19:32:39+00:00

I use web profile and it does not allow to use Java EE @Schedule

  • 0

I use web profile and it does not allow to use Java EE @Schedule functionality. So, I have several ways to solve the problem:

  1. reinstall the server to use full profile. Problems: it’s risky (functionality/performance) for my production and burdensome
  2. Use other scheduling functionality like Spring. Problems: I don’t know how to link Spring with JavaEE as I want to use CDI beans in my scheduler. Seam-spring module could help me (http://sfwk.org/Seam3/SpringModule) but its documentation is not available at the moment and I don’t really know the status of it.

So, which is the best way to enable scheduling inside my glassfish app?

Thanks

  • 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-26T19:32:39+00:00Added an answer on May 26, 2026 at 7:32 pm

    Ok, I managed to do this using spring module. Would be better to use embedded Scheduler J2EE functionality, but this is not included into Glassfish web profile, only to full (WTF??). As my project is in prod, I don’t want to upgrade to full one, especially as there is no flexible way to do this upgrade. Only full server substitute. Very poor JavaEE….

    So, first, we need to define some functionality, which will be run at schedule:

    @Scope(value="application")
    public class ClosePolisesTimer {            
    BusinessAttirbuteDAO attributeDAO;
    
        @Scheduled(cron="0 0 0 * * *")
        public void doCloseObsolete() {
           // ...
        }
    }
    

    Second, we should create the spring configuration file with the following configuration:

    <bean id="businessAttributeDAOBean" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiName" value="java:global/KaskoCalculator/BusinessAttirbuteDAO" />
        </bean>
    <bean id="ClosePolisesTimer" class="com.rstk.kasko.bean.service.ClosePolisesTimer">
            <aop:scoped-proxy />
            <property name="polisDAO" ref="polisDAOBean" />
            <property name="attributeDAO" ref="businessAttributeDAOBean" />
        </bean>
    
    <task:annotation-driven scheduler="closePolisExecutor"/>
    <task:scheduler id="closePolisExecutor" pool-size="1"/>
    

    That’s all. I define EJB beans and use “aop:scoped-proxy” to initialize my scheduler by them. Spring schedule is included into core spring module, so only core spring dependency is necessary

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

Sidebar

Related Questions

I have two web applications in the same solution. They both use different membership/profile
I have been scouring the web for how to solve my problem with grails
Can anyone suggest a good reason to use web services instead of RPC (not
I have some business objects which use: Web.Configuration.WebConfigurationManager.AppSettings.Item(SomeSetting) Now that I'm breaking those objects
So I have an asp.net Web Application (Not Web Site) that I am trying
I have read a couple of tutorials on several web sites as well as
I am trying to have some variable properties value and use Maven profile to
How can we use Web services in Android Applications?
Should we only use Web-Safe Colors while in design/coding/development for website/apps?
I am looking for specific guidelines for when to use Web Services frameworks versus

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.