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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:41:55+00:00 2026-05-27T23:41:55+00:00

I am trying to read message bundle in a job (Grails 2.0, Quartz-0.4.2): class

  • 0

I am trying to read message bundle in a job (Grails 2.0, Quartz-0.4.2):

class Job1Job {
 def timeout = 5000l // execute job once in 5 seconds
 def grailsApplication

 def execute() {
   def ctx = grailsApplication.mainContext
   def bean = ctx.getBean('org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib')
   println bean.message(code:'default.home.label')
 }
}

And get error:

Error 2011-12-28 14:30:14,021 [quartzScheduler_Worker-5] ERROR listeners.ExceptionPrinterJobListener  - Exception occured in job: GRAILS_JOBS.testappcontext.Job1Job
Message: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.

The code works perfectly in controller and service. What I am doing wrong ?
I suspect this code run perfectly in grails 1.3.7

  • 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-27T23:41:55+00:00Added an answer on May 27, 2026 at 11:41 pm

    You’re going the long way around – just use what the taglib uses, the messageSource bean:

    class Job1Job {
       long timeout = 5000 // execute job once in 5 seconds
       def messageSource
    
       void execute() {
          println messageSource.getMessage('default.home.label', null, Locale.default)
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use JMS Message Selector with ActiveMQ. I read the documentation
I am trying to read from a tcp stream a message sent from client.
I get a strange error message when trying to read non-ascii from the datastore:
Im trying to read a query string from a url and alert a message
I'm trying to read data from the WMI Win32_NTLogEvent class, but I only want
I am trying to read from Python the WM_COPYDATA message some applications (I'm trying
I am trying to read a message of known length from the network stream.
I am trying to first read 4 bytes(int) specifying the size of the message
I can read the current delivery count using javax.jms.Message.getIntProperty(JMSXDeliveryCount). I'm trying to read the
Trying to read an RSS and select information using Linq but can't seem to

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.