I am getting this exception on my tomcat server (+liferay)
java.util.concurrent.RejectedExecutionException
my class is like that :
public class SingleExecutor extends ThreadPoolExecutor {
public SingleExecutor(){
super(1, 1,0L, TimeUnit.MILLISECONDS,new LinkedBlockingQueue<Runnable>());
}
@Override
public void execute(Runnable command) {
if(command instanceof AccessLogInsert){
AccessLogInsert ali = (AccessLogInsert)command;
ali.setConn(conn);
ali.setPs(ps);
}
super.execute(command);
}
}
I get this exception on the line super.execute(command);
This error can occur when the queue is full but the LinkedBlockingQueue
size is 2^31, and I am sure that there is no so many command waiting.
At start everything is stable, but after I redeploy a war it starts occuring. This class is not part of the war but in a jar in tomcat/lib.
Do you have any idea why this happend and how to fix it ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…