Hello,
 
I have a simple program which makes use of PdfCopy to copy contents of
more than one pdf into another merged pdf. 
However, the production application is suffering from some crashes, we
are currently using JBOSS 4.0.4 as our application server.
The problem statement is as follows:- 
 
While the pdf operations are going on and when the user clicks on the
back button of the browser and clicks on the functionality again(that
goes on to start performing the pdf operations) - the server crashes
with the following crash log, we found that for copy operations,
java.nio is used for file reading etc by itext. Can anyone provide
insights to the problem.
 
The crash log:-
 
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 10 occurred at PC=0xE1E63FD4
Function=Java_java_nio_MappedByteBuffer_load0+0x80
Library=/usr/j2sdk1.4.2_03/jre/lib/sparc/libnio.so
 
Current Java thread:
 at java.nio.MappedByteBuffer.load0(Native Method)
 at java.nio.MappedByteBuffer.load(MappedByteBuffer.java:114)
 at com.lowagie.text.pdf.MappedRandomAccessFile.init(Unknown Source)
 at com.lowagie.text.pdf.MappedRandomAccessFile.<init>(Unknown Source)
 at com.lowagie.text.pdf.RandomAccessFileOrArray.reOpen(Unknown Source)
 at com.lowagie.text.pdf.PdfReader.getStreamBytesRaw(Unknown Source)
 at com.lowagie.text.pdf.PRStream.toPdf(Unknown Source)
 at com.lowagie.text.pdf.PdfIndirectObject.writeTo(Unknown Source)
 at com.lowagie.text.pdf.PdfWriter$PdfBody.add(Unknown Source)
 at com.lowagie.text.pdf.PdfWriter$PdfBody.add(Unknown Source)
 at com.lowagie.text.pdf.PdfWriter$PdfBody.add(Unknown Source)
 at com.lowagie.text.pdf.PdfWriter.addToBody(Unknown Source)
 at com.lowagie.text.pdf.PdfCopy.copyIndirect(Unknown Source)
 at com.lowagie.text.pdf.PdfCopy.copyObject(Unknown Source)
 at com.lowagie.text.pdf.PdfCopy.copyDictionary(Unknown Source)
.
.
.
 at com.lowagie.text.pdf.PdfCopy.copyObject(Unknown Source)
 at com.lowagie.text.pdf.PdfCopy.copyDictionary(Unknown Source)
 at com.lowagie.text.pdf.PdfCopy.addPage(Unknown Source)
 at
com.pindartech.clipper.pdf.MergeiTextPDFs.go(MergeiTextPDFs.java:104)
 at com.pindartech.clipper.pdf.PdfControl.mergePDFs(PdfControl.java:57)
 at
com.pindartech.clipper.wf.wfactions.WFUploadFilesWFAc.execute(WFUploadFi
lesWFAc.java:152)
 at
com.pindartech.clipper.wf.sb_wfmgr.WFMgrBean.executeActionClasses(WFMgrB
ean.java:662)
 at sun.reflect.GeneratedMethodAccessor227.invoke(Unknown Source)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
 at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Stat
elessSessionContainer.java:237)
 at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(
CachedConnectionInterceptor.java:158)
 at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Statele
ssSessionInstanceInterceptor.java:169)
 at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterce
ptor.java:121)
 at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptor
CMT.java:350)
 at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
 at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.jav
a:168)
 at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
 at
org.jboss.ejb.plugins.CleanShutdownInterceptor.invoke(CleanShutdownInter
ceptor.java:278)
 at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryF
inderInterceptor.java:136)
 at
org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
 at org.jboss.ejb.Container.invoke(Container.java:954)
 at sun.reflect.GeneratedMethodAccessor105.invoke(Unknown Source)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.
java:155)
 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
 at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
 at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.jav
a:264)
 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
 at
org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalIn
voker.java:169)
 at
org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
 at
org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.j
ava:206)
 at
org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:1
92)
 at
org.jboss.proxy.ejb.RetryInterceptor.invoke(RetryInterceptor.java:176)
 at
org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.jav
a:61)
 at
org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
 at
org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionI
nterceptor.java:112)
 at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
 at $Proxy222.executeActionClasses(Unknown Source)
 at
com.pindartech.clipper.wf.WFEventHandler.handleEvent(WFEventHandler.java
:101)
 at
