Skip to main content



      Home
Home » Modeling » EMF » [CDO] Standalone CDO client(CDO standalone)
[CDO] Standalone CDO client [message #1850377] Mon, 28 February 2022 05:48 Go to next message
Eclipse UserFriend
Hi,

I'm trying to connect to a CDO server from a standalone main class:

		OMPlatform.INSTANCE.setDebugging(true);
		OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
		OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);

		final IManagedContainer container = ContainerUtil.createContainer();

		Net4jUtil.prepareContainer(container);
		TCPUtil.prepareContainer(container);
		CDONet4jUtil.prepareContainer(container);
		container.activate();

		final IConnector connector = Net4jUtil.getConnector(container, "tcp://localhost:2036");
		
		final CDONet4jSessionConfiguration sessionConfiguration = CDONet4jUtil.createNet4jSessionConfiguration();
		sessionConfiguration.setConnector(connector);
		sessionConfiguration.setRepositoryName("repo");
		sessionConfiguration.setCredentialsProvider(new PasswordCredentialsProvider("user", "password".toCharArray()));
		
		final CDOSession session = sessionConfiguration.openNet4jSession();

		session.options().setPassiveUpdateEnabled(true);
		session.options().setPassiveUpdateMode(PassiveUpdateMode.ADDITIONS);

		final CDOTransaction transaction = session.openTransaction();


This code is taken from the CDO standalone example. If I run it from a plugin project using the run as "Java Application" menu it runs fine with my target platform.

I used B3 aggregator to create a maven repository from p2 repositories from my target platform. I then created a maven project referencing the created maven repository and added the following dependencies:

    <dependency>
      <groupId>org.eclipse.emf</groupId>
      <artifactId>org.eclipse.emf.cdo</artifactId>
      <version>4.10.0</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.emf</groupId>
      <artifactId>org.eclipse.emf.cdo.common</artifactId>
      <version>4.10.0</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.emf</groupId>
      <artifactId>org.eclipse.emf.cdo.net4j</artifactId>
      <version>4.3.0</version>
    </dependency>

    <dependency>
      <groupId>org.eclipse.net4j</groupId>
      <artifactId>org.eclipse.net4j</artifactId>
      <version>4.10.0</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.net4j</groupId>
      <artifactId>org.eclipse.net4j.util</artifactId>
      <version>4.10.0</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.net4j</groupId>
      <artifactId>org.eclipse.net4j.tcp</artifactId>
      <version>4.2.1</version>
    </dependency>


The code compile, but when I run it using the run as "Java Application" menu I get the following timeout exception:

Exception in thread "main" org.eclipse.net4j.channel.ChannelException: org.eclipse.net4j.util.concurrent.TimeoutRuntimeException: Channel registration timeout after 10000 milliseconds
	at org.eclipse.spi.net4j.ChannelMultiplexer.openChannel(ChannelMultiplexer.java:196)
	at org.eclipse.spi.net4j.ChannelMultiplexer.openChannel(ChannelMultiplexer.java:1)
	at org.eclipse.net4j.signal.SignalProtocol.open(SignalProtocol.java:204)
	at org.eclipse.emf.cdo.internal.net4j.CDONet4jSessionImpl.createProtocol(CDONet4jSessionImpl.java:303)
	at org.eclipse.emf.cdo.internal.net4j.CDONet4jSessionImpl.openSession(CDONet4jSessionImpl.java:150)
	at org.eclipse.emf.cdo.internal.net4j.CDONet4jSessionImpl.doActivate(CDONet4jSessionImpl.java:202)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.internalActivate(Lifecycle.java:75)
	at org.eclipse.net4j.util.lifecycle.ShareableLifecycle.internalActivate(ShareableLifecycle.java:43)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:164)
	at org.eclipse.emf.internal.cdo.session.CDOSessionConfigurationImpl.openSession(CDOSessionConfigurationImpl.java:395)
	at org.eclipse.emf.cdo.internal.net4j.CDONet4jSessionConfigurationImpl.openNet4jSession(CDONet4jSessionConfigurationImpl.java:116)
	at test.TestCDO.main(TestCDO.java:59)
Caused by: org.eclipse.net4j.util.concurrent.TimeoutRuntimeException: Channel registration timeout after 10000 milliseconds
	at org.eclipse.spi.net4j.ChannelMultiplexer.openChannel(ChannelMultiplexer.java:187)
	... 11 more
