Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] TimeoutException: Idle Ttmeout expired

Hi everybody,

Im trying to serve some large files (>700mb) using jetty as an embedded
server in an java application. Currently Im receiving the following
TimeoutException:

java.util.concurrent.TimeoutException: Idle timeout expired:
30000/30000 ms
	at
org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:166)
	at org.eclipse.jetty.io.IdleTimeout$1.run(IdleTimeout.java:50)
	at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.ac
cess$201(ScheduledThreadPoolExecutor.java:180)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.ru
n(ScheduledThreadPoolExecutor.java:293)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.ja
va:1142)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.j
ava:617)
	at java.lang.Thread.run(Thread.java:745)

(sorry for the bad formatting)

This is the code where the exception is thrown:
response.setContentLengthLong(/*length of large file*/);
OutputStream stream = response.getOutputStream();
InputStream inStream = new FileInputStream(/*large file*/);
byte[] buffer = new byte[4096];
int read;
while((read = inStream.read(buffer)) > 0) {
	stream.write(buffer, 0, read); // exception happens here
}
inStream.close();
stream.flush();
stream.close();

Interestingly though this exceptions is not thrown at all requests. E.g
if Im trying to get the file with curl everything works without any
exception. I would be glad for any hints what the reason behind this
exception could be.

Thanks in Advance,

Mark Strempel


Back to the top