com.pindartech.clipper.wf.action.UpdateRejectOrFWRAction.perform(UpdateR
ejectOrFWRAction.java:235)
 at
com.pindartech.clipper.wf.action.WorkFlowAction.performAction(WorkFlowAc
tion.java:44)
 at
com.pindartech.clipper.common.ClipperAction.execute(ClipperAction.java:4
5)
 at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.java:421)
 at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
226)
 at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
 at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:252)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
 at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilte
r.java:96)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:202)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:213)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:178)
 at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAs
sociationValve.java:175)
 at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.j
ava:74)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:126)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:105)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:107)
 at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
48)
 at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:86
9)
 at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc
essConnection(Http11BaseProtocol.java:664)
 at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
.java:527)
 at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorker
Thread.java:112)
 at java.lang.Thread.run(Thread.java:534)
 
Dynamic libraries:
0x10000  /usr/j2sdk1.4.2_03/bin/java
0xff360000  /usr/lib/libthread.so.1
0xff39a000  /usr/lib/libdl.so.1
0xff280000  /usr/lib/libc.so.1
0xff390000  /usr/platform/SUNW,Sun-Fire-V240/lib/libc_psr.so.1
0xfec00000  /usr/j2sdk1.4.2_03/jre/lib/sparc/client/libjvm.so
0xff240000  /usr/lib/libCrun.so.1
0xff210000  /usr/lib/libsocket.so.1
0xff100000  /usr/lib/libnsl.so.1
0xff1c0000  /usr/lib/libm.so.1
0xff0e0000  /usr/lib/libsched.so.1
0xff0c0000  /usr/lib/libmp.so.2
0xff060000  /usr/j2sdk1.4.2_03/jre/lib/sparc/native_threads/libhpi.so
0xfebd0000  /usr/j2sdk1.4.2_03/jre/lib/sparc/libverify.so
0xfeb90000  /usr/j2sdk1.4.2_03/jre/lib/sparc/libjava.so
0xff030000  /usr/j2sdk1.4.2_03/jre/lib/sparc/libzip.so
0xfe1a0000  /usr/j2sdk1.4.2_03/jre/lib/sparc/libnet.so
0xe4620000  /usr/j2sdk1.4.2_03/jre/lib/sparc/librmi.so
0xe2240000  /usr/j2sdk1.4.2_03/jre/lib/sparc/libioser12.so
0xe1e60000  /usr/j2sdk1.4.2_03/jre/lib/sparc/libnio.so
0xe1e40000  /usr/lib/librt.so.1
0xe1e20000  /usr/lib/libaio.so.1
0xe1d60000  /usr/lib/libmd5.so.1
0xe1d40000  /usr/lib/libsendfile.so.1
 
Heap at VM Abort:
Heap
 def new generation   total 12864K, used 8647K [0xe5800000, 0xe64f0000,
0xe7470000)
  eden space 12480K,  66% used [0xe5800000, 0xe6011d80, 0xe6430000)
  from space 384K, 100% used [0xe6430000, 0xe6490000, 0xe6490000)
  to   space 384K,   0% used [0xe6490000, 0xe6490000, 0xe64f0000)
 tenured generation   total 103472K, used 66645K [0xe7470000,
0xed97c000, 0xf5800000)
   the space 103472K,  64% used [0xe7470000, 0xeb5855e0, 0xeb585600,
0xed97c000)
 compacting perm gen  total 38144K, used 38042K [0xf5800000, 0xf7d40000,
0xf9800000)
   the space 38144K,  99% used [0xf5800000, 0xf7d26a18, 0xf7d26c00,
0xf7d40000)
 
Local Time = Sun Nov  4 17:55:08 2007
Elapsed Time = 3165
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode)
#

 
The piece of code where crash is initiated is as follows:-
 
page = copy.getImportedPage(reader, pageno); 
copy.addPage(page); ---> crash occurs here always, copy is the object of
PdfCopy, reader is PdfReader

When the user clicks on the back button and clicks on the functionality
again, the first thread stops abruptly and crashes the server as well,
its not the second thread that is initiated by the users second click
that crashes the server. It should be noticed here that even if the
second thread has not yet begun the pdf operations, the first thread
crashes the server, any clues?
 
Regards,
Taj
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to