[CDO][Xcore] Can't create resource on the base of Xcore defined model [message #1220515] |
Thu, 12 December 2013 05:00  |
Eclipse User |
|
|
|
Hi all,
I've tried to create a new resource in the CDO repository using UI tooling. The workflow looks like this:
- Create model using Xcore (http://wiki.eclipse.org/Xcore)
- Convert it to Ecore (http://wiki.eclipse.org/Xcore#Converting_an_Xcore_Model_to_a_GenModel)
- Start CDO Server (use CDO Master Server Example)
- Open the session (using CDO Sessions view)
- Register Ecore file generated from Xcore in the repository (Package Registry in context menu)
- Start a new transaction for the opened session
- Create a new resource and add a new object on the base of model created from Xcore
- When trying to commit the change (ctrl+s in the editor) I got an exception:
Package 'org.sample.help.profile' contains unresolved proxy 'platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString'
java.lang.IllegalStateException: Package 'org.sample.help.profile' contains unresolved proxy 'platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EString'
at org.eclipse.emf.cdo.common.model.CDOModelUtil.checkCrossResourceURIs(CDOModelUtil.java:630)
at org.eclipse.emf.cdo.common.model.CDOModelUtil.writePackage(CDOModelUtil.java:596)
at org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.write(CDOPackageUnitImpl.java:270)
at org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl.writeCDOPackageUnit(CDODataOutputImpl.java:92)
at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requestingCommit(CommitTransactionRequest.java:159)
at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requesting(CommitTransactionRequest.java:128)
at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequestWithMonitoring.requesting(CDOClientRequestWithMonitoring.java:92)
at org.eclipse.net4j.signal.RequestWithMonitoring.requesting(RequestWithMonitoring.java:165)
at org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedOutput(RequestWithConfirmation.java:119)
at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:298)
at org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:104)
at org.eclipse.net4j.signal.RequestWithMonitoring.doExecute(RequestWithMonitoring.java:235)
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:442)
at org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:89)
at org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:75)
at org.eclipse.net4j.signal.RequestWithMonitoring.send(RequestWithMonitoring.java:110)
at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:518)
at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.commitTransaction(CDOClientProtocol.java:393)
at org.eclipse.emf.internal.cdo.session.DelegatingSessionProtocol.commitTransaction(DelegatingSessionProtocol.java:292)
at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:72)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commitSynced(CDOTransactionImpl.java:1219)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1184)
at org.eclipse.emf.cdo.internal.ui.editor.CDOEditor$22.run(CDOEditor.java:1845)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Please also refer to my yesterday's post with the similar (exact?) problem in Texo and the answer from Ed Merks (http://www.eclipse.org/forums/index.php/t/628257/).
Should I report it to the bugzilla?
Cheers,
Dominik
|
|
|
|
|
|
|
|
|
Re: [CDO][Xcore] Can't create resource on the base of Xcore defined model [message #1230892 is a reply to message #1229329] |
Mon, 13 January 2014 05:33   |
Eclipse User |
|
|
|
Hi all,
I am playing with the same stuff right now.
Eike, I've checked your fix and it does not work.
One problem is with XCore itself that generated ecore has paths like: eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EString"
But anyway, let say, I created two standard ecore models: My.ecore and My1.ecore, with one class MyClass in 1st model and with one class My2Class in 2nd model, and has
My2Class extends MyClass. Then I opened a standalone CDOExplorer and tried to register model from filesystem. With the 1st one, of course, there was no problem.
With the 2nd one too, I could register it. But then I could not commit a instance of class from 2nd model.
Got this error:
URI of the resource (file:/C:/work/projects/demo/bundles/test/model/My.ecore) does not match the nsURI (test.com) of the top-level package;
this can be fixed by calling Resource.setURI(URI) after loading the packages,
or by configuring a URI mapping from nsURI's to location URI's before loading the packages,
and then loading them with their nsURI's
java.lang.IllegalStateException: URI of the resource (file:/C:/work/projects/demo/bundles/test/model/My.ecore) does not match the nsURI (test.com) of the top-level package;
this can be fixed by calling Resource.setURI(URI) after loading the packages,
or by configuring a URI mapping from nsURI's to location URI's before loading the packages,
and then loading them with their nsURI's
at org.eclipse.emf.cdo.common.model.CDOModelUtil.checkCrossResourceURIs(CDOModelUtil.java:712)
at org.eclipse.emf.cdo.common.model.CDOModelUtil.writePackage(CDOModelUtil.java:630)
at org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.write(CDOPackageUnitImpl.java:270)
at org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl.writeCDOPackageUnit(CDODataOutputImpl.java:92)
at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requestingCommit(CommitTransactionRequest.java:159)
at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requesting(CommitTransactionRequest.java:128)
at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequestWithMonitoring.requesting(CDOClientRequestWithMonitoring.java:92)
at org.eclipse.net4j.signal.RequestWithMonitoring.requesting(RequestWithMonitoring.java:165)
at org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedOutput(RequestWithConfirmation.java:119)
at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:301)
at org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:104)
at org.eclipse.net4j.signal.RequestWithMonitoring.doExecute(RequestWithMonitoring.java:235)
at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:53)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:256)
at org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:442)
at org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:89)
at org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:75)
at org.eclipse.net4j.signal.RequestWithMonitoring.send(RequestWithMonitoring.java:110)
at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:538)
at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.commitTransaction(CDOClientProtocol.java:410)
at org.eclipse.emf.internal.cdo.session.DelegatingSessionProtocol.commitTransaction(DelegatingSessionProtocol.java:295)
at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:63)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commitSynced(CDOTransactionImpl.java:1237)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1206)
at org.eclipse.emf.cdo.internal.ui.editor.CDOEditor$22.run(CDOEditor.java:1909)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
I am not so sure if simply using EcorePlugin.computePlatformURIMap(true) will fix the problem.
|
|
|
|
Re: [CDO][Xcore] Can't create resource on the base of Xcore defined model [message #1231233 is a reply to message #1230925] |
Tue, 14 January 2014 00:45  |
Eclipse User |
|
|
|
Pawel,
This combination of my not knowing what these tools Eike has are doing
and Eike not being familiar with Xcore isn't helping address your
question, but it seems to me that this approach of trying to register
the development time artifacts is a bit odd. Normally one works with
instances created from the generated model and one registers that
model's nsURI with the CDO server (and it's irrelevant whether that
generated code was generated using Xcore or just a GenModel).
On 13/01/2014 12:36 PM, Paweł Doleciński wrote:
> I've got one additional question. The whole discussion is about
> registering packages.
> But what about creating new model in XCore and importing it as a
> resource. By this I mean creating new EClasses in resources without
> registering them. I know that ECore is a legacy model and so on, but
> still I've got such a case. When I import XCore resource to CDO I've
> got a lot of additional things, like Jvm Generic Type...
> I could generate ECore from XCore and then import ecore, but it means,
> again, problem with resolving. Any ideas?
>
> Cheers,
> Paweł.
|
|
|
Powered by
FUDForum. Page generated in 0.05821 seconds