Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Exception on pre-built binary package
[CDO] Exception on pre-built binary package [message #894952] Wed, 11 July 2012 08:43 Go to next message
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 186
Registered: July 2009
Location: Torino
Senior Member

Hi,
I downloaded the pre-built package for windows and just ran it.

Then I connected through the CDO Sessions view from Eclipse 4.

When I connect I get FactoryNotFoundException (see the attached image).index.php/fa/10659/0/

Is that normal?


Re: [CDO] Exception on pre-built binary package [message #894957 is a reply to message #894952] Wed, 11 July 2012 08:55 Go to previous messageGo to next message
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 186
Registered: July 2009
Location: Torino
Senior Member

By the way the exception is thrown again and again every few seconds.

Re: [CDO] Exception on pre-built binary package [message #895059 is a reply to message #894957] Wed, 11 July 2012 14:53 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 5574
Registered: July 2009
Senior Member
Am 11.07.2012 10:55, schrieb Federico Tomassetti:
> By the way the exception is thrown again and again every few seconds.
Hmm, that's kind of odd, but in no way hindering evaluation. If, on the client-side, you close the CDO Administration
view it should go away (fix1). You can also fix it by manually deploying the org.eclipse.emf.cdo.server.admin bundle to
the server (fix2).

The reason for this behaviour is that the new CDO Administration view periodically tries to establish a cdo-admin
protocol connection to all configured servers and list their repositories. This bug describes the new CDOAdmin API:

381472: Design a repository administration API
https://bugs.eclipse.org/bugs/show_bug.cgi?id=381472

These types form the client-side API:

/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/admin/CDOAdminClient.java
/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/admin/CDOAdminClientManager.java
/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/admin/CDOAdminClientRepository.java
/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/admin/CDOAdminClientUtil.java

Can you please submit a bugzilla so that I can fix the your current problem in the next maintenance build (fix1)?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Exception on pre-built binary package [message #895060 is a reply to message #895059] Wed, 11 July 2012 14:54 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 5574
Registered: July 2009
Senior Member
Am 11.07.2012 16:53, schrieb Eike Stepper:
> Can you please submit a bugzilla so that I can fix the your current problem in the next maintenance build (fix1)?
Sorry, I meant fix2 ;-)

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Exception on pre-built binary package [message #981340 is a reply to message #895060] Mon, 12 November 2012 10:43 Go to previous message
Etienne ALLOGO is currently offline Etienne ALLOGOFriend
Messages: 4
Registered: November 2012
Junior Member
I have the following trace when I call CdoAdmin.createRepository :
net4j-Thread-5 [org.eclipse.internal.net4j.buffer.BufferPool] Obtained Buffer@204[INITIAL]
net4j-Thread-5 [org.eclipse.net4j.signal.SignalProtocol] Put signal id 4
[WARN] A problem occured while notifying client SignalProtocol[cdo-admin]
java.lang.NullPointerException
	at org.eclipse.emf.cdo.server.internal.admin.CDOAdminServerRepository.write(CDOAdminServerRepository.java:197)
	at org.eclipse.emf.cdo.server.internal.admin.protocol.RepositoryAddedRequest.requesting(RepositoryAddedRequest.java:35)
	at org.eclipse.net4j.signal.Request.doExtendedOutput(Request.java:67)
	at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:298)
	at org.eclipse.net4j.signal.Request.doExecute(Request.java:59)
	at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:53)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
	at org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:440)
	at org.eclipse.net4j.signal.Request.sendAsync(Request.java:53)
	at org.eclipse.emf.cdo.server.internal.admin.protocol.CDOAdminServerProtocol.sendRepositoryAdded(CDOAdminServerProtocol.java:51)
	at org.eclipse.emf.cdo.server.internal.admin.CDOAdminServer.repositoryAdded(CDOAdminServer.java:164)
	at org.eclipse.emf.cdo.server.internal.admin.CDOAdminServer$1.onAdded(CDOAdminServer.java:52)
	at org.eclipse.net4j.util.container.ContainerEventAdapter$1.added(ContainerEventAdapter.java:50)
	at org.eclipse.net4j.util.container.ContainerEvent.accept(ContainerEvent.java:113)
	at org.eclipse.net4j.util.container.ContainerEventAdapter.notifyContainerEvent(ContainerEventAdapter.java:46)
	at org.eclipse.net4j.util.container.ContainerEventAdapter.notifyEvent(ContainerEventAdapter.java:35)
	at org.eclipse.net4j.util.event.Notifier.fireEventSafe(Notifier.java:146)
	at org.eclipse.net4j.util.event.Notifier.fireEvent(Notifier.java:110)
	at org.eclipse.net4j.util.event.Notifier.fireEvent(Notifier.java:86)
	at org.eclipse.net4j.util.container.ManagedContainer.fireEvent(ManagedContainer.java:478)
	at org.eclipse.net4j.util.container.ManagedContainer.putElement(ManagedContainer.java:361)
	at org.eclipse.net4j.util.container.ManagedContainer.putElement(ManagedContainer.java:337)
	at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:207)
	at org.eclipse.emf.cdo.server.internal.admin.CDOAdminServer.doCreateRepository(CDOAdminServer.java:110)
	at org.eclipse.emf.cdo.spi.common.admin.AbstractCDOAdmin.createRepository(AbstractCDOAdmin.java:105)
	at org.eclipse.emf.cdo.server.internal.admin.protocol.CreateRepositoryIndication.responding(CreateRepositoryIndication.java:54)
	at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOutput(IndicationWithResponse.java:98)
	at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:298)
	at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:67)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
	at org.eclipse.net4j.signal.Signal.run(Signal.java:149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)


