我正在编写一个适配器以在 Apache Aries 远程服务管理中使用编年史队列。当我只使用一个线程时它工作正常。使用多个线程时,我会遇到如下异常。
知道我做错了什么吗?
如果您增加执行程序中的线程数,您可以看到异常。
Exception in thread "pool-3-thread-2" java.nio.BufferOverflowException
at net.openhft.chronicle.bytes.AbstractBytes.writePosition(AbstractBytes.java:182)
at net.openhft.chronicle.bytes.AbstractBytes.writePosition(AbstractBytes.java:29)
at net.openhft.chronicle.wire.AbstractWire.writeHeader0(AbstractWire.java:183)
at net.openhft.chronicle.wire.AbstractWire.writeHeader(AbstractWire.java:171)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreAppender.append(SingleChronicleQueueExcerpts.java:252)
at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts$StoreAppender.writeBytes(SingleChronicleQueueExcerpts.java:153)
at org.apache.aries.rsa.provider.chronicle.ChronicleInvocationHandler.invoke(ChronicleInvocationHandler.java:45)
at com.sun.proxy.$Proxy7.callOneWay(Unknown Source)
at org.apache.aries.rsa.provider.chronicle.ChronicleProviderTest$1.run(ChronicleProviderTest.java:87)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)