过去几天我一直在大量测试和使用openNTF Domino API(ODA),我开始注意到生成了大量的日志文件。 (ODA版本M4.5)昨天,我发现了超过10,000个。今天有几百个。它似乎每天写一次,大约在同一时间(大约14:00到15:00)。堆栈跟踪的所有打印输出都是相同的。以下是日志的摘录:
14.10.2014 15:02:16 HTTP JVM: java.lang.StackOverflowError
14.10.2014 15:02:16 HTTP JVM: at sun.nio.cs.SingleByteEncoder.encodeArrayLoop(SingleByteEncoder.java:70)
14.10.2014 15:02:16 HTTP JVM: at sun.nio.cs.SingleByteEncoder.encodeLoop(SingleByteEncoder.java:146)
14.10.2014 15:02:16 HTTP JVM: at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:555)
14.10.2014 15:02:16 HTTP JVM: at sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:405)
14.10.2014 15:02:16 HTTP JVM: at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:159)
14.10.2014 15:02:16 HTTP JVM: at java.io.OutputStreamWriter.write(OutputStreamWriter.java:229)
14.10.2014 15:02:16 HTTP JVM: at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:122)
14.10.2014 15:02:16 HTTP JVM: at java.io.PrintStream.write(PrintStream.java:500)
14.10.2014 15:02:16 HTTP JVM: at java.io.PrintStream.print(PrintStream.java:643)
14.10.2014 15:02:16 HTTP JVM: at java.io.PrintStream.println(PrintStream.java:780)
14.10.2014 15:02:16 HTTP JVM: at org.openntf.domino.logging.DefaultFileHandler.publish(DefaultFileHandler.java:134)
14.10.2014 15:02:16 HTTP JVM: at java.util.logging.Logger.log(Logger.java:1281)
14.10.2014 15:02:16 HTTP JVM: at java.util.logging.Logger.log(Logger.java:1244)
14.10.2014 15:02:16 HTTP JVM: at org.openntf.domino.utils.DominoUtils$4.run(DominoUtils.java:279)
14.10.2014 15:02:16 HTTP JVM: at java.security.AccessController.doPrivileged(AccessController.java:327)
14.10.2014 15:02:16 HTTP JVM: at org.openntf.domino.utils.DominoUtils.handleException(DominoUtils.java:273)
14.10.2014 15:02:16 HTTP JVM: at org.openntf.domino.iterators.DocumentIterator.getCollectionIds(DocumentIterator.java:79)
14.10.2014 15:02:16 HTTP JVM: at org.openntf.domino.iterators.DocumentIterator.<init>(DocumentIterator.java:53)
14.10.2014 15:02:16 HTTP JVM: at org.openntf.domino.impl.DocumentCollection.iterator(DocumentCollection.java:747)
14.10.2014 15:02:16 HTTP JVM: at org.openntf.domino.impl.NoteCollection.add(NoteCollection.java:159)
14.10.2014 15:02:16 HTTP JVM: at org.openntf.domino.impl.DocumentCollection.toLotusNoteCollection(DocumentCollection.java:83)
14.10.2014 15:02:16 HTTP JVM: at org.openntf.domino.iterators.DocumentIterator.getCollectionIds(DocumentIterator.java:70)
14.10.2014 15:02:16 HTTP JVM: at org.openntf.domino.iterators.DocumentIterator.<init>(DocumentIterator.java:53)
14.10.2014 15:02:16 HTTP JVM: at org.openntf.domino.impl.DocumentCollection.iterator(DocumentCollection.java:747)
14.10.2014 15:02:16 HTTP JVM: at org.openntf.domino.impl.NoteCollection.add(NoteCollection.java:159)
最后一点循环循环。我无法在org.openntf * .log文件中找到相应的条目。
修改*
经过几百个文档后,我确实看到了正常循环的这种变化。无论是否相关,我都不能说:
14.10.2014 15:10:29 HTTP JVM: Error trying to format output for error handling. Resorting to standard stack trace...nullnull
14.10.2014 15:10:29 HTTP JVM: java.lang.StackOverflowErrorjava.lang.StackOverflowErrorjava.lang.StackOverflowError
14.10.2014 15:10:29 HTTP JVM: at sun.nio.cs.SingleByteEncoder.encodeArrayLoop(SingleByteEncoder.java:70)
14.10.2014 15:10:29 HTTP JVM: at sun.nio.cs.SingleByteEncoder.encodeLoop(SingleByteEncoder.java:146)
14.10.2014 15:10:29 HTTP JVM: at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:555)
14.10.2014 15:10:29 HTTP JVM: at sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:405)
14.10.2014 15:10:29 HTTP JVM: at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:159)
14.10.2014 15:10:29 HTTP JVM: at java.io.OutputStreamWriter.write(OutputStreamWriter.java:229)
14.10.2014 15:10:29 HTTP JVM: at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:122)
14.10.2014 15:10:29 HTTP JVM: at java.io.PrintStream.write(PrintStream.java:500)
14.10.2014 15:10:29 HTTP JVM: at java.io.PrintStream.print(PrintStream.java:643)
14.10.2014 15:10:29 HTTP JVM: at java.io.PrintStream.append(PrintStream.java:1039)
14.10.2014 15:10:29 HTTP JVM: at java.io.PrintStream.append(PrintStream.java:51)
14.10.2014 15:10:29 HTTP JVM: at java.lang.StackTraceElement.appendTo(StackTraceElement.java:180)
14.10.2014 15:10:29 HTTP JVM: at java.lang.Throwable.appendTo(Throwable.java:305)
14.10.2014 15:10:29 HTTP JVM: at java.lang.Throwable.printStackTrace(Throwable.java:332)
14.10.2014 15:10:29 HTTP JVM: at java.lang.Throwable.printStackTrace(Throwable.java:212)
14.10.2014 15:10:29 HTTP JVM: at java.lang.Throwable.printStackTrace(Throwable.java:163)
14.10.2014 15:10:29 HTTP JVM: at org.openntf.domino.logging.DefaultConsoleHandler.publish(DefaultConsoleHandler.java:104)
14.10.2014 15:10:29 HTTP JVM: at java.util.logging.Logger.log(Logger.java:1281)
14.10.2014 15:10:29 HTTP JVM: at java.util.logging.Logger.log(Logger.java:1244)
14.10.2014 15:10:29 HTTP JVM: at org.openntf.domino.utils.DominoUtils$4.run(DominoUtils.java:279)
14.10.2014 15:10:29 HTTP JVM: at java.security.AccessController.doPrivileged(AccessController.java:327)
14.10.2014 15:10:29 HTTP JVM: at org.openntf.domino.utils.DominoUtils.handleException(DominoUtils.java:273)
14.10.2014 15:10:29 HTTP JVM: at org.openntf.domino.iterators.DocumentIterator.getCollectionIds(DocumentIterator.java:79)
14.10.2014 15:10:29 HTTP JVM: at org.openntf.domino.iterators.DocumentIterator.<init>(DocumentIterator.java:53)
14.10.2014 15:10:29 HTTP JVM: at org.openntf.domino.impl.DocumentCollection.iterator(DocumentCollection.java:747)
14.10.2014 15:10:29 HTTP JVM: at org.openntf.domino.impl.NoteCollection.add(NoteCollection.java:159)
14.10.2014 15:10:29 HTTP JVM: at org.openntf.domino.impl.DocumentCollection.toLotusNoteCollection(DocumentCollection.java:83)
答案 0 :(得分:2)
这看起来像是在后续版本中修复的问题,我认为这与迭代器有关。
在M4.5中,如果将DocumentCollection添加到NoteCollection,它将在第159行https://github.com/OpenNTF/org.openntf.domino/blob/M4.5/org.openntf.domino/src/org/openntf/domino/impl/NoteCollection.java上调用DocumentCollection上的迭代器。
但是,DocumentCollection迭代器是通过调用getCollectionIDs来实例化的,它将DocumentCollection添加到第83行https://github.com/OpenNTF/org.openntf.domino/blob/M4.5/org.openntf.domino/src/org/openntf/domino/impl/DocumentCollection.java的新NoteCollection。
这是堆栈跟踪的原因,但在M4.5之后的Release Candidate中,这是固定的。相应的方法,从第180行开始,现在只使用核心NoteCollection.add方法https://github.com/OpenNTF/org.openntf.domino/blob/master/org.openntf.domino/src/org/openntf/domino/impl/NoteCollection.java
答案 1 :(得分:2)
是的,更新到RC2.1以解决此问题 - 使用RC2.0时遇到了同样的问题