Skip to main content



      Home
Home » Modeling » EMF » [CDO] Offline Master/Clone example throws NPE(CDO offline example)
[CDO] Offline Master/Clone example throws NPE [message #1853924] Sat, 23 July 2022 17:06 Go to next message
Eclipse UserFriend
Never mind, I see from other posts that maybe offline replication is currently broken. Thank you anyway :)

When I run the OfflineExampleMaster.java and OfflineExampleClone.java examples, OfflineExampleMaster throws the following NPE:

Unregistered Session7 [repo1]
Registered Session8 [repo1]
[ERROR] NullPointerException
java.lang.NullPointerException
at org.eclipse.net4j.db.DBUtil.serializeTable(DBUtil.java:1217)
at org.eclipse.net4j.db.DBUtil.serializeTable(DBUtil.java:1208)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalMappingStrategy.rawExport(AbstractHorizontalMappingStrategy.java:236)
at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.rawExport(DBStoreAccessor.java:1346)
at org.eclipse.emf.cdo.internal.server.Repository.replicateRaw(Repository.java:1901)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.ReplicateRepositoryRawIndication.responding(ReplicateRepositoryRawIndication.java:70)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.responding(CDOServerIndicationWithMonitoring.java:185)
at org.eclipse.net4j.signal.IndicationWithMonitoring.responding(IndicationWithMonitoring.java:68)
at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOutput(IndicationWithResponse.java:100)
at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:392)
at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:74)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerReadIndicationWithMonitoring.execute(CDOServerReadIndicationWithMonitoring.java:36)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:329)
at org.eclipse.net4j.signal.SignalReactor.runSync(SignalReactor.java:97)
at org.eclipse.net4j.signal.Signal.run(Signal.java:201)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

Setting the IMappingStrategy.Props.EAGER_TABLE_CREATION property to "true" in the AbstractOfflineExampleServer.createStore like this:

protected IStore createStore()
{
JdbcDataSource dataSource = new JdbcDataSource();
dataSource.setURL("jdbc:h2:database/" + name);

IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
Map<String, String> mappingProps = mappingStrategy.getProperties();
mappingProps.put(IMappingStrategy.Props.EAGER_TABLE_CREATION, "true");
IDBAdapter dbAdapter = new H2Adapter();
IDBConnectionProvider dbConnectionProvider = dbAdapter.createConnectionProvider(dataSource);
return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
}

appears to fix the problem.

Is the the proper way to handle the issue I'm seeing?

Thank you,
Jay

[Updated on: Sat, 23 July 2022 20:33] by Moderator

Re: [CDO] Offline Master/Clone example throws NPE [message #1853940 is a reply to message #1853924] Mon, 25 July 2022 03:23 Go to previous messageGo to next message
Eclipse UserFriend
Sorry, we didn't have the resources to keep the offline clone features up to date with all the other enhancements of CDO.
The company that funded the development of the offline functionality ended their support many years ago.
How critical is this feature for you?
Re: [CDO] Offline Master/Clone example throws NPE [message #1853943 is a reply to message #1853940] Mon, 25 July 2022 06:13 Go to previous message
Eclipse UserFriend
It's not critical, I was just curious about this feature and wanted to experiment with it.

Thank you.
Previous Topic:How can I see the exact query EMF executes?
Next Topic:Problems with adding new child during the creation of a model instance
Goto Forum:
  


Current Time: Thu Jul 03 09:41:25 EDT 2025

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

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

Back to the top