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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:42:29+00:00 2026-06-04T02:42:29+00:00

How can this be? Looks like plain as daylight an exception from a third

  • 0

How can this be? Looks like plain as daylight an exception from a third party library is skipping my catch block. Not sure where to begin troubleshooting this. It’s either me being really stupid, or me not understanding something subtle about exceptions and Java.

My console:

Exception: org.apache.james.mime4j.io.MaxLineLimitException: Maximum line length limit exceeded; stack: org.apache.james.mime4j.stream.MimeEntity.readRawField(MimeEntity.java:242);
org.apache.james.mime4j.stream.MimeEntity.nextField(MimeEntity.java:258);
org.apache.james.mime4j.stream.MimeEntity.advance(MimeEntity.java:296);
org.apache.james.mime4j.stream.MimeTokenStream.next(MimeTokenStream.java:360);
me.unroll.scanner.Scanner.<init>(Scanner.java:206);
me.unroll.scanner.ScannerThread.run(ScannerThread.java:205);
java.lang.Thread.run(Thread.java:722)

Problem is my code looks like this:

try {  
//...
 for(EntityState token = messageStream.getState();
    token != EntityState.T_END_OF_STREAM;
    token = messageStream.next()) {  //this is Scanner.java:206
//...
catch(ScanComplete exc) { }
catch(MaxLineLimitException exc) { //line 282, matches "try" above
    debug("Am I getting caught?"); //no, it's not

I’m more

  • 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-06-04T02:42:31+00:00Added an answer on June 4, 2026 at 2:42 am

    You’re attempting to catch the wrong exception type.

    The signature for MimeTokenStream.next() says it can throw MimeException, which you are not catching. (BTW if you are wondering why an exception isn’t being caught, you can try catching Exception and logging the exception type to see what is actually being thrown.)

    Now, if you look at the source code for the actual source of the exception, line 242 of MimeEntity.readRawField, you’ll see:

    241        } catch (MaxLineLimitException e) {
    242            throw new MimeException(e);
    243        }
    

    So even though the console message says MaxLineLimitException, the actual exception being thrown by that method is a MimeException. Try catching MimeException in your code instead of MaxLineLimitException, but beware that MimeTokenStream.next() can probably throw MimeException for other reasons besides the one you’ve encountered.

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

Sidebar

Related Questions

Currently my tableview looks like this: as you can see, cell.textLabel and cell.detailTextLable both
I have something that looks like this: As you can see, Blambo is a
In android the Toggle buttons are looks like below - Can we modify this
This is what I have. It looks like MS's example adn I can't figure
I have a plain text file that looks like this - 234234 some text
I have an array that looks like this: PHP Syntax (Toggle Plain Text) array
I have a loop that can look like this: For Each article In artAll
I need to sort an array that can look like this: $array[4][0] = array('id'
Can a jQuery UI Slider be made to look like this? If so how?
I have an ordered array which looks like this:- [-0.0020057306590257895, 50, 0.09598853868194843, 50, 0.19398280802292264,

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.