Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

CannotJoinException : not active ?

Hi, I'm encountering this error when writing an object back during PU processing.

2014-11-07 15:08:24,828 psng-epu-1.0.0.0-SNAPSHOT-complete [1] SEVERE [org.openspaces.events.notify.SimpleNotifyEventListenerContainer] - [messageArchiveUploadRequestListener ] Execution of event listener failed; Caused by: org.openspaces.core.InactiveTransactionException: not active; nested exception is net.jini.core.transaction.CannotJoinExcepti on: not active at org.openspaces.core.exception.DefaultExceptionTranslator.internalTranslate(DefaultExceptionTranslator.java:180) at org.openspaces.core.exception.DefaultExceptionTranslator.translate(DefaultExceptionTranslator.java:51) at org.openspaces.core.DefaultGigaSpace.write(DefaultGigaSpace.java:1192) at org.openspaces.events.adapter.AbstractResultEventListenerAdapter.handleResult(AbstractResultEventListenerAdapter.java:101) at org.openspaces.events.adapter.AbstractResultEventListenerAdapter.onEvent(AbstractResultEventListenerAdapter.java:76) at org.openspaces.events.AbstractEventListenerContainer.invokeListener(AbstractEventListenerContainer.java:194) at org.openspaces.events.notify.AbstractNotifyEventListenerContainer.invokeListenerWithTransaction(AbstractNotifyEventListenerContainer.java:937) at org.openspaces.events.notify.SimpleNotifyEventListenerContainer$NotifyListenerDelegate.notify(SimpleNotifyEventListenerContainer.java:297) at com.gigaspaces.internal.client.spaceproxy.events.DataEventListener.notify(DataEventListener.java:66) at com.gigaspaces.internal.client.spaceproxy.events.SpaceProxyDataEventListener.notify(SpaceProxyDataEventListener.java:65) at com.gigaspaces.internal.client.spaceproxy.events.MultiplexDataEventListener.notify(MultiplexDataEventListener.java:67) at com.gigaspaces.internal.lrmi.stubs.LRMIRemoteEventListener.notify(LRMIRemoteEventListener.java:95) at com.gigaspaces.internal.server.space.events.RemoteEventBusPacket.notifyListener(RemoteEventBusPacket.java:121) at com.gigaspaces.internal.server.space.events.SpaceDataEventManager.executePacket(SpaceDataEventManager.java:181) at com.gigaspaces.internal.server.space.events.SpaceDataEventDispatcher.execute(SpaceDataEventDispatcher.java:130) at com.gigaspaces.internal.server.space.events.RemoteEventBusPacket.execute(RemoteEventBusPacket.java:103) at com.gigaspaces.internal.server.space.events.SpaceDataEventDispatcher.dispatch(SpaceDataEventDispatcher.java:60) at com.gigaspaces.internal.server.space.events.SpaceDataEventDispatcher.dispatch(SpaceDataEventDispatcher.java:26) at com.j_spaces.kernel.WorkingGroup$TaskWrapper.run(WorkingGroup.java:67) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

