Jump to content
We've recently updated our Privacy Statement, available here ×

JVM hangs when printing to PDF w/ images


Recommended Posts

By: Louis W. Lembcke - llembcke

JVM hangs when printing to PDF w/ images

2002-09-06 22:28

Greetings,

 

First, I'm new to JasperReports so please pardon the question if its too basic.

 

I'm including a small GIF logo on a simple report and printing to PDF. When I include the image, the PDF file is created correctly and closed properly but the JVM never terminates. However, if I comment-out the image in the report definition XML file and re-fill/print the report, the PDF is generated properly again (sans the image) and the JVM terminates normally.

 

I've tried using different GIF and JPG images - even the ones included in the demo code - but that didn't help.

 

The thread dump from when the JVM hangs is...

Full thread dump:

 

"Thread-1" prio=5 tid=0x233950 nid=0x600 waiting on monitor [0..0x6fb30]

 

"AWT-Windows" prio=7 tid=0x8d84d98 nid=0x774 runnable [0x923f000..0x923fdbc]

at sun.awt.windows.WToolkit.eventLoop(Native Method)

at sun.awt.windows.WToolkit.run(WToolkit.java:188)

at java.lang.Thread.run(Thread.java:484)

 

"SunToolkit.PostEventQueue-0" prio=7 tid=0x8b5fd38 nid=0x68c waiting on monitor [0x91ff000..0x91ffdbc]

at java.lang.Object.wait(Native Method)

at java.lang.Object.wait(Object.java:420)

at sun.awt.PostEventQueue.run(SunToolkit.java:491)

 

"AWT-EventQueue-0" prio=7 tid=0x8a5d3e8 nid=0x1c0 waiting on monitor [0x91bf000..0x91bfdbc]

at java.lang.Object.wait(Native Method)

at java.lang.Object.wait(Object.java:420)

at java.awt.EventQueue.getNextEvent(EventQueue.java:260)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:106)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)

 

"Signal Dispatcher" daemon prio=10 tid=0x23fcf8 nid=0x784 waiting on monitor [0..0]

 

"Finalizer" daemon prio=9 tid=0x800f70 nid=0x7bc waiting on monitor [0x8c4f000..0x8c4fdbc]

at java.lang.Object.wait(Native Method)

at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108)

at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123)

at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162)

 

"Reference Handler" daemon prio=10 tid=0x857a00 nid=0x778 waiting on monitor [0x8c0f000..0x8c0fdbc]

at java.lang.Object.wait(Native Method)

at java.lang.Object.wait(Object.java:420)

at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110)

 

"VM Thread" prio=5 tid=0x7b16f8 nid=0x764 runnable

 

"VM Periodic Task Thread" prio=10 tid=0x803988 nid=0x7ac waiting on monitor

"Suspend Checker Thread" prio=10 tid=0x803d28 nid=0x798 runnable

 

I suspect the problem is in the threads handling the AWT event stuff - but that's only a guess.

 

I checked the docs, the discussion topics, and google but found no answer. I did a brief review of the JRImageLoader and JRPrinterPDF but didn't see anything obvious - however, AWT is not my forte (I'm a server-side guy).

 

Please, what might I be doing wrong or what should I change in the JasperReports code? Any pointers on next steps would be appreciated.

 

TIA

-Lou Lembcke

 

 

By: Louis W. Lembcke - llembcke

RE: JVM hangs when printing to PDF w/ images

2002-09-06 22:33

BTW - I'm using ...

JasperReports 0.3.3

with the bundled iText 0.81

on JRE 1.3.1_02 w/ Java HotSpot 1.3.1_02

on Windows 2k

 

 

By: Louis W. Lembcke - llembcke

RESOLVED: RE: JVM hangs when ...

2002-09-07 07:30

Greetings,

 

I found that these AWT event handling threads first start as a result of loading the image.

 

AWT is not my forte - most of my work is server-side. However, after further investigation into AWT, I've come to the conclusion that this is a normal situation. The AWT event handling threads normally hang around and, apparently, are not daemon threads. So, even though all the application threads are finished, the JVM still remains active because of the AWT threads.

 

The application terminates correctly when I use System.exit(int).

 

Thanks

-Lou Lembcke

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...