Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Connecting to CDOSession using CVS HEAD
[CDO] Connecting to CDOSession using CVS HEAD [message #427027] Wed, 28 January 2009 15:23 Go to next message
Paul Richardson is currently offline Paul RichardsonFriend
Messages: 33
Registered: July 2009
Member
Hi,

Seems my luck with the new architecture is not great at the moment. Dont
know if there is an example posted somewhere but sadly not been able to
find it.

Trying to create a cdo session. My code is thus:

// Enable logging and tracing
OMPlatform.INSTANCE.setDebugging(true);
OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOL E);

// Prepare container
IManagedContainer container = ContainerUtil.createContainer();
Net4jUtil.prepareContainer(container); // Register Net4j factories
TCPUtil.prepareContainer(container); // Register TCP factories
CDOUtil.prepareContainer(container); // Register CDO factories
CDOServerUtil.prepareContainer(container); // Prepare the CDO server
CDONet4jUtil.prepareContainer(container); // Prepare the CDO client
LifecycleUtil.activate(container);

// Create connector
connector = TCPUtil.getConnector(container, getHostName() + ":" +
getPort());
System.out.println("Connector initialised: " + connector);

CDOSessionConfiguration configuration =
CDONet4jUtil.createSessionConfiguration();
configuration.setConnector(connector);
configuration.setRepositoryName(getRepositoryName());

// Open session
cdoSession = configuration.openSession();

Unfortunately when it gets to openSession an exception is thrown (at
bottom). Would someone mind telling me what I have missed out.

Thanks for your time.

PGR

[ERROR] Factory not found: org.eclipse.emf.cdo.server.repositories[default]
org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not
found: org.eclipse.emf.cdo.server.repositories[default]
at
org.eclipse.net4j.util.container.ManagedContainer.getFactory (ManagedContainer.java:190)
at
org.eclipse.net4j.util.container.ManagedContainer.createElem ent(ManagedContainer.java:487)
at
org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:278)
at
org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:262)
at
org.eclipse.emf.cdo.internal.server.RepositoryFactory.get(Re positoryFactory.java:43)
at
org.eclipse.emf.cdo.internal.server.ContainerRepositoryProvi der.getRepository(ContainerRepositoryProvider.java:37)
at
org.eclipse.emf.cdo.internal.server.protocol.OpenSessionIndi cation.responding(OpenSessionIndication.java:85)
at
org.eclipse.emf.cdo.internal.server.protocol.CDOServerIndica tion.responding(CDOServerIndication.java:151)
at
org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOu tput(IndicationWithResponse.java:96)
at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:285)
at
org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:65)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Re: [CDO] Connecting to CDOSession using CVS HEAD [message #427031 is a reply to message #427027] Wed, 28 January 2009 17:38 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Just to be sure. I wrote and sent an answer but can't see it in the
newsgroup. Here again:


phantomjinx,

I'm sorry if any of these inconveniences are caused by our refactorings.
But we want to have the API in the best shape possible for 2.0.

The exception you got is typical if the repository name in the session
configuration does not exactly match the configured name of the
repository on the server.
In this case the container is trying to create a new repository on the
fly, which is not possible by default because the needed factory is not
registered automatically.
Can you confirm that this solves your problem? Please feel free to file
a bugzilla so that we can enhance the exception message.

Cheers
/Eike

----
http://thegordian.blogspot.com




phantomjinx schrieb:
> Hi,
>
> Seems my luck with the new architecture is not great at the moment.
> Dont know if there is an example posted somewhere but sadly not been
> able to find it.
>
> Trying to create a cdo session. My code is thus:
>
> // Enable logging and tracing
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOL E);
>
> // Prepare container
> IManagedContainer container = ContainerUtil.createContainer();
> Net4jUtil.prepareContainer(container); // Register Net4j factories
> TCPUtil.prepareContainer(container); // Register TCP factories
> CDOUtil.prepareContainer(container); // Register CDO factories
> CDOServerUtil.prepareContainer(container); // Prepare the CDO server
> CDONet4jUtil.prepareContainer(container); // Prepare the CDO client
> LifecycleUtil.activate(container);
>
> // Create connector
> connector = TCPUtil.getConnector(container, getHostName() + ":" +
> getPort());
> System.out.println("Connector initialised: " + connector);
>
> CDOSessionConfiguration configuration =
> CDONet4jUtil.createSessionConfiguration();
> configuration.setConnector(connector);
> configuration.setRepositoryName(getRepositoryName());
>
> // Open session
> cdoSession = configuration.openSession();
>
> Unfortunately when it gets to openSession an exception is thrown (at
> bottom). Would someone mind telling me what I have missed out.
>
> Thanks for your time.
>
> PGR
>
> [ERROR] Factory not found:
> org.eclipse.emf.cdo.server.repositories[default]
> org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not
> found: org.eclipse.emf.cdo.server.repositories[default]
> at
> org.eclipse.net4j.util.container.ManagedContainer.getFactory (ManagedContainer.java:190)
>
> at
> org.eclipse.net4j.util.container.ManagedContainer.createElem ent(ManagedContainer.java:487)
>
> at
> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:278)
>
> at
> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:262)
>
> at
> org.eclipse.emf.cdo.internal.server.RepositoryFactory.get(Re positoryFactory.java:43)
>
> at
> org.eclipse.emf.cdo.internal.server.ContainerRepositoryProvi der.getRepository(ContainerRepositoryProvider.java:37)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.OpenSessionIndi cation.responding(OpenSessionIndication.java:85)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CDOServerIndica tion.responding(CDOServerIndication.java:151)
>
> at
> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOu tput(IndicationWithResponse.java:96)
>
> at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:285)
> at
> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:65)
>
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)


