2012-12-11 98 views
0

我正好遇到它,我完全flabergasted:當neo4j發送UnderlyingStorageException異常時,我該怎麼辦?

[#|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連接器運行。

所以。我能做什麼 ?

+0

您可能正在使用多個線程嘗試寫入已被其他線程刪除的部分。你的代碼在發生這種情況之前究竟做了什麼? – ulkas

+0

@ulkas這段代碼運行在Singleton啓動EJB中,用於遷移圖中的一堆數據。它應該是當時唯一運行的EJB。 – Riduidel

回答

0

問題實際上與neo4j不相關,而是由於Glassfish默認給EAR部署的時間有限(不是直接的,而是通過用於將命令發送到域的HTTP通道)。

的是一個提示被賦予了那個神祕的日誌報表的方式:

[#| 2012-12-10T11:41:49.725 + 0100 |警告| glassfish3.1.1 |的com.sun。 grizzly.config.GrizzlyServiceListener | _ThreadID = 29; _ThreadName =線程2; | GRIZZLY0023:中斷空閒線程:管理線程池,4848(9)|#]

快速谷歌搜索告訴我到底是什麼。發生在我的EAR部署中:「application cannot start on ubuntu but starts on windows without any trouble」。因此,我遵循java.net的建議,並設置給定的標誌

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

錯誤現在已經消失。

1

java.nio。*中的內容對中斷非常敏感,這意味着一旦被中斷的線程訪問它,FileChannel就會關閉。 Neo4j使用FileChannel,這個問題很可能是由於你的環境以某種方式中斷了線程。

相關問題