|
Re: [CDO] Connecting to CDOSession using CVS HEAD [message #427031 is a reply to message #427027] |
Wed, 28 January 2009 17:38 |
|
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)
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Powered by
FUDForum. Page generated in 0.02331 seconds