[CDO] References across two EMF models [message #726835] |
Mon, 19 September 2011 16:34 |
Slawomir Duszynski Messages: 7 Registered: July 2011 |
Junior Member |
|
|
Hi,
I am working with CDO/Teneo/EMF since some time and so far persisting of my Model1 worked well. Now, I need to persist a Model2 in the same CDO resource - and it also works correctly, but only if there are no references between Model1 and Model2.
Now, I need a ClassY from Model2 to reference ClassX from Model1 (no containment). I added an appropriate reference to ClassY, regenerated the model classes, and ran the same code that worked previously (basically, Model2 package is registered, a single ClassY object is created and added to the resource contents, some ClassX objects already exist in the repository). However, when I commit the transaction I get:
org.eclipse.emf.cdo.util.CommitException: java.lang.NullPointerException
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1072)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1078)
at de.fhg.iese.cdo.camos.tasks.AbstractTask.commit(AbstractTask.java:124)
at de.fhg.iese.cdo.camos.tasks.AbstractTask.closeTransaction(AbstractTask.java:68)
at de.fhg.iese.cdo.camos.tasks.TransformTask.processData(TransformTask.java:67)
at de.fhg.iese.cdo.camos.tasks.TransformTask.executeTaskSpecific(TransformTask.java:23)
at de.fhg.iese.cdo.camos.tasks.AbstractTask.executeTask(AbstractTask.java:36)
at de.fhg.iese.cdo.camos.TestClient.main(TestClient.java:24)
Caused by: java.lang.NullPointerException
at org.eclipse.emf.cdo.common.model.CDOModelUtil.isTypesPackage(CDOModelUtil.java:166)
at org.eclipse.emf.cdo.common.model.CDOModelUtil.isLob(CDOModelUtil.java:182)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl$CDOCommitContextImpl.collectLobs(CDOTransactionImpl.java:2582)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl$CDOCommitContextImpl.preCommit(CDOTransactionImpl.java:2570)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl$CDOCommitContextImpl.preCommit(CDOTransactionImpl.java:2414)
at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:66)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1058)
... 7 more
After debugging, I saw that this happens when the CDO code in CDOModelUtil.isLob analyzes the newly added reference from ClassY to ClassX. Basically, all the properties of eClassifier representing the reference in CDOModelUtil.isLob are null. Any ideas why the reference info wasn't resolved? Should I configure something in the EMF of the reference?
Thanks,
Slawomir
|
|
|
Re: [CDO] References across two EMF models [message #726962 is a reply to message #726835] |
Tue, 20 September 2011 04:28 |
|
Hi Slawomir,
As you've found out the CDOTransactionImpl.CDOCommitContextImpl.collectLobs() makes a call to
CDOModelUtil.isLob(feature.getEType()). From the stack trace it seems that the feature of your model has an EClassifer
as type that does not belong to an EPackage. To me it looks like a problem with your meta model. What is this feature
and what is its EType?
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Am 19.09.2011 18:34, schrieb Slawomir Duszynski:
> Hi,
>
> I am working with CDO/Teneo/EMF since some time and so far persisting of my Model1 worked well. Now, I need to persist
> a Model2 in the same CDO resource - and it also works correctly, but only if there are no references between Model1
> and Model2.
>
> Now, I need a ClassY from Model2 to reference ClassX from Model1 (no containment). I added an appropriate reference to
> ClassY, regenerated the model classes, and ran the same code that worked previously (basically, Model2 package is
> registered, a single ClassY object is created and added to the resource contents, some ClassX objects already exist in
> the repository). However, when I commit the transaction I get:
>
> org.eclipse.emf.cdo.util.CommitException: java.lang.NullPointerException
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1072)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1078)
> at de.fhg.iese.cdo.camos.tasks.AbstractTask.commit(AbstractTask.java:124)
> at de.fhg.iese.cdo.camos.tasks.AbstractTask.closeTransaction(AbstractTask.java:68)
> at de.fhg.iese.cdo.camos.tasks.TransformTask.processData(TransformTask.java:67)
> at de.fhg.iese.cdo.camos.tasks.TransformTask.executeTaskSpecific(TransformTask.java:23)
> at de.fhg.iese.cdo.camos.tasks.AbstractTask.executeTask(AbstractTask.java:36)
> at de.fhg.iese.cdo.camos.TestClient.main(TestClient.java:24)
> Caused by: java.lang.NullPointerException
> at org.eclipse.emf.cdo.common.model.CDOModelUtil.isTypesPackage(CDOModelUtil.java:166)
> at org.eclipse.emf.cdo.common.model.CDOModelUtil.isLob(CDOModelUtil.java:182)
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl$CDOCommitContextImpl.collectLobs(CDOTransactionImpl.java:2582)
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl$CDOCommitContextImpl.preCommit(CDOTransactionImpl.java:2570)
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl$CDOCommitContextImpl.preCommit(CDOTransactionImpl.java:2414)
> at
> org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:66)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1058)
> ... 7 more
>
> After debugging, I saw that this happens when the CDO code in CDOModelUtil.isLob analyzes the newly added reference
> from ClassY to ClassX. Basically, all the properties of eClassifier representing the reference in CDOModelUtil.isLob
> are null. Any ideas why the reference info wasn't resolved? Should I configure something in the EMF of the reference?
>
> Thanks,
> Slawomir
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04340 seconds