Caused by: net.jini.core.transaction.CannotJoinException: not active at com.sun.jini.mahalo.TxnManagerTransaction.join(TxnManagerTransaction.java:517) at com.sun.jini.mahalo.TxnManagerImpl.join_impl(TxnManagerImpl.java:960) at com.sun.jini.mahalo.TxnManagerImpl.join(TxnManagerImpl.java:928) at com.sun.jini.mahalo.TxnMgrProxy.join(TxnMgrProxy.java:320) at net.jini.core.transaction.server.ServerTransaction.join(ServerTransaction.java:261) at net.jini.core.transaction.server.ServerTransaction.joinIfNeededAndEmbedded(ServerTransaction.java:400) at com.gigaspaces.internal.client.spaceproxy.SpaceProxyImpl.beforeExecute(SpaceProxyImpl.java:803) at com.gigaspaces.internal.client.spaceproxy.router.SpaceEmbeddedRemoteOperationRouter.beforeOperationExecution(SpaceEmbeddedRemoteOperationRouter.java:45) at com.gigaspaces.internal.remoting.routing.embedded.EmbeddedRemoteOperationRouter.executeImpl(EmbeddedRemoteOperationRouter.java:65) at com.gigaspaces.internal.remoting.routing.embedded.EmbeddedRemoteOperationRouter.execute(EmbeddedRemoteOperationRouter.java:60) at com.gigaspaces.internal.client.spaceproxy.router.SpaceProxyRouter.execute(SpaceProxyRouter.java:233) at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplWriteAction.write(SpaceProxyImplWriteAction.java:42) at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplWriteAction.write(SpaceProxyImplWriteAction.java:27) at com.gigaspaces.internal.client.spaceproxy.actions.AbstractSpaceProxyActionManager.write(AbstractSpaceProxyActionManager.java:419) at com.gigaspaces.internal.client.spaceproxy.AbstractSpaceProxy.write(AbstractSpaceProxy.java:463) at org.openspaces.core.DefaultGigaSpace.write(DefaultGigaSpace.java:1190) ... 19 more

I've tried to return the object (so that GS writes it for me), or explicitly getting the @GigaSpaceContext and using it to invoke the write API. Both cases, I see this exception.

The only thing interesting about this PU is that it interacts with the underlying EDS via hibernate to fetch rows and write them to disk (they are not stored in the space due to memory requirements). In order to do this, I also have the @Transactional hibernate annotation in this class (I'm not sure if this is relevant but just FYI)

GigaSpaces XAP: Edition: XAP Premium 9.7.0 GA Build: 10551-9

asked 2014-11-07 14:19:34 -0600

dncheu1 gravatar image
edit retag flag offensive close merge delete

Comments

As mentioned, I'm using hibernate to read rows from the EDS. Because I have many entries, this read operation takes in the order of minutes (e.g. 500,000 rows takes 10 minutes)

  • Could this amount of time be causing the Gigaspaces transaction to timeout? If so, how to address this?
  • Is the transaction used to read from hibernate be conflicting with the Jini transaction manager? If so, how to address this?
  • Other reasons why I am getting this exception?

In our pu.xml we defined the transaction-manager in the typical way:

<!-- Defines a distributed transaction manager (will be used for transactional 
        operations with the space). -->
    <os-core:distributed-tx-manager id="transactionManager" />

    <!-- A wrapper bean to the space to provide OpenSpaces simplified space 
        API (built on top of IJSpace/JavaSpace). -->
    <os-core:giga-space id="gigaSpace" space="space" tx-manager="transactionManager" />
dncheu1 gravatar imagedncheu1 ( 2014-11-07 14:32:30 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

Yes, the length of time could be causing this problem; you should start there.

<os-core:distributed-tx-manager id="transactionManager" default-timeout="120"/>

Set this value (in seconds) high enough to ensure that the transaction is still being managed by the transaction manager and this should not happen.

See here for more details:

http://docs.gigaspaces.com/xap97/tran...

answered 2014-11-07 15:21:38 -0600

jb gravatar image
edit flag offensive delete link more

Comments

hi, Another question related to this topic, does transaction timing out have some side-effect of unregistering the PU listener? I have noticed in the GS-UI that the template count goes from 1 to 0 when I encounter the long transaction timing out, but I don't understand why it is doing this.

dncheu1 gravatar imagedncheu1 ( 2014-11-10 15:52:57 -0600 )edit
0

It is possible to re-connect in various scenarios, see the documentation here:

http://docs.gigaspaces.com/xap97/noti...

answered 2014-11-10 15:57:45 -0600

jb gravatar image
edit flag offensive delete link more

Comments

The space has not shutdown in this case, other listeners are still running. only the listener with the transaction is no longer registered

dncheu1 gravatar imagedncheu1 ( 2014-11-11 09:51:46 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-11-07 14:19:34 -0600

Seen: 1,188 times

Last updated: Nov 10 '14