Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [EMFStore][EMFForms] Commit fails with checksum errir(Commit cancelled by checksum error handler due to invalid checksum.)
[EMFStore][EMFForms] Commit fails with checksum errir [message #1507421] |
Thu, 11 December 2014 16:10 |
Marina Knieling Messages: 83 Registered: February 2013 |
Member |
|
|
Hey guys,
My environment:
eclipse Luna, ECD SDK 1.4
My application:
2 OSGi DS (one is for the access to the EMFStore), => work
model and model.edit plugins load before OSGi Services,
1 Viewmodel for 1 object (top level model object) => works
My problem:
The Part in which the Viewmodel gets rendered has an annotated save method, that calls a save method on the (injected) OSGi service that is responsible for accessing the EMFStore.
The OSGi service method looks like this:
@Override
public void save(EObject modelObject) throws ESUpdateRequiredException, ESException {
ESLocalProject localProject = workspace.createLocalProject(((Organ)modelObject).getName());
localProject.shareProject(usersession, new ESSystemOutProgressMonitor());
localProject.getModelElements().add(modelObject);
localProject.commit("My Message" ,null,new ESSystemOutProgressMonitor());
}
workspace is initialized on service startup, local server is running
Project gets created and is shared (I checked the .emfstore folders).
Through debugging I realized two things:
1. modelObject isn't added to modelElements in the internal Project
2. commit fails due to checksum error
My questions:
Can I use an OSGi service for accessing the EMFStore? Are there any things I need to check?
What might cause the problem with the modelObject not added to the modelElements? Is that the reason for the checksum thingy error?
BTW: the hello world demo application works fine.
Thanks for any hints
Marina
|
|
|
Re: [EMFStore][EMFForms] Commit fails with checksum errir [message #1513598 is a reply to message #1507421] |
Tue, 16 December 2014 17:25 |
Maximilian Koegel Messages: 253 Registered: July 2009 |
Senior Member |
|
|
Hi Marina,
just a guess:
If you run on pure OSGi there is no extension registry depending on your
configuration and therefore the EPackages of your models will possibly
not be registered with the EMF package registry. This could IMHO cause
the behavior you are experiencing. You can do the registration manually
also by using the PackageRegistry API. Please note that this would have
to be done on both the client and the server side.
Maybe it is also related to this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=358857
Hope this helps!
Cheers,
Maximilian
Am 11.12.2014 17:10, schrieb Marina Knieling:
> Hey guys,
>
> My environment:
> eclipse Luna, ECD SDK 1.4
>
> My application:
> 2 OSGi DS (one is for the access to the EMFStore), => work
> model and model.edit plugins load before OSGi Services,
> 1 Viewmodel for 1 object (top level model object) => works
>
> My problem:
> The Part in which the Viewmodel gets rendered has an annotated save
> method, that calls a save method on the (injected) OSGi service that is
> responsible for accessing the EMFStore.
> The OSGi service method looks like this:
>
>
> @Override
> public void save(EObject modelObject) throws
> ESUpdateRequiredException, ESException {
> ESLocalProject localProject =
> workspace.createLocalProject(((Organ)modelObject).getName());
> localProject.shareProject(usersession, new
> ESSystemOutProgressMonitor());
> localProject.getModelElements().add(modelObject);
> localProject.commit("My Message" ,null,new
> ESSystemOutProgressMonitor());
> }
>
>
> workspace is initialized on service startup, local server is running
>
> Project gets created and is shared (I checked the .emfstore folders).
>
> Through debugging I realized two things: 1. modelObject isn't added to
> modelElements in the internal Project
> 2. commit fails due to checksum error
>
> My questions:
> Can I use an OSGi service for accessing the EMFStore? Are there any
> things I need to check?
>
> What might cause the problem with the modelObject not added to the
> modelElements? Is that the reason for the checksum thingy error?
>
> BTW: the hello world demo application works fine.
>
> Thanks for any hints
>
> Marina
--
Maximilian Kögel
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
| | |
Re: [EMFStore][EMFForms] Commit fails with checksum errir [message #1622734 is a reply to message #1622539] |
Wed, 18 February 2015 18:08 |
Marina Knieling Messages: 83 Registered: February 2013 |
Member |
|
|
Quote:
> At first I faced the same problem
> there, so I redesigned the model and finally it worked with the
> helloworld example.
What did you need to change there? This should not be the case.
To be honest: I've got no idea. I started from scratch and left out some attributes I didn't need anymore. Both models were valid.
Quote:
> Back in my application I have the same problem again.
> You mentioned that it might be the case that it doesn't get registered
> with the package registry, but when I set a breakpoint in the
> PackageImpl.init() method, it is called and so I think it gets
> registered. Or is there another place I need to check?
What is the stacktrace for this failure?
!ENTRY org.eclipse.emf.emfstore.common.model 1 1 2015-02-18 18:53:13.608
!MESSAGE Total time for commit: 47
Total time for commit: 47
...org.eclipse.emf.emfstore.server.exceptions.ESException: Commit cancelled by checksum error handler due to invalid checksum.
at org.eclipse.emf.emfstore.internal.client.model.controller.CommitController.handleChecksumProcessing(CommitController.java:215)
at org.eclipse.emf.emfstore.internal.client.model.controller.CommitController.commit(CommitController.java:181)
at org.eclipse.emf.emfstore.internal.client.model.controller.CommitController.run(CommitController.java:102)
at org.eclipse.emf.emfstore.internal.client.model.controller.CommitController.run(CommitController.java:1)
at org.eclipse.emf.emfstore.internal.client.model.connectionmanager.ServerCall.run(ServerCall.java:249)
at org.eclipse.emf.emfstore.internal.client.model.connectionmanager.SessionManager.executeCall(SessionManager.java:126)
at org.eclipse.emf.emfstore.internal.client.model.connectionmanager.SessionManager.execute(SessionManager.java:65)
at org.eclipse.emf.emfstore.internal.client.model.connectionmanager.ServerCall.execute(ServerCall.java:269)
at org.eclipse.emf.emfstore.internal.client.model.impl.ProjectSpaceBase.commit(ProjectSpaceBase.java:372)
at org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl$14.call(ESLocalProjectImpl.java:407)
at org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl$14.call(ESLocalProjectImpl.java:1)
at org.eclipse.emf.emfstore.client.util.RunESCommand$WithException$1.doRun(RunESCommand.java:61)
at org.eclipse.emf.emfstore.internal.client.model.util.EMFStoreCommandWithResult.commandBody(EMFStoreCommandWithResult.java:31)
at org.eclipse.emf.emfstore.internal.client.model.util.AbstractEMFStoreCommand.execute(AbstractEMFStoreCommand.java:64)
at org.eclipse.emf.common.command.BasicCommandStack.execute(BasicCommandStack.java:78)
at org.eclipse.emf.emfstore.internal.client.model.changeTracking.commands.EMFStoreBasicCommandStack.execute(EMFStoreBasicCommandStack.java:72)
at org.eclipse.emf.emfstore.internal.client.model.util.AbstractEMFStoreCommand.aRun(AbstractEMFStoreCommand.java:108)
at org.eclipse.emf.emfstore.internal.client.model.util.EMFStoreCommandWithResult.run(EMFStoreCommandWithResult.java:59)
at org.eclipse.emf.emfstore.client.util.RunESCommand$WithException.runWithResult(RunESCommand.java:78)
at org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl.commit(ESLocalProjectImpl.java:401)
at com.vknie.comma.core.services.internal.EMFStorePersistenceServiceImpl.save(EMFStorePersistenceServiceImpl.java:65)
at com.vknie.comma.core.ui.views.OrganEMFView.saveOrgan(OrganEMFView.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:214)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:90)
at org.eclipse.e4.ui.internal.workbench.PartServiceSaveHandler.save(PartServiceSaveHandler.java:63)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.savePart(PartServiceImpl.java:1322)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.closePart(StackRenderer.java:1221)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.access$3(StackRenderer.java:1204)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$12.close(StackRenderer.java:1095)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1874)
at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:288)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:164)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Quote:
> BTW: another strange thing I notice is a DanglingHREFException:
Can you provide which API calls you use to connect to the server in your
class EMFStorePersistenceServiceImpl. I guess the usersession is never
added to the list of usersessions in the workspace.
Here's the code for the constructor and the save method of my service:
ESServer localServer;
ESWorkspace workspace;
ESUsersession usersession;
public EMFStorePersistenceServiceImpl() {
try {
// Create a client representation for a local server and start a local server.
localServer = ESServer.FACTORY.createAndStartLocalServer();
localServer.setPort(8080);
workspace = ESWorkspaceProvider.INSTANCE.getWorkspace();
workspace.addServer(localServer);
for (ESServer existingServer : workspace.getServers()) {
if (existingServer != localServer) {
try {
workspace.removeServer(existingServer);
} catch (ESServerNotFoundException e) {
e.printStackTrace();
}
}
}
usersession = localServer.login("super", "super");
// CommaPackageImpl.init(); // this didn't help
} catch (ESException | ESServerStartFailedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void save(EObject modelObject) throws ESUpdateRequiredException, ESException {
ESLocalProject localProject = workspace.createLocalProject(((Organ)modelObject).getName());
localProject.shareProject(usersession, new ESSystemOutProgressMonitor());
localProject.getModelElements().add(modelObject);
localProject.commit("My Message" ,null,new ESSystemOutProgressMonitor());
}
And here's the stacktrace for the DanglingHREFException:
Sharing Project:..........DONE
Commiting changes:..
!ENTRY org.eclipse.emf.emfstore.client 4 0 2015-02-18 19:04:45.571
!MESSAGE emfstore://workspaces/default/projectspaces/_5N-7kLeXEeSYdMxFSnesuQ/projectspace
The object 'org.eclipse.emf.emfstore.internal.client.model.impl.UsersessionImpl@61bc6e07 (username: super)' is not contained in a resource.
org.eclipse.emf.ecore.xmi.DanglingHREFException: The object 'org.eclipse.emf.emfstore.internal.client.model.impl.UsersessionImpl@61bc6e07 (username: super)' 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:1885)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1324)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1224)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2716)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(XMLSaveImpl.java:683)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java:591)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:251)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:389)
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:493)
at org.eclipse.emf.emfstore.internal.client.model.impl.ResourcePersister.saveDirtyResources(ResourcePersister.java:170)
at org.eclipse.emf.emfstore.internal.client.model.impl.ResourcePersister.inspectChanges(ResourcePersister.java:335)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.emf.emfstore.internal.common.observer.ObserverBus$ProxyHandler.notifiyObservers(ObserverBus.java:275)
at org.eclipse.emf.emfstore.internal.common.observer.ObserverBus$ProxyHandler.invoke(ObserverBus.java:261)
at $Proxy20.inspectChanges(Unknown Source)
at org.eclipse.emf.emfstore.internal.client.model.controller.CommitController.commit(CommitController.java:136)
at org.eclipse.emf.emfstore.internal.client.model.controller.CommitController.run(CommitController.java:102)
at org.eclipse.emf.emfstore.internal.client.model.controller.CommitController.run(CommitController.java:1)
at org.eclipse.emf.emfstore.internal.client.model.connectionmanager.ServerCall.run(ServerCall.java:249)
at org.eclipse.emf.emfstore.internal.client.model.connectionmanager.SessionManager.executeCall(SessionManager.java:126)
at org.eclipse.emf.emfstore.internal.client.model.connectionmanager.SessionManager.execute(SessionManager.java:65)
at org.eclipse.emf.emfstore.internal.client.model.connectionmanager.ServerCall.execute(ServerCall.java:269)
at org.eclipse.emf.emfstore.internal.client.model.impl.ProjectSpaceBase.commit(ProjectSpaceBase.java:372)
at org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl$14.call(ESLocalProjectImpl.java:407)
at org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl$14.call(ESLocalProjectImpl.java:1)
at org.eclipse.emf.emfstore.client.util.RunESCommand$WithException$1.doRun(RunESCommand.java:61)
at org.eclipse.emf.emfstore.internal.client.model.util.EMFStoreCommandWithResult.commandBody(EMFStoreCommandWithResult.java:31)
at org.eclipse.emf.emfstore.internal.client.model.util.AbstractEMFStoreCommand.execute(AbstractEMFStoreCommand.java:64)
at org.eclipse.emf.common.command.BasicCommandStack.execute(BasicCommandStack.java:78)
at org.eclipse.emf.emfstore.internal.client.model.changeTracking.commands.EMFStoreBasicCommandStack.execute(EMFStoreBasicCommandStack.java:72)
at org.eclipse.emf.emfstore.internal.client.model.util.AbstractEMFStoreCommand.aRun(AbstractEMFStoreCommand.java:108)
at org.eclipse.emf.emfstore.internal.client.model.util.EMFStoreCommandWithResult.run(EMFStoreCommandWithResult.java:59)
at org.eclipse.emf.emfstore.client.util.RunESCommand$WithException.runWithResult(RunESCommand.java:78)
at org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl.commit(ESLocalProjectImpl.java:401)
at com.vknie.comma.core.services.internal.EMFStorePersistenceServiceImpl.save(EMFStorePersistenceServiceImpl.java:65)
at com.vknie.comma.core.ui.views.OrganEMFView.saveOrgan(OrganEMFView.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:214)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:90)
at org.eclipse.e4.ui.internal.workbench.PartServiceSaveHandler.save(PartServiceSaveHandler.java:63)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.savePart(PartServiceImpl.java:1322)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.closePart(StackRenderer.java:1221)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.access$3(StackRenderer.java:1204)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$12.close(StackRenderer.java:1095)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1874)
at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:288)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:164)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Thanks,
Marina
|
|
|
Re: [EMFStore][EMFForms] Commit fails with checksum errir [message #1624217 is a reply to message #1622734] |
Thu, 19 February 2015 16:42 |
Maximilian Koegel Messages: 253 Registered: July 2009 |
Senior Member |
|
|
Hi,
comments inline. I assume you are using the latest version of EMFStore
1.4.x?
>> > At first I faced the same problem
>> > there, so I redesigned the model and finally it worked with the
>> > helloworld example.
>> What did you need to change there? This should not be the case.
> To be honest: I've got no idea. I started from scratch and left out some
We just tried and it worked fine for us.
> attributes I didn't need anymore. Both models were valid.
We just tried and it worked fine for us. Can you please retry with a
clean workspace and Eclipse.
>> > Back in my application I have the same problem again.
>> > You mentioned that it might be the case that it doesn't get registered
>> > with the package registry, but when I set a breakpoint in the
>> > PackageImpl.init() method, it is called and so I think it gets
>> > registered. Or is there another place I need to check?
>> What is the stacktrace for this failure?
> !ENTRY org.eclipse.emf.emfstore.common.model 1 1 2015-02-18 18:53:13.608
> !MESSAGE Total time for commit: 47
> Total time for commit: 47
> ...org.eclipse.emf.emfstore.server.exceptions.ESException: Commit
> cancelled by checksum error handler due to invalid checksum.
Did you chance any of the code generated for the model?
> Quote:
>> > BTW: another strange thing I notice is a DanglingHREFException:
>> Can you provide which API calls you use to connect to the server in your
>> class EMFStorePersistenceServiceImpl. I guess the usersession is never
>> added to the list of usersessions in the workspace.
Can you please open a bugzilla for this, may be it is a bug.
Cheers,
Maximilian
>
>
> Here's the code for the constructor and the save method of my service:
>
>
> ESServer localServer;
> ESWorkspace workspace;
> ESUsersession usersession;
>
> public EMFStorePersistenceServiceImpl() {
> try {
> // Create a client representation for a local server and
> start a local server.
> localServer = ESServer.FACTORY.createAndStartLocalServer();
> localServer.setPort(8080);
> workspace = ESWorkspaceProvider.INSTANCE.getWorkspace();
> workspace.addServer(localServer);
> for (ESServer existingServer : workspace.getServers()) {
> if (existingServer != localServer) {
> try {
> workspace.removeServer(existingServer);
> } catch (ESServerNotFoundException e) {
> e.printStackTrace();
> }
> }
> }
> usersession = localServer.login("super", "super");
> // CommaPackageImpl.init(); // this didn't help
> } catch (ESException | ESServerStartFailedException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
>
>
>
> @Override
> public void save(EObject modelObject) throws
> ESUpdateRequiredException, ESException {
> ESLocalProject localProject =
> workspace.createLocalProject(((Organ)modelObject).getName());
> localProject.shareProject(usersession, new
> ESSystemOutProgressMonitor());
> localProject.getModelElements().add(modelObject);
> localProject.commit("My Message" ,null,new
> ESSystemOutProgressMonitor());
> }
>
>
> And here's the stacktrace for the DanglingHREFException:
>
>
> Sharing Project:..........DONE
> Commiting changes:..
> !ENTRY org.eclipse.emf.emfstore.client 4 0 2015-02-18 19:04:45.571
> !MESSAGE
> emfstore://workspaces/default/projectspaces/_5N-7kLeXEeSYdMxFSnesuQ/projectspace
>
> The object
> 'org.eclipse.emf.emfstore.internal.client.model.impl.UsersessionImpl@61bc6e07
> (username: super)' is not contained in a resource.
> org.eclipse.emf.ecore.xmi.DanglingHREFException: The object
> 'org.eclipse.emf.emfstore.internal.client.model.impl.UsersessionImpl@61bc6e07
> (username: super)' 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:1885)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1324)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1224)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2716)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(XMLSaveImpl.java:683)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java:591)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:251)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:389)
>
> 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:493)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.ResourcePersister.saveDirtyResources(ResourcePersister.java:170)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.ResourcePersister.inspectChanges(ResourcePersister.java:335)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
> at java.lang.reflect.Method.invoke(Method.java:601)
> at
> org.eclipse.emf.emfstore.internal.common.observer.ObserverBus$ProxyHandler.notifiyObservers(ObserverBus.java:275)
>
> at
> org.eclipse.emf.emfstore.internal.common.observer.ObserverBus$ProxyHandler.invoke(ObserverBus.java:261)
>
> at $Proxy20.inspectChanges(Unknown Source)
> at
> org.eclipse.emf.emfstore.internal.client.model.controller.CommitController.commit(CommitController.java:136)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.controller.CommitController.run(CommitController.java:102)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.controller.CommitController.run(CommitController.java:1)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.connectionmanager.ServerCall.run(ServerCall.java:249)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.connectionmanager.SessionManager.executeCall(SessionManager.java:126)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.connectionmanager.SessionManager.execute(SessionManager.java:65)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.connectionmanager.ServerCall.execute(ServerCall.java:269)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.ProjectSpaceBase.commit(ProjectSpaceBase.java:372)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl$14.call(ESLocalProjectImpl.java:407)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl$14.call(ESLocalProjectImpl.java:1)
>
> at
> org.eclipse.emf.emfstore.client.util.RunESCommand$WithException$1.doRun(RunESCommand.java:61)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.util.EMFStoreCommandWithResult.commandBody(EMFStoreCommandWithResult.java:31)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.util.AbstractEMFStoreCommand.execute(AbstractEMFStoreCommand.java:64)
>
> at
> org.eclipse.emf.common.command.BasicCommandStack.execute(BasicCommandStack.java:78)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.changeTracking.commands.EMFStoreBasicCommandStack.execute(EMFStoreBasicCommandStack.java:72)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.util.AbstractEMFStoreCommand.aRun(AbstractEMFStoreCommand.java:108)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.util.EMFStoreCommandWithResult.run(EMFStoreCommandWithResult.java:59)
>
> at
> org.eclipse.emf.emfstore.client.util.RunESCommand$WithException.runWithResult(RunESCommand.java:78)
>
> at
> org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl.commit(ESLocalProjectImpl.java:401)
>
> at
> com.vknie.comma.core.services.internal.EMFStorePersistenceServiceImpl.save(EMFStorePersistenceServiceImpl.java:65)
>
> at
> com.vknie.comma.core.ui.views.OrganEMFView.saveOrgan(OrganEMFView.java:107)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
> at java.lang.reflect.Method.invoke(Method.java:601)
> at
> org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
>
> at
> org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247)
>
> at
> org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:214)
> at
> org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:90)
>
> at
> org.eclipse.e4.ui.internal.workbench.PartServiceSaveHandler.save(PartServiceSaveHandler.java:63)
>
> at
> org.eclipse.e4.ui.internal.workbench.PartServiceImpl.savePart(PartServiceImpl.java:1322)
>
> at
> org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.closePart(StackRenderer.java:1221)
>
> at
> org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.access$3(StackRenderer.java:1204)
>
> at
> org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$12.close(StackRenderer.java:1095)
>
> at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1874)
> at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:288)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
>
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
>
> at
> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
>
> at
> org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:164)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
> at java.lang.reflect.Method.invoke(Method.java:601)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
>
>
> Thanks,
> Marina
--
Maximilian Kögel
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Re: [EMFStore][EMFForms] Commit fails with checksum errir [message #1624239 is a reply to message #1624217] |
Thu, 19 February 2015 17:00 |
Maximilian Koegel Messages: 253 Registered: July 2009 |
Senior Member |
|
|
Concerning your third problem with DanglingHREF.
This is like the demo code in the examples and it works for me without
exception. Did you try the examples without modification, do they work
for you?
Cheers,
Maximilian
Am 19.02.2015 um 17:42 schrieb Maximilian Koegel:
> Hi,
>
> comments inline. I assume you are using the latest version of EMFStore
> 1.4.x?
>
>>>> At first I faced the same problem
>>>> there, so I redesigned the model and finally it worked with the
>>>> helloworld example.
>>> What did you need to change there? This should not be the case.
>> To be honest: I've got no idea. I started from scratch and left out some
> We just tried and it worked fine for us.
>> attributes I didn't need anymore. Both models were valid.
> We just tried and it worked fine for us. Can you please retry with a
> clean workspace and Eclipse.
>
>>>> Back in my application I have the same problem again.
>>>> You mentioned that it might be the case that it doesn't get registered
>>>> with the package registry, but when I set a breakpoint in the
>>>> PackageImpl.init() method, it is called and so I think it gets
>>>> registered. Or is there another place I need to check?
>>> What is the stacktrace for this failure?
>> !ENTRY org.eclipse.emf.emfstore.common.model 1 1 2015-02-18 18:53:13.608
>> !MESSAGE Total time for commit: 47
>> Total time for commit: 47
>> ...org.eclipse.emf.emfstore.server.exceptions.ESException: Commit
>> cancelled by checksum error handler due to invalid checksum.
> Did you chance any of the code generated for the model?
>
>> Quote:
>>>> BTW: another strange thing I notice is a DanglingHREFException:
>>> Can you provide which API calls you use to connect to the server in your
>>> class EMFStorePersistenceServiceImpl. I guess the usersession is never
>>> added to the list of usersessions in the workspace.
> Can you please open a bugzilla for this, may be it is a bug.
>
> Cheers,
> Maximilian
>>
>>
>> Here's the code for the constructor and the save method of my service:
>>
>>
>> ESServer localServer;
>> ESWorkspace workspace;
>> ESUsersession usersession;
>>
>> public EMFStorePersistenceServiceImpl() {
>> try {
>> // Create a client representation for a local server and
>> start a local server.
>> localServer = ESServer.FACTORY.createAndStartLocalServer();
>> localServer.setPort(8080);
>> workspace = ESWorkspaceProvider.INSTANCE.getWorkspace();
>> workspace.addServer(localServer);
>> for (ESServer existingServer : workspace.getServers()) {
>> if (existingServer != localServer) {
>> try {
>> workspace.removeServer(existingServer);
>> } catch (ESServerNotFoundException e) {
>> e.printStackTrace();
>> }
>> }
>> }
>> usersession = localServer.login("super", "super");
>> // CommaPackageImpl.init(); // this didn't help
>> } catch (ESException | ESServerStartFailedException e) {
>> // TODO Auto-generated catch block
>> e.printStackTrace();
>> }
>> }
>>
>>
>>
>> @Override
>> public void save(EObject modelObject) throws
>> ESUpdateRequiredException, ESException {
>> ESLocalProject localProject =
>> workspace.createLocalProject(((Organ)modelObject).getName());
>> localProject.shareProject(usersession, new
>> ESSystemOutProgressMonitor());
>> localProject.getModelElements().add(modelObject);
>> localProject.commit("My Message" ,null,new
>> ESSystemOutProgressMonitor());
>> }
>>
>>
>> And here's the stacktrace for the DanglingHREFException:
>>
>>
>> Sharing Project:..........DONE
>> Commiting changes:..
>> !ENTRY org.eclipse.emf.emfstore.client 4 0 2015-02-18 19:04:45.571
>> !MESSAGE
>> emfstore://workspaces/default/projectspaces/_5N-7kLeXEeSYdMxFSnesuQ/projectspace
>>
>> The object
>> 'org.eclipse.emf.emfstore.internal.client.model.impl.UsersessionImpl@61bc6e07
>> (username: super)' is not contained in a resource.
>> org.eclipse.emf.ecore.xmi.DanglingHREFException: The object
>> 'org.eclipse.emf.emfstore.internal.client.model.impl.UsersessionImpl@61bc6e07
>> (username: super)' 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:1885)
>>
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1324)
>>
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1224)
>>
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2716)
>>
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(XMLSaveImpl.java:683)
>>
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java:591)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:251)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:389)
>>
>> 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:493)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.impl.ResourcePersister.saveDirtyResources(ResourcePersister.java:170)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.impl.ResourcePersister.inspectChanges(ResourcePersister.java:335)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>
>> at java.lang.reflect.Method.invoke(Method.java:601)
>> at
>> org.eclipse.emf.emfstore.internal.common.observer.ObserverBus$ProxyHandler.notifiyObservers(ObserverBus.java:275)
>>
>> at
>> org.eclipse.emf.emfstore.internal.common.observer.ObserverBus$ProxyHandler.invoke(ObserverBus.java:261)
>>
>> at $Proxy20.inspectChanges(Unknown Source)
>> at
>> org.eclipse.emf.emfstore.internal.client.model.controller.CommitController.commit(CommitController.java:136)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.controller.CommitController.run(CommitController.java:102)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.controller.CommitController.run(CommitController.java:1)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.connectionmanager.ServerCall.run(ServerCall.java:249)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.connectionmanager.SessionManager.executeCall(SessionManager.java:126)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.connectionmanager.SessionManager.execute(SessionManager.java:65)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.connectionmanager.ServerCall.execute(ServerCall.java:269)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.impl.ProjectSpaceBase.commit(ProjectSpaceBase.java:372)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl$14.call(ESLocalProjectImpl.java:407)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl$14.call(ESLocalProjectImpl.java:1)
>>
>> at
>> org.eclipse.emf.emfstore.client.util.RunESCommand$WithException$1.doRun(RunESCommand.java:61)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.util.EMFStoreCommandWithResult.commandBody(EMFStoreCommandWithResult.java:31)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.util.AbstractEMFStoreCommand.execute(AbstractEMFStoreCommand.java:64)
>>
>> at
>> org.eclipse.emf.common.command.BasicCommandStack.execute(BasicCommandStack.java:78)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.changeTracking.commands.EMFStoreBasicCommandStack.execute(EMFStoreBasicCommandStack.java:72)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.util.AbstractEMFStoreCommand.aRun(AbstractEMFStoreCommand.java:108)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.util.EMFStoreCommandWithResult.run(EMFStoreCommandWithResult.java:59)
>>
>> at
>> org.eclipse.emf.emfstore.client.util.RunESCommand$WithException.runWithResult(RunESCommand.java:78)
>>
>> at
>> org.eclipse.emf.emfstore.internal.client.model.impl.api.ESLocalProjectImpl.commit(ESLocalProjectImpl.java:401)
>>
>> at
>> com.vknie.comma.core.services.internal.EMFStorePersistenceServiceImpl.save(EMFStorePersistenceServiceImpl.java:65)
>>
>> at
>> com.vknie.comma.core.ui.views.OrganEMFView.saveOrgan(OrganEMFView.java:107)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>
>> at java.lang.reflect.Method.invoke(Method.java:601)
>> at
>> org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
>>
>> at
>> org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247)
>>
>> at
>> org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:214)
>> at
>> org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:90)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.PartServiceSaveHandler.save(PartServiceSaveHandler.java:63)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.PartServiceImpl.savePart(PartServiceImpl.java:1322)
>>
>> at
>> org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.closePart(StackRenderer.java:1221)
>>
>> at
>> org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.access$3(StackRenderer.java:1204)
>>
>> at
>> org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$12.close(StackRenderer.java:1095)
>>
>> at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1874)
>> at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:288)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
>> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
>>
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:164)
>>
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>>
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
>>
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>
>> at java.lang.reflect.Method.invoke(Method.java:601)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
>>
>>
>> Thanks,
>> Marina
>
>
--
Maximilian Kögel
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Re: [EMFStore][EMFForms] Commit fails with checksum errir [message #1625604 is a reply to message #1624239] |
Fri, 20 February 2015 14:04 |
Marina Knieling Messages: 83 Registered: February 2013 |
Member |
|
|
Hi Maximilian,
comments inline:
>>> What is the stacktrace for this failure?
>> !ENTRY org.eclipse.emf.emfstore.common.model 1 1 2015-02-18 18:53:13.608
>> !MESSAGE Total time for commit: 47
>> Total time for commit: 47
>> ...org.eclipse.emf.emfstore.server.exceptions.ESException: Commit
>> cancelled by checksum error handler due to invalid checksum.
>Did you chance any of the code generated for the model?
I have some derived/transient/volatile attributes in my model and the only thing I changed from the generated code is that I implemented the methods for those attributes. In addition there are some modeled operations which I also simply implemented. But those aren't used in my application yet.
>Concerning your third problem with DanglingHREF.
>This is like the demo code in the examples and it works for me without
>exception. Did you try the examples without modification, do they work
>for you?
Yes, the helloworld example works out of the box (with the League and Players code) and with my model. I create my top level object and 2 associated objects, just like the example with League and Players. I have no DanglingHREFException and I have no checksum errors.
So let me summarize once again:
I have an e4 application with 4 bundles:
* comma-app (with handlers, dialogs, some views and core logic)
* comma-model (model code + some added util classes)
* comma-services (2 OSGi declerated services, 1 for the EMFStore connection and another to get access to my top level object from everywhere in the application)
* comma-viewmodels (EMFForms viewmodels)
In the Activator class of the comma-app bundle, I access my two services via ServiceReference:
// obtain organ provider service
ServiceReference<?> organProviderServiceReference = context.getServiceReference(OrganProvider.class.getName());
organProvider = (OrganProvider) context.getService(organProviderServiceReference);
ServiceReference<?> emfstoreServiceReference = context.getServiceReference(EMFStorePersistenceService.class.getName());
emfStorePersistenceService = (EMFStorePersistenceService) context.getService(emfstoreServiceReference);
That's where the server is started via the constructor in the given service. (works)
In my application I create a new Organ object (my top level object) in an EMFForms Viewmodel. I enter some details and save it. This calls the save method in my EMFStore service. There I create an ESLocalProject with the name of the just created organ object. Then I share this project (works). Then I add the organ object to the model elements of the project (not sure if that works, see below). Then I commit the project (exceptions occur here).
When I now inspect the generated files in the emfstore folder, I can see the following:
On the server side:
I have a project folder with 6 files inside: changepackage, projectHistory, 2 * projectState, 2 * version
version-1.upv shows my commit message from the save method
projectState-1.ups show my organ object with the details I entered in the UI. So it seems that the commit succeeded anyway. Regardless of the exceptions that occured.
On the client side:
I have a project folder with a "files" folder and 3 files inside: operations, project and projectspace
projectspace shows the project with the name that was given in the my save method and the ID from the corresponding server project
project doesn't include any model elements (so it doesn't include my organ object)
operations includes a CreateDeleteOperation for adding the organ object
I also tried the following:
create local project, add model element, then share, don't commit
then I don't have any model elements either on the server nor on the client side. I don't know whether this in intentional or not, but it seems unlogical in my eyes. If I first add some model elements and then share the project then I presume that the model elements are shared together with the project. But that might be the way EMFStore works.
If I don't commit, I don't have any exceptions. So it's definitely the commit method that makes trouble.
Sorry for the longish post, but I thought I describe in a little more detail what exactly is going on in my application. Hope that helps a little bit in finding some possible misunderstandings or errors I might have made or what ever might be wrong.
Regards
Marina
|
|
|
Re: [EMFStore][EMFForms] Commit fails with checksum errir [message #1637386 is a reply to message #1625604] |
Thu, 26 February 2015 17:40 |
Maximilian Koegel Messages: 253 Registered: July 2009 |
Senior Member |
|
|
Hi Marina,
comments inline...
>> Did you chance any of the code generated for the model?
> I have some derived/transient/volatile attributes in my model and the
> only thing I changed from the generated code is that I implemented the
> methods for those attributes.
Are all of those attributes derived/transient/volatile=true? I think
your problem could be related to these features. If it is an option to
you I would try to narrow down the problem by removing them gradually
until it works.
> In my application I create a new Organ object (my top level object) in
> an EMFForms Viewmodel. I enter some details and save it. This calls the
> save method in my EMFStore service. There I create an ESLocalProject
> with the name of the just created organ object. Then I share this
> project (works). Then I add the organ object to the model elements of
> the project (not sure if that works, see below). Then I commit the
> project (exceptions occur here).
>
> When I now inspect the generated files in the emfstore folder, I can see
> the following:
>
> On the server side:
> I have a project folder with 6 files inside: changepackage,
> projectHistory, 2 * projectState, 2 * version
> version-1.upv shows my commit message from the save method
> projectState-1.ups show my organ object with the details I entered in
> the UI. So it seems that the commit succeeded anyway. Regardless of the
> exceptions that occured.
>
> On the client side:
> I have a project folder with a "files" folder and 3 files inside:
> operations, project and projectspace
> projectspace shows the project with the name that was given in the my
> save method and the ID from the corresponding server project
> project doesn't include any model elements (so it doesn't include my
> organ object)
> operations includes a CreateDeleteOperation for adding the organ object
I suspect the problems you have are related to your model and the custom
code in your model. However it is hard for me to debug this from your
emails only. What would help is a minimal test case which fails. It
would be best if you used Gerrit for that:
https://wiki.eclipse.org/Gerrit
An alternative would be to go for professional support:
http://eclipsesource.com/en/services/developer-support/
> I also tried the following:
> create local project, add model element, then share, don't commit
> then I don't have any model elements either on the server nor on the
> client side. I don't know whether this in intentional or not, but it
> seems unlogical in my eyes. If I first add some model elements and then
> share the project then I presume that the model elements are shared
> together with the project. But that might be the way EMFStore works.
No, this not intended, there must be a problem specific to your model.
Cheers,
Maximilian
--
Maximilian Kögel
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
| | |
Goto Forum:
Current Time: Fri Apr 26 14:40:20 GMT 2024
Powered by FUDForum. Page generated in 0.05182 seconds
|