[CDO] Offline Master/Clone example throws NPE [message #1853924] |
Sat, 23 July 2022 21:06 |
Jay Graham Messages: 13 Registered: September 2013 |
Junior Member |
|
|
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: Sun, 24 July 2022 00:33] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01529 seconds