Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Store] ServerInfoImpl is not contained in a resource
[EMF Store] ServerInfoImpl is not contained in a resource [message #1061822] Tue, 04 June 2013 09:08 Go to next message
Laurent Odermatt is currently offline Laurent Odermatt
Messages: 13
Registered: May 2013
Junior Member
Hello,

I'm a beginner in emf so maybe this error is a basic one

When I try to connect to the server via the API, as shown in the examples

			
ESWorkspace workspace = ESWorkspaceProvider.INSTANCE.getWorkspace();

// A user session stores credentials for login
// Create a user by login in to the local EMFStore server
ESServer server = ESServer.FACTORY.getServer("localhost", 8080, KeyStoreManager.DEFAULT_CERTIFICATE);

ESUsersession usersession = server.login("super", "super");


I encounter this error :

!ENTRY org.eclipse.emf.emfstore.common.model 4 4 2013-06-04 10:55:04.311
!MESSAGE file:/C:/Users/xxx/.emfstore/client/profiles/default_dev/workspace.ucw
The object 'org.eclipse.emf.emfstore.internal.client.model.impl.ServerInfoImpl@166e1bf1 (name: EMFStore (generated entry), url: localhost, port: 8080, certificateAlias: emfstore test certificate (do not use in production!))' is not contained in a resource.
org.eclipse.emf.ecore.xmi.DanglingHREFException: The object 'org.eclipse.emf.emfstore.internal.client.model.impl.ServerInfoImpl@166e1bf1 (name: EMFStore (generated entry), url: localhost, port: 8080, certificateAlias: emfstore test certificate (do not use in production!))' is not contained in a resource.
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.handleDanglingHREF(XMLHelperImpl.java:754)
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getHREF(XMLHelperImpl.java:788)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveEObjectSingle(XMLSaveImpl.java:1880)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1319)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1219)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2711)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1176)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1037)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany(XMLSaveImpl.java:2412)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1548)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1219)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2711)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(XMLSaveImpl.java:678)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java:586)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:251)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:365)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:999)
at org.eclipse.emf.emfstore.internal.common.model.util.ModelUtil.saveResource(ModelUtil.java:425)
at org.eclipse.emf.emfstore.internal.client.model.impl.WorkspaceBase.save(WorkspaceBase.java:296)
at org.eclipse.emf.emfstore.internal.client.model.impl.api.ESServerImpl.login(ESServerImpl.java:245)
at org.eclipse.emf.ecp.ui.commands.ShareProjectHandler.runClient(ShareProjectHandler.java:119)
at org.eclipse.emf.ecp.ui.commands.ShareProjectHandler.execute(ShareProjectHandler.java:81)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.all4tec.sa.core.root.Application.start(Application.java:42)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)


