Wildfly 18 - java.nio.channels.ClosedChannelException

515 views
Skip to first unread message

Kauan Mocelin

unread,
Apr 27, 2023, 10:18:25 AM4/27/23
to WildFly
Hello, logs of my wildfly 18 server has too many "java.nio.channels.ClosedChannelException" exception, this occurs in a point that pdfs are merged using iText tool, I think there is a timeout that is closing channel.

After a long search I think it's something related to read-timeout/write-timeout configs on undertow module.

Someone can help me? Thanks!

Bartosz Baranowski

unread,
May 8, 2023, 4:05:59 AM5/8/23
to WildFly
Actually depends on your set up, but most likely yeah. Check https://docs.wildfly.org/19/wildscribe/subsystem/undertow/server/http-listener/index.html

Kauan Mocelin

unread,
Oct 25, 2023, 10:16:53 PM10/25/23
to WildFly
I changed parameters of http-listener: writer/read-timeout and the error cotinue to occurs.

I logged all times on the method that throw this exception and even for executions that last a few miliseconds the error is throw.

It seems to me that is have nothing with iText and maybe a undertow bug.

Any type kind of advice to help me to found the source of this error are welcome.

Kauan Mocelin

unread,
Oct 25, 2023, 10:18:58 PM10/25/23
to WildFly
2023-10-11 09:24:03,658 ERROR [br.gov.pr.companyname.myprojectname.util.Util] (default task-17) java.nio.channels.ClosedChannelException at io.under...@2.0.27.Final//io.undertow.channels.DetachableStreamSinkChannel.write(DetachableStreamSinkChannel.java:177) at io.under...@2.0.27.Final//io.undertow.server.HttpServerExchange$WriteDispatchChannel.write(HttpServerExchange.java:2070) at org.jbo...@3.7.3.Final//org.xnio.channels.Channels.writeBlocking(Channels.java:152) at io.undert...@2.0.27.Final//io.undertow.servlet.spec.ServletOutputStreamImpl.writeTooLargeForBuffer(ServletOutputStreamImpl.java:198) at io.undert...@2.0.27.Final//io.undertow.servlet.spec.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:146) at java.base/java.io.BufferedOutputStream.write(BufferedOutputStream.java:123) at java.base/java.io.FilterOutputStream.write(FilterOutputStream.java:108) at deployment.myprojectname.war//com.itextpdf.text.pdf.OutputStreamCounter.write(OutputStreamCounter.java:104) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfString.toPdf(PdfString.java:155) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfDictionary.toPdf(PdfDictionary.java:154) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfIndirectObject.writeTo(PdfIndirectObject.java:157) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfWriter$PdfBody.write(PdfWriter.java:402) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfWriter$PdfBody.add(PdfWriter.java:380) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfWriter$PdfBody.add(PdfWriter.java:355) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfWriter$PdfBody.add(PdfWriter.java:351) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfWriter.addToBody(PdfWriter.java:825) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfCopy.addToBody(PdfCopy.java:856) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfCopy.addToBody(PdfCopy.java:838) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfSmartCopy.copyIndirect(PdfSmartCopy.java:154) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfCopy.copyObject(PdfCopy.java:594) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfCopy.copyDictionary(PdfCopy.java:520) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfCopy.copyObject(PdfCopy.java:590) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfCopy.copyObject(PdfCopy.java:626) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfSmartCopy.copyIndirect(PdfSmartCopy.java:153) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfCopy.copyObject(PdfCopy.java:594) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfCopy.copyArray(PdfCopy.java:567) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfCopy.copyObject(PdfCopy.java:598) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfCopy.copyDictionary(PdfCopy.java:510) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfCopy.copyDictionary(PdfCopy.java:536) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfCopy.addPage(PdfCopy.java:680) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfSmartCopy.addPage(PdfSmartCopy.java:168) at deployment.myprojectname.war//com.itextpdf.text.pdf.PdfCopy.addDocument(PdfCopy.java:831)
Reply all
Reply to author
Forward
0 new messages