Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)
Caused by: java.io.IOException: Stream closed at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:134) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:235) at ........ |
这个异常发生在从某一个input stream流读取信息的时候发生的。在我们目前的系统中出现这个异常是比较不正常,特别是这个异常并不是很容易重现。我和本地的QA都没有重现出来。
虽然不能重现bug,但是凭借经验来说,这个异常是发生在这样一种场景之下:多个线程索引同一个input stream,当某一个thread在执行完之后,把这个inputstream关闭了;而此时正在从这个input stream流中读取信息的线程就会抛出 java.io.IOException: Stream closed 异常。
我写了一小段测试程序,模拟这个场景,如下:
public static void main(String[] args) ...{
File f = new File("c:/test/StoreTest-1.xml");
java.io.BufferedReader br = null;
try ...{
br = new java.io.BufferedReader(new java.io.FileReader(f));
} catch (FileNotFoundException e) ...{}
final java.io.BufferedReader br1 = br;
final java.io.BufferedReader br2 = br;
Thread t = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br1.readLine()) != null;) ...{
System.out.println("Process stdout: " );
try ...{
Thread.sleep(1000);
} catch (InterruptedException e) ...{}
}
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
Thread t2 = new Thread() ...{
public void run() ...{
try ...{
for (String line = null; (line = br2.readLine()) != null;) ...{}
System.out.println("Process stdout2: ");
br2.close();
} catch (IOException ioe) ...{
ioe.printStackTrace();
}
}
};
t.start();
t2.start();
}
}
当执行这段程序之后,会看到如下输出:
Process stdout:
Process stdout2:
java.io.IOException: Stream closed
at java.io.BufferedReader.ensureOpen(BufferedReader.java:97)
at java.io.BufferedReader.readLine(BufferedReader.java:293)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at test.common.util.IOTest$1.run(IOTest.java:38)