Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] New topic in forum Eclipse Communications Framework (ECF), called Simple ECF Application doesnt work, by Hans Werner

Title: Eclipse Community Forums
Subject: Simple ECF Application doesnt work Author: Hans Werner Date: Wed, 09 January 2013 04:40
Hello,

I have a Provider Bundle that provides a Service. This is the start method:

public void start(BundleContext bundleContext) throws Exception {

		Hashtable properties = new Hashtable();
		properties.put("service.exported.interfaces", "*");
		properties.put("service.exported.configs", "ecf.generic.server");
		properties.put("org.eclipse.ecf.containerFactoryArgs",
				"ecftcp://localhost:3787/server");
		bundleContext.registerService(ServiceInterface.class.getName(),
				new ServiceImpl(), properties);
	}


The Consumer is in the same eclipse on the same machine (Windows 7). This is the start method:

public void start(BundleContext context) throws Exception {

		ServiceReference containerManagerRef = context
				.getServiceReference(IContainerManager.class.getName());
		IContainerManager containerManager = context
				.getService(containerManagerRef);
		IContainer container = containerManager.getContainerFactory()
				.createContainer("ecf.generic.client");

		IRemoteServiceContainerAdapter containerAdapter = (IRemoteServiceContainerAdapter) container
				.getAdapter(IRemoteServiceContainerAdapter.class);

		IRemoteServiceReference[] serviceReferences = containerAdapter
				.getRemoteServiceReferences(
						IDFactory.getDefault().createID(
								container.getConnectNamespace(),
								"ecftcp://localhost:3282/server"),
						ServiceInterface.class.getName(), null);

		IRemoteService remoteService = containerAdapter
				.getRemoteService(serviceReferences[0]);
		ServiceInterface service = (ServiceInterface) remoteService.getProxy();
		System.out.println("Remote Service " + service.getRandomNumber());
	}


If I start Consumer and Provider I got the following Exception in the Consumer-Bundle.

org.eclipse.ecf.core.ContainerConnectException: Exception during connection to ecftcp://localhost:3282/server
	at org.eclipse.ecf.provider.generic.ClientSOContainer.connect(ClientSOContainer.java:175)
	at org.eclipse.ecf.provider.generic.SOContext.connect(SOContext.java:112)
	at org.eclipse.ecf.provider.remoteservice.generic.RegistrySharedObject.connectToRemoteServiceTarget(RegistrySharedObject.java:558)
	at org.eclipse.ecf.provider.remoteservice.generic.RegistrySharedObject.getRemoteServiceReferences(RegistrySharedObject.java:139)
	at org.eclipse.ecf.provider.remoteservice.generic.RegistrySharedObject.getRemoteServiceReferences(RegistrySharedObject.java:170)
	at consumer.Activator.start(Activator.java:37)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
	at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.resumeBundles(PackageAdminImpl.java:317)
	at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.processDelta(PackageAdminImpl.java:556)
	at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:251)
	at org.eclipse.osgi.framework.internal.core.PackageAdminImpl$1.run(PackageAdminImpl.java:174)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
	at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
	at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
	at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at org.eclipse.ecf.provider.comm.tcp.SocketFactory.createSocket(SocketFactory.java:26)
	at org.eclipse.ecf.provider.comm.tcp.Client.connect(Client.java:182)
	at org.eclipse.ecf.provider.generic.ClientSOContainer.connect(ClientSOContainer.java:145)
	... 17 more

!ENTRY org.eclipse.core.jobs 4 2 2013-01-09 10:43:17.641
!MESSAGE An internal error occurred during: "SLP Discovery".
!STACK 0
java.lang.IllegalArgumentException: Invalid service type: awws
	at ch.ethz.iks.slp.ServiceType.<init>(ServiceType.java:74)
	at org.eclipse.ecf.internal.provider.jslp.LocatorDecoratorImpl.getServiceURLs(LocatorDecoratorImpl.java:111)
	at org.eclipse.ecf.internal.provider.jslp.JSLPDiscoveryJob.run(JSLPDiscoveryJob.java:43)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

!ENTRY org.eclipse.equinox.concurrent 4 2 2013-01-09 10:43:17.820
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.equinox.concurrent".
!STACK 0
java.lang.IllegalArgumentException: Invalid service type: awws
	at ch.ethz.iks.slp.ServiceType.<init>(ServiceType.java:74)
	at org.eclipse.ecf.internal.provider.jslp.LocatorDecoratorImpl.getServiceURLs(LocatorDecoratorImpl.java:111)
	at org.eclipse.ecf.provider.jslp.container.JSLPDiscoveryContainer.getServices(JSLPDiscoveryContainer.java:156)
	at org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescriptionLocator$3.run(EndpointDescriptionLocator.java:446)
	at org.eclipse.equinox.concurrent.future.SingleOperationFuture$1.run(SingleOperationFuture.java:96)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.equinox.concurrent.future.SingleOperationFuture.runWithProgress(SingleOperationFuture.java:89)
	at org.eclipse.equinox.concurrent.future.ThreadsExecutor$1.run(ThreadsExecutor.java:49)
	at java.lang.Thread.run(Unknown Source)



What is wrong with my code or is it not possible to start ecf in the same eclipse on the same machine? Thank you for your help.

Greets
[ Reply ][ Quote ][ View Topic/Message ][ Unsubscribe from this forum ]

Back to the top