Forum Replies Created
-
AuthorPosts
-
in reply to: Java 6.0_24b07 crashes while in finalize of PD4Device March 18, 2011 at 07:34#28441
The only picture we have inside the toc is the one I attached to this posting.
But I think that the picture is not the problem because we get the pdf document without error.
And my analysis showed that between the the download of the pdf and the crash were roundabout 50 minutes. So I think that the problem lies in the fact that the PD4Device with its related java resources were kept for that time frame, but the related native resources (profile data) were gone.
I would suggest to dispose the second PD4Device too.
Kindly
Lutzin reply to: Java 6.0_24b07 crashes while in finalize of PD4Device March 17, 2011 at 15:27#28439What can we do to get rid of this? Can you please create a patch?
Kindly
Lutzin reply to: Java 6.0_24b07 crashes while in finalize of PD4Device March 17, 2011 at 12:24#28437I think, not the output stream is the problem but the instance of class “c” , which is actually a PrintWriter.
see:
j org.zefer.pd4ml.pdf.c.close()V+12
j org.zefer.pd4ml.pdf.PD4Device.dispose()V+23
If you have a look onto the stacktrace:
The finalyzer thread calls the finalyze/dispose method. Why will the c.close() method be called at all. The reference to the pdfWriter instance is or should at least be null, because the dispose method must have been called at the end of the render method of the PD4ML class.
Could it be that there are more than one instance of PD4Device in use?
Kindly
Lutzin reply to: Java 6.0_24b07 crashes while in finalize of PD4Device March 17, 2011 at 08:44#28435Beacause we get repeatedly the same problem with the same stacktrace.
At the end of the render method of the PD4ML class the dispose method of the PD4Device class will be called.
This method calls the close method on the PD4Device member of type “c” and sets the “c” reference to null.
So if the dispose method gets called twice calling finalize on PD4Device, the c.close method should not be called again , should it?
So why will the c.close method be called during finalyze?
Any idea?
Kindly
Lutzin reply to: SocketException: Socket closed on PD4Device.finalize February 10, 2011 at 07:52#28384Some analysis shoes, that the class PD4ML calls the PD4Device method “dispose()” after completing the current rendering.
This method will close the the output stream member within the PD4Device instance, but does not set it to null.
The PD4Device class has a finalize method too. Now, the gc is collecting and calls the finalize method and tries to close the output stream again.
Maybe that´s the problem causing the the raised exception.
How can we get rid of this?
Any idea?@Lutz.Strobel wrote:
Hi Gurus, we use PD4ML within a Servlet to generate PDF from JSPs. Intermittent we get the exception you can see below.
The code we use to generate the output is as follows:ServletOutputStream os = res.getOutputStream(); pd4ml.render(new URL(urlString), os); os.flush(); os.close();
Does anybody have an idea what the reason for this error?
Greetings from LutzWARNUNG: Unable to send headers java.net.SocketException: Socket closed at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at org.apache.jk.common.ChannelSocket.send(ChannelSocket.java:531) at org.apache.jk.common.JkInputStream.appendHead(JkInputStream.java:313) at org.apache.jk.core.MsgContext.action(MsgContext.java:266) at org.apache.coyote.Response.action(Response.java:183) at org.apache.coyote.Response.sendHeaders(Response.java:379) at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:305) at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:273) at org.apache.catalina.connector.CoyoteOutputStream.close(CoyoteOutputStream.java:104) at org.zefer.pd4ml.pdf.PD4Device.dispose(Unknown Source) at org.zefer.pd4ml.pdf.PD4Device.finalize(Unknown Source) at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method) at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83) at java.lang.ref.Finalizer.access$100(Finalizer.java:14) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
-
AuthorPosts
