[CDO] Unmonitored fail-over example [message #1705114] |
Wed, 12 August 2015 04:29  |
Eclipse User |
|
|
|
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 #1705522 is a reply to message #1705385] |
Mon, 17 August 2015 07:38  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.04704 seconds