I'm using the server provided with emf store and executing this code trough a custom plugin.
I can connect myself through the ECP view ("Model Repositories") without problem (and the server doesn't show any error).


Can anybody help me?


[Updated on: Tue, 04 June 2013 15:04]

Report message to a moderator

Re: [EMF Store] ServerInfoImpl is not contained in a resource [message #1061899 is a reply to message #1061822] Tue, 04 June 2013 15:03 Go to previous messageGo to next message
Laurent Odermatt is currently offline Laurent Odermatt
Messages: 13
Registered: May 2013
Junior Member
I found the solution:

I have to add the server to the workspace once, using "addServer(server)".
I don't have the problem anymore.

			
ESWorkspace workspace = ESWorkspaceProvider.INSTANCE.getWorkspace();

ESServer server = ESServer.FACTORY.getServer("localhost", 8080, KeyStoreManager.DEFAULT_CERTIFICATE);

//adding the server on the workspace (if it wasn't already added) and put the added server in "server"
server = workspace.addServer(server);

final ESLocalProject project = workspace.createLocalProject("test");

ESUsersession usersession = server.login("super", "super");



Re: [EMF Store] ServerInfoImpl is not contained in a resource [message #1061974 is a reply to message #1061822] Wed, 05 June 2013 08:16 Go to previous message
Maximilian Koegel is currently offline Maximilian Koegel
Messages: 201
Registered: July 2009
Senior Member
Hi,

thank you for your report!
This is an inconsistency in the API and miss-leading documentation, sorry!
The getServer method in the factory should actually be called
createServer and provide a hint that you need to add the server to the
workspace before login.
Can you please try adding this line of code:

>>ESServer server = ESServer.FACTORY.getServer("localhost", 8080,

workspace.addServer(server);

>>KeyStoreManager.DEFAULT_CERTIFICATE);

We will change the documentation and naming with the next RC. By the way
more documentation (a.k.a. turtorials) is also one the way ;).
Please let us know if you need any more help!

Cheers,
Maximilian

Am 04.06.2013 14:02, schrieb Laurent Odermatt:
> Hello,
>
> I'm a beginner in emf so maybe this error is a basic one
>
> When I try to connect to the server via the API, as shown in the examples
>
>
> ESWorkspace workspace = ESWorkspaceProvider.INSTANCE.getWorkspace();
>
> // A user session stores credentials for login
> // Create a user by login in to the local EMFStore server
> ESServer server = ESServer.FACTORY.getServer("localhost", 8080,
> KeyStoreManager.DEFAULT_CERTIFICATE);
>
> ESUsersession usersession = server.login("super", "super");
>
>
> I encounter this error :
>
> !ENTRY org.eclipse.emf.emfstore.common.model 4 4 2013-06-04 10:55:04.311
> !MESSAGE
> file:/C:/Users/xxx/.emfstore/client/profiles/default_dev/workspace.ucw
> The object
> mailto:'org.eclipse.emf.emfstore.internal.client.model.impl.ServerInfoImpl@166e1bf1
> (name: EMFStore (generated entry), url: localhost, port: 8080,
> certificateAlias: emfstore test certificate (do not use in
> production!))' is not contained in a resource.
> org.eclipse.emf.ecore.xmi.DanglingHREFException: The object
> mailto:'org.eclipse.emf.emfstore.internal.client.model.impl.ServerInfoImpl@166e1bf1
> (name: EMFStore (generated entry), url: localhost, port: 8080,
> certificateAlias: emfstore test certificate (do not use in
> production!))' is not contained in a resource.
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.handleDanglingHREF(XMLHelperImpl.java:754)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getHREF(XMLHelperImpl.java:788)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveEObjectSingle(XMLSaveImpl.java:1880)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1319)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1219)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2711)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1176)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1037)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany(XMLSaveImpl.java:2412)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1548)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1219)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2711)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(XMLSaveImpl.java:678)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java:586)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:251)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:365)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:999)
>
> at
> org.eclipse.emf.emfstore.internal.common.model.util.ModelUtil.saveResource(ModelUtil.java:425)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.WorkspaceBase.save(WorkspaceBase.java:296)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.api.ESServerImpl.login(ESServerImpl.java:245)
>
> at
> org.eclipse.emf.ecp.ui.commands.ShareProjectHandler.runClient(ShareProjectHandler.java:119)
>
> at
> org.eclipse.emf.ecp.ui.commands.ShareProjectHandler.execute(ShareProjectHandler.java:81)
>
> at
> org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
>
> at
> org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
> at
> org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
>
> at
> org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
>
> at
> org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
>
> at
> org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
>
> at
> org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
>
> at
> org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
>
> at
> org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
>
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
> at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
> at com.all4tec.sa.core.root.Application.start(Application.java:42)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
>
>
> I'm using the server provided with emf store and executing this code
> trough a custom plugin.
> I can connect myself through the ECP view ("Model Repositories") without
> problem (and the server doesn't show any error).
>
>
> Can anybody help me?
>
>
>


--
Maximilian Kögel

Get Professional Eclipse Support: http://eclipsesource.com/munich
Previous Topic:[Edapt] install on Kepler
Next Topic:[EMF Store] ECollections$EmptyUnmodifiableEList cannot be cast to EStructuralFeature$Setting
Goto Forum:
  


Current Time: Fri Oct 31 10:14:39 GMT 2014

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

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