0

我刚遇到它,完全惊呆了:

[#|2012-12-10T14:16:49.663+0100|WARNING|glassfish3.1.1|javax.enterprise.system.core.transaction.com.sun.jts.jtsxa|_ThreadID=165;_ThreadName=Thread-2;|JTS5068: Unexpected error occurred in rollback
org.neo4j.kernel.impl.nioneo.store.UnderlyingStorageException: Unable to write defragged id  batch
        at org.neo4j.kernel.impl.nioneo.store.IdGeneratorImpl.writeIdBatch(IdGeneratorImpl.java:554)
        at org.neo4j.kernel.impl.nioneo.store.IdGeneratorImpl.freeId(IdGeneratorImpl.java:295)
        at org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.freeId(CommonAbstractStore.java:404)
        at org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.doRollback(WriteTransaction.java:309)
        at org.neo4j.kernel.impl.transaction.xaframework.XaTransaction.rollback(XaTransaction.java:278)
        at org.neo4j.kernel.impl.transaction.xaframework.XaResourceManager.rollback(XaResourceManager.java:488)
        at org.neo4j.kernel.impl.transaction.xaframework.XaResourceHelpImpl.rollback(XaResourceHelpImpl.java:111)
        at com.sun.jts.jta.TransactionState.rollback(TransactionState.java:193)
        at com.sun.jts.jtsxa.OTSResourceImpl.rollback(OTSResourceImpl.java:333)
        at com.sun.jts.CosTransactions.RegisteredResources.distributeRollback(RegisteredResources.java:1038)
        at com.sun.jts.CosTransactions.TopCoordinator.rollback(TopCoordinator.java:2290)
        at com.sun.jts.CosTransactions.CoordinatorTerm.commit(CoordinatorTerm.java:420)
        at com.sun.jts.CosTransactions.TerminatorImpl.commit(TerminatorImpl.java:250)
        at com.sun.jts.CosTransactions.CurrentImpl.commit(CurrentImpl.java:623)
        at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:323)
        at com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate.commitDistributedTransaction(JavaEETransactionManagerJTSDelegate.java:186)
        at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.commit(JavaEETransactionManagerSimplified.java:858)
        at com.sun.enterprise.transaction.UserTransactionImpl.commit(UserTransactionImpl.java:208)
............
Caused by: java.nio.channels.ClosedByInterruptException
        at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
        at sun.nio.ch.FileChannelImpl.size(FileChannelImpl.java:299)
        at org.neo4j.kernel.impl.nioneo.store.IdGeneratorImpl.writeIdBatch(IdGeneratorImpl.java:530)
        ... 104 more

我能做什么,我怎样才能从那个异常中恢复?

我必须说 neo4j 在 Glassfish 应用服务器中使用 neo4j jca 连接器运行。

所以。我能做些什么 ?

4

2 回答 2

1

java.nio.* 中的东西对中断非常敏感,这意味着一旦被中断的线程访问 FileChannel,它就会关闭。Neo4j 使用 FileChannel,这个问题很可能是由于您的环境以一种或另一种方式中断线程造成的。

于 2012-12-11T20:24:21.697 回答
0

问题实际上与 neo4j 无关,而是 Glassfish 默认为 EAR 提供有限的部署时间这一事实(不是直接,而是通过用于将命令发送到域的 HTTP 通道)。

以神秘的日志语句的形式给出了暗示:

[#|2012-12-10T11:41:49.725+0100|警告|glassfish3.1.1|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=29;_ThreadName=Thread-2;|GRIZZLY0023:中断空闲线程:admin-线程池 4848(9).|#]

一个快速的谷歌搜索告诉我我的 EAR 部署到底发生了什么:“应用程序无法在 ubuntu 上启动,但在 windows 上启动时没有任何问题”。结果,我遵循了 java.net 的建议并设置了给定的标志

asadmin set server-config.network-config.protocols.protocol.http-listener-1.http.request-timeout-seconds=-1

错误现已消失。

于 2013-01-07T16:54:20.147 回答