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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:13:16+00:00 2026-05-21T11:13:16+00:00

I have a void method which is part of a flow run by quartz

  • 0

I have a void method which is part of a flow run by quartz scheduler task.

The content of this method is this code:

try {
        InputStream ris = this.getClass().getResourceAsStream("arialuni.ttf");
        byte[] ttfAfm = new byte[1];
        if (ris != null) {
            System.out.println("toByteArray START");
            ttfAfm = IOUtils.toByteArray(ris);
            System.out.println("toByteArray END");
        } else
            System.out.println("input stream from arailuni.ttf is null!!!");
        ris.close();
        ris = null;
        bfChinese =
                BaseFont.createFont("arialuni.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, true, ttfAfm, null);
        System.out.println("in myinit() try catch END");
    } catch (Exception e) {
        System.out.println("exception encountered at myinit() " + e);
    }

It’s very strange that this works nice about 30 times (basically, the scheduler scans a directory, take any PCL found and converts it to PDF using this arialuni.ttf font) but suddenly it gives the follwing exception:

19:06:24,316 INFO  [STDOUT] toByteArray START
19:06:28,218 ERROR [ReportPollingJob] java.lang.reflect.InvocationTargetExceptio
n
//nothing else here (yes, the exception is only one line...)

at IOUtils.toByteArray(ris)

Can it be because of memory?
It’s very strange that it does not go to my catch but just throws this exception…

Can you give a hint?

UPDATE: Thanks to mdma: I’ve changed to catch(Throwable e) and now I see:

java.lang.OutOfMemory: JavaHeap Space

which will not be easy to solve…

  • 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-21T11:13:17+00:00Added an answer on May 21, 2026 at 11:13 am

    The InvocationTargetException is just a wrapper for the real exception, so you should analyze that (via getCause()). It is probably an OutOfMemoryError, which does not subclass Exception. To catch every error condition, catch Throwable instead.

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

Sidebar

Related Questions

I have method (which is part of IMyInteface) like this: interface IMyInterface { void
I have a method which takes params object[] such as: void Foo(params object[] items)
I have an interface method public void Execute(ICommand command); which needs to pass known
I have this method: private delegate void watcherReader(StreamReader sr); private void watchProc(StreamReader sr) {
I have an Obj-C method similar to this: -(void)getUserDefaults:(BOOL *)refreshDefaults { PostAppDelegate *appDelegate =
I have a C++ method signature that looks like this: static extern void ImageProcessing(
I have a method and a thread which I'd like to run in the
I have the following C++ method : __declspec(dllexport) void __stdcall getDoubles(int *count, double **values);
If I have a method such as: public void MyMethod(int arg1, string arg2) How
If I have a method such as: private function testMethod(param:string):void { // Get the

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.