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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:59:18+00:00 2026-05-14T22:59:18+00:00

I wonder how to configure Quartz scheduled job threads to reflect proper encoding. Code

  • 0

I wonder how to configure Quartz scheduled job threads to reflect proper encoding. Code which otherwise executes fine within Springframework injection loaded webapps (java) will get encoding issues when run in threads scheduled by quartz.

Is there anyone who can help me out? All source is compiled using maven2 with source and file encodings configured as UTF-8.

In the quartz threads any string will have encoding errors if outside ISO 8859-1 characters:

Example config

  <bean name="jobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
    <property name="jobClass" value="example.ExampleJob" />
  </bean>

  <bean id="jobTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
    <property name="jobDetail" ref="jobDetail" />
    <property name="startDelay" value="1000" />
    <property name="repeatCount" value="0" />
    <property name="repeatInterval" value="1" />
  </bean>

  <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
    <property name="triggers">
      <list>
        <ref bean="jobTrigger"/>
      </list>
    </property>
  </bean>

Example implementation

public class ExampleJob extends QuartzJobBean {

    private Log log = LogFactory.getLog(ExampleJob.class);

    protected void executeInternal(JobExecutionContext ctx) throws JobExecutionException {
        log.info("ÅÄÖ");
        log.info(Charset.defaultCharset());
    }
}

Example output

2010-05-20 17:04:38,285  1342 INFO  [QuartzScheduler_Worker-9] ExampleJob - ÅÄÖ
2010-05-20 17:04:38,286  1343 INFO  [QuartzScheduler_Worker-9] ExampleJob - UTF-8

The same lines of code executed within spring injected beans referenced by servlets in the web-container will output proper encoding.

What is it that make Quartz threads encoding dependent?

  • 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-14T22:59:19+00:00Added an answer on May 14, 2026 at 10:59 pm

    I haven’t seen the √Ö√Ñ√ñ pattern before. This doesn’t fit in the usual malform patterns using any of the ISO-8859 charsets I am aware of. Since you were talking about Mac OS Roman in one of your comments, I investigated its codepage and came to the conclusion that this encoding is been used incorrectly somewhere.

    The string ÅÄÖ is composed of the following UTF-8 bytes:

    String s = "ÅÄÖ";
    for (byte b : s.getBytes("UTF-8")) {
        System.out.printf("0x%X ", b); // 0xC3 0x85 0xC3 0x84 0xC3 0x96 
    }
    

    The codepage learns me that 0xC3 indeed stands for √ and that 0x85, 0x84 and 0x96 stands for Ö, Ñ and ñ respectively in the Mac OS Roman encoding.

    Since you told that it works fine when used in servlets and that both uses the same logging appender, the logging output can be excluded from being suspect. I can now then think of only one cause: the file with those characters is been saved using the Mac OS Roman encoding instead of UTF-8. It’s unclear which editor you’re using on Mac, but both Notepad and Eclipse would have displayed a warning message about that and reopening the file in the editor should have shown the same malformed characters.

    Which editor are you using? Is it explicitly configured to save files using UTF-8 encoding?


    Update: since that doesn’t seem to be the cause of the problem, let’s go back to the fact that it works fine when using servlets. How exactly did you test it? Didn’t you accidently enter those characters using Mac OS Roman encoding so that it would end up correctly when the logger is after all probably configured to use Mac OS Roman? Where does the logger log to? The command console or a logfile? How are they encoded? What does encoding detectors tell about the file encoding? (sorry, I don’t do Mac, but Editplus/Notepad++ in windows for example can detect/autoguess file encoding and tell about it).

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

Sidebar

Related Questions

I wonder in the installation process of configure , make , make check and
I wonder if anyone has managed to create a working code for sending out
Wonder what the difference between: static PROCESSWALK pProcess32First=(PROCESSWALK)GetProcAddress(hKernel,Process32First); ... pProcess32First(...); what is hKernel? Look
I wonder if someone knows if there is a pre-made solution for this: I
I wonder how you guys manage deployment of a database between 2 SQL Servers,
I wonder if anyone uses commercial/free java obfuscators on his own commercial product. I
I wonder why would a C++, C#, Java developer want to learn a dynamic
I wonder how long it would usually take for: Professional Average Beginner to setup
I wonder if They can work perfectly together...
I wonder if this would be doable ? To insert an array into one

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.