Skip to main content



      Home
Home » Modeling » EMF » [CDO] Exception when switching to Oxygen(Problem is Audit=false)
[CDO] Exception when switching to Oxygen [message #1767683] Sun, 09 July 2017 10:55 Go to next message
Eclipse UserFriend
Hello,

I've an application which works fine when Target Platform = Neon. I tried to switch to Target Platform = Oxygen.

My CDO server starts normally, but the CDO client fails to start with following stack trace:
!MESSAGE Rollback in DBStore: java.lang.ClassCastException: org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalMappingStrategy cannot be cast to org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditMappingStrategy
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractBasicListTableMapping$AbstractListDeltaWriter.writeListDeltas(AbstractBasicListTableMapping.java:168)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.NonAuditListTableMapping.processDelta(NonAuditListTableMapping.java:218)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditClassMapping$FeatureDeltaWriter.visit(HorizontalNonAuditClassMapping.java:634)
	at org.eclipse.emf.cdo.internal.common.revision.delta.CDOListFeatureDeltaImpl.accept(CDOListFeatureDeltaImpl.java:592)
	at org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl.accept(CDORevisionDeltaImpl.java:364)
	at org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl.accept(CDORevisionDeltaImpl.java:354)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditClassMapping$FeatureDeltaWriter.process(HorizontalNonAuditClassMapping.java:584)
	at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditClassMapping.writeRevisionDelta(HorizontalNonAuditClassMapping.java:512)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevisionDelta(DBStoreAccessor.java:558)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevisionDeltas(DBStoreAccessor.java:544)
	at org.eclipse.emf.cdo.spi.server.StoreAccessor.doWrite(StoreAccessor.java:109)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.doWrite(DBStoreAccessor.java:888)
	at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:138)
	at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.writeAccessor(TransactionCommitContext.java:1612)
	at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:737)
	at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:49)
	at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
	at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:95)
	at org.eclipse.emf.cdo.internal.server.Repository.commitUnsynced(Repository.java:1204)
	at org.eclipse.emf.cdo.internal.server.Repository.commit(Repository.java:1197)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:316)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:102)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:118)
	at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:87)
	at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:100)
	at org.eclipse.net4j.signal.Signal.doInput(Signal.java:377)
	at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:73)
	at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:66)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:283)
	at org.eclipse.net4j.signal.Signal.run(Signal.java:162)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)


The CDO configuration is:

	<repository name="myRepo">
        <property name="overrideUUID" value="1ff5d226-b1f0-40fb-aba2-0c31b38c764f" />
        <property name="supportingAudits" value="false" />

        <store type="db">
            <mappingStrategy type="horizontal">
                <property name="qualifiedNames" value="false" />
                <property name="toManyReferences" value="ONE_TABLE_PER_REFERENCE" />
                <property name="toOneReferences" value="LIKE_ATTRIBUTES" />
            </mappingStrategy>

            <dbAdapter name="postgresql" />
            <dataSource class="org.postgresql.ds.PGSimpleDataSource"
                url="jdbc:postgresql://localhost:5432/foo" createDatabaseIfNotExist="true"
                user="cdo" password="****" />

        </store>
    </repository>


If I set "supportingAudits" to "true", the exception disappears (but I don't want to do that ...)

Any suggestion ?

Regards,
Bernard.
Re: [CDO] Exception when switching to Oxygen [message #1769108 is a reply to message #1767683] Wed, 26 July 2017 11:04 Go to previous messageGo to next message
Eclipse UserFriend
Hy Bernard,

same problem here!
Did you find a solution?

Many Thanks
Richard
Re: [CDO] Exception when switching to Oxygen [message #1769147 is a reply to message #1769108] Thu, 27 July 2017 01:37 Go to previous messageGo to next message
Eclipse UserFriend
There is a bug in the "horizontal" mapping strategy that leads to the CCE you've seen. I'll fix it soon. In the meantime you can work around the problem by using this mapping strategy:

<mappingStrategy type="horizontalNonAuditing">
Re: [CDO] Exception when switching to Oxygen [message #1775964 is a reply to message #1769147] Wed, 08 November 2017 11:00 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I have the same issue, but I need to enable auditing.

In cdo-server.xml :
<property name="supportingAudits" value="true" />

In the code, I use : org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalMappingStrategy

I get the exception shown in the OP.
I tried to workaround by using :
org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditMappingStrategy

And I still have in cdo-server.xml :
<property name="supportingAudits" value="true" />

This worked fine for my previous uses cases : the database stores previous revisions of objects, so that CDO can provide old values when clients receive remote deletion notifications.

But now I have a new use case where I open audit views, and it fails because org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditMappingStrategy does not allow audits :

java.lang.IllegalArgumentException: Mapping Strategy does not support audits
at org.eclipse.emf.internal.cdo.view.AbstractCDOView.registerProxyResource2(AbstractCDOView.java:2402) ~[na:na]
at org.eclipse.emf.internal.cdo.view.AbstractCDOView.attachResource(AbstractCDOView.java:2355) ~[na:na]
at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.basicSetResourceSet(CDOResourceImpl.java:1682) ~[na:na]
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$ResourcesEList.inverseAdd(ResourceSetImpl.java:586) ~[na:na]
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:286) ~[na:na]
at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:305) ~[na:na]
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:435) ~[na:na]
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandCreateResource(ResourceSetImpl.java:243) ~[na:na]
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:400) ~[na:na]
at org.eclipse.emf.internal.cdo.view.AbstractCDOView.getResource(AbstractCDOView.java:1378) ~[na:na]
at org.eclipse.emf.internal.cdo.view.AbstractCDOView.getResource(AbstractCDOView.java:1360) ~[na:na]
Re: [CDO] Exception when switching to Oxygen [message #1775965 is a reply to message #1775964] Wed, 08 November 2017 11:08 Go to previous messageGo to next message
Eclipse UserFriend
I opened a Buzilla :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=527002
Re: [CDO] Exception when switching to Oxygen [message #1776503 is a reply to message #1775965] Fri, 17 November 2017 01:04 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

In the meantime you could work around the problem by using the HorizontalNonAuditMappingStrategy. The cdo-server.xml file would contain the following:

<mappingStrategy type="horizontalAuditing">


Cheers
/Eike
Re: [CDO] Exception when switching to Oxygen [message #1776528 is a reply to message #1776503] Fri, 17 November 2017 05:23 Go to previous message
Eclipse UserFriend
Hi,

You meant HorizontalAuditMappingStrategy. This worked like a charm !
I didn't see there was this specific class...

I updated the bugzilla to sum up how to workaround each use case.

Thank you a lot !

[Updated on: Fri, 17 November 2017 05:34] by Moderator

Previous Topic:[xcore] Error in the generated code, when a type with generics is wrapped and used as argument
Next Topic:[Xcore] wrapping an existing enum
Goto Forum:
  


Current Time: Mon Jul 14 21:13:06 EDT 2025

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

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

Back to the top