Caused by: org.eclipse.net4j.util.concurrent.TimeoutRuntimeException: Registration timeout after 9 999 milliseconds
	at org.eclipse.net4j.internal.tcp.ControlChannel.registerChannel(ControlChannel.java:101)
	at org.eclipse.net4j.internal.tcp.TCPConnector.registerChannelWithPeer(TCPConnector.java:371)
	at org.eclipse.spi.net4j.ChannelMultiplexer.openChannel(ChannelMultiplexer.java:181)
	... 11 more


I also get the same exception if I package the maven project and run it using "java -jar" from the command line.
I have tried to see if ClassNotFoundException were raised in debug but nothing suspicious showed up. I was wondering if someone tried something similar or if someone had an idea of some initialization steps I would have missed for standalone use of CDO ?

Bellow the list of resolved jar files in case some dependencies are missing:

org.eclipse.core.contenttype-3.7.700.jar
org.eclipse.core.jobs-3.10.800.jar
org.eclipse.core.runtime-3.18.0.jar
org.eclipse.emf.cdo-4.10.0.jar
org.eclipse.emf.cdo.common-4.10.0.jar
org.eclipse.emf.cdo.net4j-4.3.0.jar
org.eclipse.emf.common-2.23.0.jar
org.eclipse.emf.ecore-2.25.0.jar
org.eclipse.emf.ecore.change-2.14.0.jar
org.eclipse.emf.ecore.xmi-2.16.0.jar
org.eclipse.equinox.app-1.4.500.jar
org.eclipse.equinox.common-3.12.0.jar
org.eclipse.equinox.preferences-3.8.0.jar
org.eclipse.equinox.registry-3.8.800.jar
org.eclipse.net4j-4.10.0.jar
org.eclipse.net4j.tcp-4.2.1.jar
org.eclipse.net4j.util-3.11.0.jar
org.eclipse.osgi-3.15.300.jar


