日期:2014-05-19  浏览次数:20954 次

java.io.IOException: 句柄无效 异常是什么引起的
写了一个三大框架集成的项目,项目能正常运行,但重新部署时会抛异常:
log4j:ERROR Failed to flush writer,
java.io.IOException: 句柄无效。
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(Unknown Source)
at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(Unknown Source)
at sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(Unknown Source)
at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(Unknown Source)
at sun.nio.cs.StreamEncoder.flush(Unknown Source)
at java.io.OutputStreamWriter.flush(Unknown Source)
at org.apache.log4j.helpers.QuietWriter.flush(QuietWriter.java:57)
at org.apache.log4j.WriterAppender.writeFooter(WriterAppender.java:352)
at org.apache.log4j.WriterAppender.close(WriterAppender.java:203)
at org.apache.log4j.AppenderSkeleton.finalize(AppenderSkeleton.java:124)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Unknown Source)
at java.lang.ref.Finalizer.access$100(Unknown Source)
at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

请问这是什么原因引起的

------解决方案--------------------
楼主检查一下 看是不是你的环境有问题