Re: [CDO] Connecting to CDOSession using CVS HEAD [message #427039 is a reply to message #427031] Thu, 29 January 2009 09:45 Go to previous message
Paul Richardson is currently offline Paul RichardsonFriend
Messages: 33
Registered: July 2009
Member
Eike,

Please don't apologise. Its a hazard of playing with CVS HEAD and being
on the bleeding edge as it were. Have corrected and synced the
repository name and everything is now working nicely.

Thanks for your time.

PGR


Eike Stepper wrote:
> Just to be sure. I wrote and sent an answer but can't see it in the
> newsgroup. Here again:
>
>
> phantomjinx,
>
> I'm sorry if any of these inconveniences are caused by our refactorings.
> But we want to have the API in the best shape possible for 2.0.
>
> The exception you got is typical if the repository name in the session
> configuration does not exactly match the configured name of the
> repository on the server.
> In this case the container is trying to create a new repository on the
> fly, which is not possible by default because the needed factory is not
> registered automatically.
> Can you confirm that this solves your problem? Please feel free to file
> a bugzilla so that we can enhance the exception message.
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
>
>
>
>
> phantomjinx schrieb:
>> Hi,
>>
>> Seems my luck with the new architecture is not great at the moment.
>> Dont know if there is an example posted somewhere but sadly not been
>> able to find it.
>>
>> Trying to create a cdo session. My code is thus:
>>
>> // Enable logging and tracing
>> OMPlatform.INSTANCE.setDebugging(true);
>> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOL E);
>>
>> // Prepare container
>> IManagedContainer container = ContainerUtil.createContainer();
>> Net4jUtil.prepareContainer(container); // Register Net4j factories
>> TCPUtil.prepareContainer(container); // Register TCP factories
>> CDOUtil.prepareContainer(container); // Register CDO factories
>> CDOServerUtil.prepareContainer(container); // Prepare the CDO server
>> CDONet4jUtil.prepareContainer(container); // Prepare the CDO client
>> LifecycleUtil.activate(container);
>>
>> // Create connector
>> connector = TCPUtil.getConnector(container, getHostName() + ":" +
>> getPort());
>> System.out.println("Connector initialised: " + connector);
>>
>> CDOSessionConfiguration configuration =
>> CDONet4jUtil.createSessionConfiguration();
>> configuration.setConnector(connector);
>> configuration.setRepositoryName(getRepositoryName());
>>
>> // Open session
>> cdoSession = configuration.openSession();
>>
>> Unfortunately when it gets to openSession an exception is thrown (at
>> bottom). Would someone mind telling me what I have missed out.
>>
>> Thanks for your time.
>>
>> PGR
>>
>> [ERROR] Factory not found:
>> org.eclipse.emf.cdo.server.repositories[default]
>> org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not
>> found: org.eclipse.emf.cdo.server.repositories[default]
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.getFactory (ManagedContainer.java:190)
>>
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.createElem ent(ManagedContainer.java:487)
>>
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:278)
>>
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:262)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.RepositoryFactory.get(Re positoryFactory.java:43)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.ContainerRepositoryProvi der.getRepository(ContainerRepositoryProvider.java:37)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.OpenSessionIndi cation.responding(OpenSessionIndication.java:85)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.CDOServerIndica tion.responding(CDOServerIndication.java:151)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOu tput(IndicationWithResponse.java:96)
>>
>> at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:285)
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:65)
>>
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
>> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
>> Source)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>> at java.lang.Thread.run(Unknown Source)
Previous Topic:editor items disabled
Next Topic:ItemProviders and External State
Goto Forum:
  


Current Time: Fri Apr 19 00:14:22 GMT 2024

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

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

Back to the top