regards,
Yvan.
Re: [CDO] Standalone CDO client [message #1850378 is a reply to message #1850377] Mon, 28 February 2022 06:10 Go to previous messageGo to next message
Eclipse UserFriend
Hi Yvan,

From the listed dependencies I get the impression that you want to deploy client and server separately. Correct?

The the ChannelException in your client must indicate a problem on the server side. What parts of CDo and Net4j are deployed to your server?
Re: [CDO] Standalone CDO client [message #1850382 is a reply to message #1850378] Mon, 28 February 2022 11:00 Go to previous messageGo to next message
Eclipse UserFriend
Thank you Eike for your response.

Yes, I'm only using the client side of CDO in my standalone application.
The server is an already running server. I used the same server in both tests, I can connect from the plugin project but not in standalone. The server is a RCP product with the following CDO and Net4J plugins:

org.eclipse.emf.cdo_4.6.100.v20210410-1610.jar
org.eclipse.emf.cdo.admin_4.1.600.v20210410-1610.jar
org.eclipse.emf.cdo.common_4.7.0.v20210410-1610.jar
org.eclipse.emf.cdo.common.db_3.0.700.v20210410-1610.jar
org.eclipse.emf.cdo.edit_4.4.200.v20210410-1610.jar
org.eclipse.emf.cdo.explorer_4.5.200.v20210410-1610.jar
org.eclipse.emf.cdo.explorer.ui_4.4.300.v20210410-1610.jar
org.eclipse.emf.cdo.expressions_4.3.300.v20210410-1610.jar
org.eclipse.emf.cdo.expressions.edit_4.3.300.v20210410-1610.jar
org.eclipse.emf.cdo.expressions.editor_4.3.400.v20210410-1610.jar
org.eclipse.emf.cdo.net4j_4.1.600.v20210410-1610.jar
org.eclipse.emf.cdo.security_4.3.300.v20210410-1610.jar
org.eclipse.emf.cdo.security.edit_4.4.100.v20210410-1610.jar
org.eclipse.emf.cdo.security.editor_4.2.500.v20210410-1610.jar
org.eclipse.emf.cdo.security.ui_4.3.400.v20210410-1610.jar
org.eclipse.emf.cdo.server_4.7.0.v20210410-1610.jar
org.eclipse.emf.cdo.server.admin_4.2.400.v20210410-1610.jar
org.eclipse.emf.cdo.server.db_4.6.0.v20210410-1610.jar
org.eclipse.emf.cdo.server.net4j_4.1.500.v20210410-1610.jar
org.eclipse.emf.cdo.server.ocl_4.2.300.v20210410-1610.jar
org.eclipse.emf.cdo.server.product_4.1.600.v20210410-1610.jar
org.eclipse.emf.cdo.server.security_4.4.0.v20210410-1610.jar
org.eclipse.emf.cdo.transfer_4.3.0.v20210410-1610.jar
org.eclipse.emf.cdo.transfer.repository_4.2.400.v20210410-1610.jar
org.eclipse.emf.cdo.transfer.ui_4.2.500.v20210410-1610.jar
org.eclipse.emf.cdo.transfer.workspace_4.2.400.v20210410-1610.jar
org.eclipse.emf.cdo.transfer.workspace.ui_4.2.300.v20210410-1610.jar
org.eclipse.emf.cdo.ui_4.6.100.v20210410-1610.jar
org.eclipse.emf.cdo.ui.admin_4.1.500.v20210410-1610.jar
org.eclipse.emf.cdo.ui.shared_4.3.100.v20210410-1610.jar
org.eclipse.emf.cdo.ui.team_4.2.500.v20210410-1610.jar
org.eclipse.emf.cdo.workspace_4.2.300.v20210410-1610.jar

org.eclipse.emf.cdo.net4j_4.1.600.v20210410-1610.jar
org.eclipse.emf.cdo.server.net4j_4.1.500.v20210410-1610.jar
org.eclipse.net4j_4.7.0.v20210410-1610.jar
org.eclipse.net4j.db_4.7.0.v20210410-1610.jar
org.eclipse.net4j.db.h2_4.3.100.v20210410-1610.jar
org.eclipse.net4j.db.jdbc_4.3.300.v20210410-1610.jar
org.eclipse.net4j.debug_3.0.600.v20210410-1610.jar
org.eclipse.net4j.http_4.0.600.v20210410-1610.jar
org.eclipse.net4j.http.common_4.0.600.v20210410-1610.jar
org.eclipse.net4j.http.server_4.0.700.v20210410-1610.jar
org.eclipse.net4j.jvm_4.1.600.v20210410-1610.jar
org.eclipse.net4j.tcp_4.1.600.v20210410-1610.jar
org.eclipse.net4j.ui_4.2.500.v20210410-1610.jar
org.eclipse.net4j.ui.shared_4.3.200.v20210410-1610.jar
org.eclipse.net4j.util_3.8.0.v20210410-1610.jar
org.eclipse.net4j.util.ui_3.6.200.v20210410-1610.jar
org.eclipse.net4j.ws_1.0.0.v20210410-1610.jar
Re: [CDO] Standalone CDO client [message #1850388 is a reply to message #1850382] Mon, 28 February 2022 22:30 Go to previous messageGo to next message
Eclipse UserFriend
Looking at that list of plugins and their versions I'm almost sure that those jars have not been built by the CDO project. They have very old versions but all build qualifiers are from last October. Who has built those jars? Where did the sources come from? And have they been modified in some way?
Re: [CDO] Standalone CDO client [message #1850393 is a reply to message #1850388] Tue, 01 March 2022 03:23 Go to previous messageGo to next message
Eclipse UserFriend
Yes, those plugins comes from a local build... I'll test with a new target platform using public CDO plugins see if I can connect to a simple server.

Thank you.
Re: [CDO] Standalone CDO client [message #1850398 is a reply to message #1850393] Tue, 01 March 2022 06:44 Go to previous messageGo to next message
Eclipse UserFriend
I was able to connect to a standalone server with public CDO plugins. The problem comes from our server as you said. I'll try to figure out what the problem is.

Thank you for your help.

[Updated on: Tue, 01 March 2022 06:45] by Moderator

Re: [CDO] Standalone CDO client [message #1850400 is a reply to message #1850398] Tue, 01 March 2022 07:28 Go to previous message
Eclipse UserFriend
Thanks for the feedback and good luck!
Previous Topic:CDO - different protocol versions
Next Topic:[CDO] Remote unlocking mechanism changed
Goto Forum:
  


Current Time: Tue Jul 15 18:18:18 EDT 2025

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

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

Back to the top