Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Unmonitored fail-over example
[CDO] Unmonitored fail-over example [message #1705114] Wed, 12 August 2015 08:29 Go to next message
Richard Meyer is currently offline Richard MeyerFriend
Messages: 40
Registered: June 2012
Member
Hi,

I just tried to run the unmonitored fail-over example in org.eclipse.cdo.examples.server.failoverexample (InitialMaster, InitialBackup).

First, I run the InitalMaster main program. I get the following exception
Exception in thread "main" org.eclipse.net4j.util.lifecycle.LifecycleException: Could not activate TCPClientConnector[localhost:2.037]


That means the InitialMaster-Repo can not connect to the InitialBackup-Repo. This is because the InitialBackup main program is not running yet and has not created an acceptor. It is the same vice versa.

So, how can I run this example?

(The question was already raised in this thread but unfortunately not answered)

Cheers,
Re: [CDO] Unmonitored fail-over example [message #1705230 is a reply to message #1705114] Thu, 13 August 2015 06:30 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 12.08.2015 um 10:29 schrieb Richard Meyer:
> Hi,
>
> I just tried to run the unmonitored fail-over example in org.eclipse.cdo.examples.server.failoverexample
> (InitialMaster, InitialBackup).
>
> First, I run the InitalMaster main program. I get the following exception
>
> Exception in thread "main" org.eclipse.net4j.util.lifecycle.LifecycleException: Could not activate
> TCPClientConnector[localhost:2.037]
>
>
> That means the InitialMaster-Repo can not connect to the InitialBackup-Repo. This is because the InitialBackup main
> program is not running yet and has not created an acceptor. It is the same vice versa.
I've fixed that example now:
http://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/server/FailoverExample.java

Why aren't you using the Monitored deployment?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] Unmonitored fail-over example [message #1705385 is a reply to message #1705230] Fri, 14 August 2015 13:12 Go to previous messageGo to next message
Richard Meyer is currently offline Richard MeyerFriend
Messages: 40
Registered: June 2012
Member
Dear Eike,

many thanks for your quick help.
Now the UnmonitoredExample runs.

But if I try to run the MonitoredExample I receive the following exceptions:
[WARN] Problem while rolling back the transaction
org.eclipse.net4j.db.DBException: Schema locked: REPO1
	at org.eclipse.net4j.internal.db.ddl.DBSchema.assertUnlocked(DBSchema.java:278)
	at org.eclipse.net4j.internal.db.ddl.DBSchema.removeTable(DBSchema.java:209)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.removeClassMapping(AbstractMappingStrategy.java:676)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapClasses(AbstractMappingStrategy.java:647)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapPackageInfos(AbstractMappingStrategy.java:627)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.mapPackageUnits(AbstractMappingStrategy.java:616)
	at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappingStrategy.removeMapping(AbstractMappingStrategy.java:581)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.doRollback(DBStoreAccessor.java:745)
	at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.rollback(StoreAccessorBase.java:203)
	at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.rollback(TransactionCommitContext.java:1287)
	at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.handleException(TransactionCommitContext.java:722)
	at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:660)
	at org.eclipse.emf.cdo.internal.server.Repository.initRootResource(Repository.java:2060)
	at org.eclipse.emf.cdo.internal.server.syncing.SynchronizableRepository.initRootResource(SynchronizableRepository.java:692)
	at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:2213)
	at org.eclipse.emf.cdo.internal.server.syncing.SynchronizableRepository.doActivate(SynchronizableRepository.java:582)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.internalActivate(Lifecycle.java:76)
	at org.eclipse.net4j.util.lifecycle.ShareableLifecycle.internalActivate(ShareableLifecycle.java:43)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:162)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:127)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:117)
	at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:292)
	at org.eclipse.emf.cdo.server.net4j.FailoverAgent$Protocol$1.indicating(FailoverAgent.java:324)
	at org.eclipse.net4j.signal.Indication.doExtendedInput(Indication.java:57)
	at org.eclipse.net4j.signal.Signal.doInput(Signal.java:365)
	at org.eclipse.net4j.signal.Indication.execute(Indication.java:51)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:271)
	at org.eclipse.net4j.signal.Signal.run(Signal.java:150)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)


Exception in thread "main" org.eclipse.net4j.util.lifecycle.LifecycleException: Not active: Repository[repo1]
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.checkActive(LifecycleUtil.java:100)
	at org.eclipse.emf.cdo.server.net4j.FailoverAgent.doActivate(FailoverAgent.java:229)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.internalActivate(Lifecycle.java:76)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:162)
	at org.eclipse.emf.cdo.examples.server.FailoverExample$Monitored.createRepository(FailoverExample.java:460)
	at org.eclipse.emf.cdo.examples.server.FailoverExample.init(FailoverExample.java:112)
	at org.eclipse.emf.cdo.examples.server.FailoverExample$Monitored$Agent1.main(FailoverExample.java:524)

First I started the Monitor application. If I try to run Agent1 the mentioned exception is raised. (I had deleted the old H2 databases before start)

Many thanks for any help
Richard



Re: [CDO] Unmonitored fail-over example [message #1705522 is a reply to message #1705385] Mon, 17 August 2015 11:38 Go to previous message
Richard Meyer is currently offline Richard MeyerFriend
Messages: 40
Registered: June 2012
Member
OK, I have debugged a little bit: the mentioned exception was original raised in SynchronizableRepository.java:
 @Override
  public void notifyWriteAccessHandlers(ITransaction transaction, CommitContext commitContext, boolean beforeCommit,
      OMMonitor monitor)
  {
    if (beforeCommit && commitContext.getNewPackageUnits().length != 0)
    {
      throw new IllegalStateException(
          "Synchronizable repositories don't support dynamic addition of new packages. Use IRepository.setInitialPackages() instead.");
    }

    super.notifyWriteAccessHandlers(transaction, commitContext, beforeCommit, monitor);
  }


In the debug session I can see that the CommitContext has 3 new package units: EcorePackage, EtypesPackage and EResourcePackage.

I have add the packages in the IRepository.setInitialPackages method
 repository.setInitialPackages(CompanyPackage.eINSTANCE, EcorePackage.eINSTANCE, EtypesPackage.eINSTANCE,
          EresourcePackage.eINSTANCE);
.

Now the example runs successfully.

Previous Topic:how to design a drag and drop between to containment references
Next Topic:Creating EClass by EClass
Goto Forum:
  


Current Time: Wed Apr 24 22:29:26 GMT 2024

Powered by FUDForum. Page generated in 0.03511 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top