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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:51:49+00:00 2026-05-24T03:51:49+00:00

A JavaEE application must process a large number of PDF documents. The kind of

  • 0

A JavaEE application must process a large number of PDF documents.
The kind of processing is not important but for the sake of clarity we can say that it includes extracting text, converting pages into images, stamping IDs on the first page, printing, saving them to DB.

Incoming PDFs come from a huge variety of suppliers so there is very little control over them (if any).

All operations take place in the background, i.e. there are timers polling inbound channels, retrieving the documents and sending them to processing. No user interaction.

Two top-level java libraries are used to manage PDFs. Due to the PDF specification extension and the extreme spread among PDF generating tools, they can’t possibly cover every possibile flaw, so sometimes they fail to manipulate or even open a document.

Quite unfortunately, they sometimes fail without raising an exception but blocking in an infinite sub-method. This is critical because the polling timer blocks, no more documents are processed, administrators realize that something is wrong too late and -what’s worse- the whole application server must be restarted, which is not easy/fair in a production environment.

So how could the EJB that drives the library understand that the call is blocked and stop the transaction ?

I could start a dedicated thread (without breaking the JavaEE specification) and set a wait with a timeout. The wait ends when either a flag is checked or the timeout is reached. In the latter case the thread is considered blocked, the PDF can be marked as invalid and, for instance, an email alert can be sent.

Does anyone see any alternative -and feasible- solutions ?

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-24T03:51:50+00:00Added an answer on May 24, 2026 at 3:51 am

    I’m not sure I fully get what you have described, but IMHO you can either use MDB’s for asynchronous processing (instead of creating separate threads) or run the EJB methods in a transactional context and set the transaction timeout for the method which does the job you described. If the transaction times out you will get an exception you wanted.

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

Sidebar

Related Questions

I have a JavaEE 1.4 web application running on WebSphere Application Server 6.0. In
I am planning an application that must provide services that are very much like
I have a Java EE web application that does not make use of EJBs.
I've got a somewhat dated Java EE application running on Sun Application Server 8.1
I'd like to generate sequence diagrams of a running java ee application using jtracert
Can anyone recommend a good binary XML format? It's for a JavaME application, so
I have a Java EE 6 Wicket application deployed with maven using IntelliJ IDEA
I'm doing a Java EE application, and I'm at a point where I've concluded
Timer Tasks in Java EE are not very comfortable. Is there any util, to
I am writing an application in Django, which uses [year]/[month]/[title-text] in the url 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.