My client code is :

package ........model.tests;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import junit.framework.Assert;

import org.eclipse.emf.cdo.admin.CDOAdminClient;
import org.eclipse.emf.cdo.admin.CDOAdminClientUtil;
import org.eclipse.emf.cdo.common.admin.CDOAdmin;
import org.eclipse.emf.cdo.common.admin.CDOAdminRepository;
import org.eclipse.emf.cdo.net4j.CDONet4jSession;
import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration;
import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.net4j.Net4jUtil;
import org.eclipse.net4j.connector.IConnector;
import org.eclipse.net4j.tcp.TCPUtil;
import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.net4j.util.lifecycle.ILifecycle;
import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter;
import org.junit.BeforeClass;
import org.junit.Test;

...

public class TestCdoClient {

	private static IConnector connector;
	public static final long DEFAULT_TIMEOUT = 500;
	private static final String ADMIN_HANDLER_TYPE = ConnectionPackage.eNS_PREFIX;

	@BeforeClass
	public static void init() {
		// The following lines are not needed if the extension
		// registry (OSGi/Equinox) is running
		Net4jUtil.prepareContainer(IPluginContainer.INSTANCE);
		TCPUtil.prepareContainer(IPluginContainer.INSTANCE);

		connector = (IConnector) IPluginContainer.INSTANCE.getElement( //
				"org.eclipse.net4j.connectors", // Product group
				"tcp", // Type
				"localhost:2036");

	}

	@Test
	public void test() throws IOException, InterruptedException {
		CDOAdmin admin = openAdmin(null);
		try {
			int size = admin.getRepositories().length;

			.. repo = ...Factory.eINSTANCE
					.create...Repository();
			repo.setDatabaseHostName("localhost");
			...
			final String value = "cdoTestClientRepo"
					+ System.currentTimeMillis();
			repo.setName(value);
			Map<String, Object> propperties = new HashMap<String, Object>();
			EList<EAttribute> attributes = repo.eClass().getEAttributes();
			for (EAttribute eAttribute : attributes) {
				propperties.put(eAttribute.getName(), repo.eGet(eAttribute));
			}
			CDOAdminRepository repo2 = null;
			try {
				// FIXME BUG CDO
				repo2 = admin.createRepository(value, ADMIN_HANDLER_TYPE,
						propperties);

			} catch (Exception e) {
				e.printStackTrace();
				// FIXME BUG CDO - Always occurred
			} finally {
				disposeAdmin(admin);
				admin = openAdmin(null);
				CDOAdminRepository[] repos = admin.getRepositories();
				for (CDOAdminRepository cdoAdminRepository : repos) {
					if (cdoAdminRepository.getName().equals(repo.getName())) {
						repo2 = cdoAdminRepository;
					}
				}
			}
			Assert.assertNotNull(repo2);
			Assert.assertEquals(value, repo2.getName());
			Assert.assertEquals(size + 1, admin.getRepositories().length);
			repo2.delete(ADMIN_HANDLER_TYPE);
			Assert.assertEquals(null, admin.getRepository(value));
			Assert.assertEquals(size, admin.getRepositories().length);

		} finally {
			cleanup(admin);
		}
	}

	private CDOAdmin openAdmin(Object object) throws InterruptedException {

		String url = connector.getURL();
		final CDOAdminClient admin = CDOAdminClientUtil.openAdmin(url,
				DEFAULT_TIMEOUT);
		long timeout = System.currentTimeMillis() + DEFAULT_TIMEOUT + 10;
		while (System.currentTimeMillis() < timeout && !admin.isConnected()) {
			Thread.sleep(10);
		}
		return admin;
	}

	
	private void cleanup(CDOAdmin admin) {
		disposeAdmin(admin);
		connector.close();
	}

	private void disposeAdmin(CDOAdmin admin) {
		IOUtil.closeSilent(admin);
	}

}


I have to dispose CDOAdmin and reopen it to conturn this excepion.
I've always a Timeout excetion on client site that I catch, but it will be difficult to maintain an efficient code in my UI application.
Previous Topic:Unexpected meta-model reloading improvement
Next Topic:EMF Update Sites
Goto Forum:
  


Current Time: Tue Nov 25 01:47:33 GMT 2014

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

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