Home » Modeling » EMF » [CDO] M6 and ClassCastException + missing setLazyPackageRegistry() method
| |
Re: [CDO] M6 and ClassCastException + missing setLazyPackageRegistry() method [message #428417 is a reply to message #428408] |
Fri, 20 March 2009 15:34 |
Victor Roldan Betancort Messages: 524 Registered: July 2009 |
Senior Member |
|
|
Kai,
comments below
> Hello.
>
> I today migrated from CDO 2.0 M5 to CDO 2.0 M6 (also to Eclipse 3.5 M6).
> It seems that CDOSessionConfiguration.setLazyPackageRegistry() is not
> anymore present in the API. Is this now the standard behavior or is
> there another way to set this?
Package registration suffered a severe make-up. Please take a look at :
http://thegordian.blogspot.com/2009/03/emf-on-server.html
You can use CDOPackageRegistryPopulator to get a similar effect to lazy
package. It will load all packages from EPackage.Registry.INSTANCE,
wrapping up descriptors in another delegated descriptor, so as soon as
you use one of these descriptors, it will get loaded.
> Also I get a class cast exception when I now try to commit something in
> my (newly build) repository (my code and error message below).
> I am using the Derby Store.
Unfortuntately, our DBStore guy, Stefan, is away for vacation. Eike is
assisting to EclipseCon, so he is away as well, but might come up into
the newsgroup as soon as he arrives CA.
So I can't say very much about this class cast, except that I was
getting the same problem with MySQL, and the solution was the
configuration of the JDBC delegate in the server (cdo-server.xml) which
I had to set to <jdbcDelegate type="preparedStatement" /> instead of
<jdbcDelegate type="prepared" />. I believe Derby does not support
prepared statements. Just try switching those and see what happens,
otherwise, don't hesitate submitting a bug.
Cheers,
ViK.
|
|
|
Re: [CDO] M6 and ClassCastException + missing setLazyPackageRegistry() method [message #428422 is a reply to message #428417] |
Fri, 20 March 2009 16:21 |
Kai Schlamp Messages: 344 Registered: July 2009 |
Senior Member |
|
|
Hello Victor.
Comments below.
> Package registration suffered a severe make-up. Please take a look at :
> http://thegordian.blogspot.com/2009/03/emf-on-server.html
I read about this, but I didn't understand that it has consequences for
lazy package registry.
> You can use CDOPackageRegistryPopulator to get a similar effect to lazy
> package. It will load all packages from EPackage.Registry.INSTANCE,
> wrapping up descriptors in another delegated descriptor, so as soon as
> you use one of these descriptors, it will get loaded.
Do I really have to use CDOPackageRegistryPopulator? As it seems to me,
my code works completely without it (I just deleted the
setLazyPackageRegistry line).
If I oversee something, do you have a simple snippet that would work
with my setup (please see server and client code below)?
Do I have to use CDOPackageRegistryPopulator.populate(CDOPackageRegistry
target)?
I tried something like
CDOPackageRegistryPopulator.populate(config.getPackageRegist ry()), but
got a NullPointerException.
> So I can't say very much about this class cast, except that I was
> getting the same problem with MySQL, and the solution was the
> configuration of the JDBC delegate in the server (cdo-server.xml) which
> I had to set to <jdbcDelegate type="preparedStatement" /> instead of
> <jdbcDelegate type="prepared" />. I believe Derby does not support
> prepared statements. Just try switching those and see what happens,
> otherwise, don't hesitate submitting a bug.
I am not using the prebuilt CDO server, as I set up the server myself
inside my application. So I also don't have a cdo-server.xml settings
file and setup all settings programmatically instead (code below).
I did setup the derby store with:
IDBStore store = CDODBUtil.createStore(strategy, adapter, provider,
CDODBUtil.createStatementJDBCDelegateProvider());
Now I switched to
CDODBUtil.createPreparedStatementJDBCDelegateProvider() and everything
works fine again.
So it seems that CDODBUtil.createStatementJDBCDelegateProvider() is
somehow broken.
Thanks a lot for your help.
Kai
Code to start server:
EmbeddedDataSource dataSource = new EmbeddedDataSource();
dataSource.setDatabaseName("c:/projects/cdo2testerdb");
dataSource.setCreateDatabase("create");
IDBConnectionProvider provider =
DBUtil.createConnectionProvider(dataSource);
IDBAdapter adapter = DBUtil.getDBAdapter("derby-embedded");
IMappingStrategy strategy = CDODBUtil.createHorizontalMappingStrategy();
Map<String, String> mappingStrategyProperties = new HashMap<String,
String>();
mappingStrategyProperties.put("qualifiedNames", "true");
strategy.setProperties(mappingStrategyProperties);
IDBStore store = CDODBUtil.createStore(strategy, adapter, provider,
CDODBUtil.createStatementJDBCDelegateProvider());
strategy.setStore(store);
Map<String, String> props = new HashMap<String, String>();
props.put(Props.SUPPORTING_AUDITS, "false");
props.put(Props.VERIFYING_REVISIONS, "false");
props.put(Props.CURRENT_LRU_CAPACITY, "10000");
props.put(Props.REVISED_LRU_CAPACITY, "10000");
IRepository repository = CDOServerUtil.createRepository(REPOSITORY_NAME,
store, props);
serverContainer = IPluginContainer.INSTANCE;
LifecycleUtil.activate(serverContainer);
CDOServerUtil.addRepository(serverContainer, repository);
TCPUtil.getAcceptor(serverContainer, "0.0.0.0:7679");
JVMUtil.getAcceptor(serverContainer, "default");
Code to create session:
clientContainer = IPluginContainer.INSTANCE;
connector = null;
if (url != null)
connector = TCPUtil.getConnector(clientContainer, url);
else
connector = JVMUtil.getConnector(clientContainer, "default");
if (connector == null)
return;
CDOSessionConfiguration config = CDONet4jUtil.createSessionConfiguration();
config.setConnector(connector);
config.setRepositoryName(REPOSITORY_NAME);
config.setLazyPackageRegistry();
session = config.openSession();
|
|
|
Re: [CDO] M6 and ClassCastException + missing setLazyPackageRegistry() method [message #428458 is a reply to message #428422] |
Mon, 23 March 2009 11:24 |
Victor Roldan Betancort Messages: 524 Registered: July 2009 |
Senior Member |
|
|
Kai,
comments below
>> You can use CDOPackageRegistryPopulator to get a similar effect to
>> lazy package. It will load all packages from
>> EPackage.Registry.INSTANCE, wrapping up descriptors in another
>> delegated descriptor, so as soon as you use one of these descriptors,
>> it will get loaded.
>
> Do I really have to use CDOPackageRegistryPopulator? As it seems to me,
> my code works completely without it (I just deleted the
> setLazyPackageRegistry line).
> If I oversee something, do you have a simple snippet that would work
> with my setup (please see server and client code below)?
No, you don't need it, unless you want to obtain a similar effect to the
former lazy package registry. Everything would work fine without it. I
just thought you needed a "lazy package" registration mechanism and
that's why I pointed out CDOPackageRegistryPopulator
Without the populator (again, its optional) the effect would be that
your package registry doesn't contain any package unless you explicitly
register it :) (except from some implicitly registered packages, as
Ecore and EresourcePackage).
> Do I have to use CDOPackageRegistryPopulator.populate(CDOPackageRegistry
> target)?
> I tried something like
> CDOPackageRegistryPopulator.populate(config.getPackageRegist ry()), but
> got a NullPointerException.
I believe I experienced some time ago the same. I suspect the reason you
get that NPE is because the CDOPackageRegistry is not initialized
(Lifecycle initialized) until you open the session. You have first to
obtained the opened the session, then fetch the CDOPackageRegistry and
populate it.
>> So I can't say very much about this class cast, except that I was
>> getting the same problem with MySQL, and the solution was the
>> configuration of the JDBC delegate in the server (cdo-server.xml)
>> which I had to set to <jdbcDelegate type="preparedStatement" />
>> instead of
>> <jdbcDelegate type="prepared" />. I believe Derby does not support
>> prepared statements. Just try switching those and see what happens,
>> otherwise, don't hesitate submitting a bug.
>
> I am not using the prebuilt CDO server, as I set up the server myself
> inside my application. So I also don't have a cdo-server.xml settings
> file and setup all settings programmatically instead (code below).
>
> I did setup the derby store with:
> IDBStore store = CDODBUtil.createStore(strategy, adapter, provider,
> CDODBUtil.createStatementJDBCDelegateProvider());
>
> Now I switched to
> CDODBUtil.createPreparedStatementJDBCDelegateProvider() and everything
> works fine again.
> So it seems that CDODBUtil.createStatementJDBCDelegateProvider() is
> somehow broken.
Glad it worked out for you :) Yes, I fear that delegate provider might
be broken. The same happens in MySQL. Do you mind submitting a bug with
the ClassCast exception stacktrace so we keep track of it? Thanks!
Cheers!
ViK
|
|
|
Re: [CDO] M6 and ClassCastException + missing setLazyPackageRegistry() method [message #428486 is a reply to message #428408] |
Mon, 23 March 2009 17:55 |
|
Kai,
I think I answered the most important parts of your questions in a reply
to Stephane some minutes ago. Is that sufficient for the moment being
and until I return from the EclipseCon?
Cheers
/Eike
----
http://thegordian.blogspot.com
Kai Schlamp schrieb:
> Hello.
>
> I today migrated from CDO 2.0 M5 to CDO 2.0 M6 (also to Eclipse 3.5 M6).
> It seems that CDOSessionConfiguration.setLazyPackageRegistry() is not
> anymore present in the API. Is this now the standard behavior or is
> there another way to set this?
>
> Also I get a class cast exception when I now try to commit something
> in my (newly build) repository (my code and error message below).
> I am using the Derby Store.
>
> Best regards,
> Kai
>
> How I setup the server (by myself):
>
> http://pastebin.com/m2d6d3a56
>
> How I start a session
>
> http://pastebin.com/m185e5945
>
> How I commit to the repo:
>
> http://pastebin.com/m24f4ccb
>
> The Error Message:
>
> !ENTRY org.eclipse.emf.cdo.server.db 1 0 2009-03-20 14:52:49.421
> !MESSAGE First start: 20.03.2009 14:52:49
> [ERROR] org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl
> cannot be cast to org.eclipse.emf.cdo.common.id.CDOID
> java.lang.ClassCastException:
> org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl cannot be
> cast to org.eclipse.emf.cdo.common.id.CDOID
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AttributeMapp ing$AMObject.convertToDBType(AttributeMapping.java:181)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AttributeMapp ing.appendValue(AttributeMapping.java:58)
>
> at
> org.eclipse.emf.cdo.server.internal.db.jdbc.StatementJDBCDel egate.doInsertAttributes(StatementJDBCDelegate.java:84)
>
> at
> org.eclipse.emf.cdo.server.internal.db.jdbc.AbstractJDBCDele gate.insertAttributes(AbstractJDBCDelegate.java:177)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.ClassMapping. writeAttributes(ClassMapping.java:460)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.ClassMapping. writeRevision(ClassMapping.java:378)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.HorizontalCla ssMapping.writeRevision(HorizontalClassMapping.java:50)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write Revision(DBStoreAccessor.java:560)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write Revisions(DBStoreAccessor.java:542)
>
> at
> org.eclipse.emf.cdo.spi.server.StoreAccessor.write(StoreAcce ssor.java:137)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.acces s$4(DBStoreAccessor.java:1)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.run Loop(DBStoreAccessor.java:87)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.run Loop(DBStoreAccessor.java:1)
>
> at
> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(Pr ogressDistributor.java:96)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write (DBStoreAccessor.java:337)
>
> at
> org.eclipse.emf.cdo.internal.server.TransactionCommitContext Impl.write(TransactionCommitContextImpl.java:266)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication$1.runLoop(CommitTransactionIndication.java:73)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication$1.runLoop(CommitTransactionIndication.java:1)
>
> at
> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(Pr ogressDistributor.java:96)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicatingCommit(CommitTransactionIndication.ja va:324)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicating(CommitTransactionIndication.java:197 )
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicating(CommitTransactionIndication.java:139 )
>
> at
> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating (IndicationWithMonitoring.java:84)
>
> at
> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedIn put(IndicationWithResponse.java:90)
>
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:317)
> at
> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:63)
>
> at
> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(In dicationWithMonitoring.java:63)
>
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
> !ENTRY org.eclipse.emf.cdo.server 4 0 2009-03-20 14:52:58.734
> !MESSAGE org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl
> cannot be cast to org.eclipse.emf.cdo.common.id.CDOID
> !STACK 0
> java.lang.ClassCastException:
> org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl cannot be
> cast to org.eclipse.emf.cdo.common.id.CDOID
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AttributeMapp ing$AMObject.convertToDBType(AttributeMapping.java:181)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AttributeMapp ing.appendValue(AttributeMapping.java:58)
>
> at
> org.eclipse.emf.cdo.server.internal.db.jdbc.StatementJDBCDel egate.doInsertAttributes(StatementJDBCDelegate.java:84)
>
> at
> org.eclipse.emf.cdo.server.internal.db.jdbc.AbstractJDBCDele gate.insertAttributes(AbstractJDBCDelegate.java:177)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.ClassMapping. writeAttributes(ClassMapping.java:460)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.ClassMapping. writeRevision(ClassMapping.java:378)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.HorizontalCla ssMapping.writeRevision(HorizontalClassMapping.java:50)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write Revision(DBStoreAccessor.java:560)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write Revisions(DBStoreAccessor.java:542)
>
> at
> org.eclipse.emf.cdo.spi.server.StoreAccessor.write(StoreAcce ssor.java:137)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.acces s$4(DBStoreAccessor.java:1)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.run Loop(DBStoreAccessor.java:87)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.run Loop(DBStoreAccessor.java:1)
>
> at
> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(Pr ogressDistributor.java:96)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write (DBStoreAccessor.java:337)
>
> at
> org.eclipse.emf.cdo.internal.server.TransactionCommitContext Impl.write(TransactionCommitContextImpl.java:266)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication$1.runLoop(CommitTransactionIndication.java:73)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication$1.runLoop(CommitTransactionIndication.java:1)
>
> at
> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(Pr ogressDistributor.java:96)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicatingCommit(CommitTransactionIndication.ja va:324)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicating(CommitTransactionIndication.java:197 )
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicating(CommitTransactionIndication.java:139 )
>
> at
> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating (IndicationWithMonitoring.java:84)
>
> at
> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedIn put(IndicationWithResponse.java:90)
>
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:317)
> at
> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:63)
>
> at
> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(In dicationWithMonitoring.java:63)
>
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
> [ERROR] Rollback in DBStore: java.lang.ClassCastException:
> org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl cannot be
> cast to org.eclipse.emf.cdo.common.id.CDOID
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AttributeMapp ing$AMObject.convertToDBType(AttributeMapping.java:181)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AttributeMapp ing.appendValue(AttributeMapping.java:58)
>
> at
> org.eclipse.emf.cdo.server.internal.db.jdbc.StatementJDBCDel egate.doInsertAttributes(StatementJDBCDelegate.java:84)
>
> at
> org.eclipse.emf.cdo.server.internal.db.jdbc.AbstractJDBCDele gate.insertAttributes(AbstractJDBCDelegate.java:177)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.ClassMapping. writeAttributes(ClassMapping.java:460)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.ClassMapping. writeRevision(ClassMapping.java:378)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.HorizontalCla ssMapping.writeRevision(HorizontalClassMapping.java:50)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write Revision(DBStoreAccessor.java:560)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write Revisions(DBStoreAccessor.java:542)
>
> at
> org.eclipse.emf.cdo.spi.server.StoreAccessor.write(StoreAcce ssor.java:137)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.acces s$4(DBStoreAccessor.java:1)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.run Loop(DBStoreAccessor.java:87)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.run Loop(DBStoreAccessor.java:1)
>
> at
> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(Pr ogressDistributor.java:96)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write (DBStoreAccessor.java:337)
>
> at
> org.eclipse.emf.cdo.internal.server.TransactionCommitContext Impl.write(TransactionCommitContextImpl.java:266)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication$1.runLoop(CommitTransactionIndication.java:73)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication$1.runLoop(CommitTransactionIndication.java:1)
>
> at
> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(Pr ogressDistributor.java:96)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicatingCommit(CommitTransactionIndication.ja va:324)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicating(CommitTransactionIndication.java:197 )
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicating(CommitTransactionIndication.java:139 )
>
> at
> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating (IndicationWithMonitoring.java:84)
>
> at
> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedIn put(IndicationWithResponse.java:90)
>
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:317)
> at
> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:63)
>
> at
> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(In dicationWithMonitoring.java:63)
>
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
>
> !ENTRY org.eclipse.emf.cdo 4 0 2009-03-20 14:53:00.687
> !MESSAGE Rollback in DBStore: java.lang.ClassCastException:
> org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl cannot be
> cast to org.eclipse.emf.cdo.common.id.CDOID
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AttributeMapp ing$AMObject.convertToDBType(AttributeMapping.java:181)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AttributeMapp ing.appendValue(AttributeMapping.java:58)
>
> at
> org.eclipse.emf.cdo.server.internal.db.jdbc.StatementJDBCDel egate.doInsertAttributes(StatementJDBCDelegate.java:84)
>
> at
> org.eclipse.emf.cdo.server.internal.db.jdbc.AbstractJDBCDele gate.insertAttributes(AbstractJDBCDelegate.java:177)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.ClassMapping. writeAttributes(ClassMapping.java:460)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.ClassMapping. writeRevision(ClassMapping.java:378)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.HorizontalCla ssMapping.writeRevision(HorizontalClassMapping.java:50)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write Revision(DBStoreAccessor.java:560)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write Revisions(DBStoreAccessor.java:542)
>
> at
> org.eclipse.emf.cdo.spi.server.StoreAccessor.write(StoreAcce ssor.java:137)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.acces s$4(DBStoreAccessor.java:1)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.run Loop(DBStoreAccessor.java:87)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.run Loop(DBStoreAccessor.java:1)
>
> at
> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(Pr ogressDistributor.java:96)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write (DBStoreAccessor.java:337)
>
> at
> org.eclipse.emf.cdo.internal.server.TransactionCommitContext Impl.write(TransactionCommitContextImpl.java:266)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication$1.runLoop(CommitTransactionIndication.java:73)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication$1.runLoop(CommitTransactionIndication.java:1)
>
> at
> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(Pr ogressDistributor.java:96)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicatingCommit(CommitTransactionIndication.ja va:324)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicating(CommitTransactionIndication.java:197 )
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicating(CommitTransactionIndication.java:139 )
>
> at
> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating (IndicationWithMonitoring.java:84)
>
> at
> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedIn put(IndicationWithResponse.java:90)
>
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:317)
> at
> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:63)
>
> at
> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(In dicationWithMonitoring.java:63)
>
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
> java.lang.reflect.InvocationTargetException
> at
> org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:421)
> at
> org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:507)
>
> at
> org.pubcurator.core.managers.ServerManager.connectToServer(S erverManager.java:211)
>
> at
> org.pubcurator.core.managers.ServerManager.connectToLocalSer ver(ServerManager.java:197)
>
> at org.pubcurator.core.Startup$1.run(Startup.java:24)
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:133)
>
> at
> org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3855)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3476)
> at
> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2393)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2357)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 09)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:499)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:492)
>
> at
> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at org.pubcurator.core.Application.start(Application.java:20)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 556)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:511)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1284)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1260)
> Caused by: org.eclipse.net4j.util.transaction.TransactionException:
> Rollback in DBStore: java.lang.ClassCastException:
> org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl cannot be
> cast to org.eclipse.emf.cdo.common.id.CDOID
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AttributeMapp ing$AMObject.convertToDBType(AttributeMapping.java:181)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.AttributeMapp ing.appendValue(AttributeMapping.java:58)
>
> at
> org.eclipse.emf.cdo.server.internal.db.jdbc.StatementJDBCDel egate.doInsertAttributes(StatementJDBCDelegate.java:84)
>
> at
> org.eclipse.emf.cdo.server.internal.db.jdbc.AbstractJDBCDele gate.insertAttributes(AbstractJDBCDelegate.java:177)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.ClassMapping. writeAttributes(ClassMapping.java:460)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.ClassMapping. writeRevision(ClassMapping.java:378)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.HorizontalCla ssMapping.writeRevision(HorizontalClassMapping.java:50)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write Revision(DBStoreAccessor.java:560)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write Revisions(DBStoreAccessor.java:542)
>
> at
> org.eclipse.emf.cdo.spi.server.StoreAccessor.write(StoreAcce ssor.java:137)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.acces s$4(DBStoreAccessor.java:1)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.run Loop(DBStoreAccessor.java:87)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.run Loop(DBStoreAccessor.java:1)
>
> at
> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(Pr ogressDistributor.java:96)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write (DBStoreAccessor.java:337)
>
> at
> org.eclipse.emf.cdo.internal.server.TransactionCommitContext Impl.write(TransactionCommitContextImpl.java:266)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication$1.runLoop(CommitTransactionIndication.java:73)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication$1.runLoop(CommitTransactionIndication.java:1)
>
> at
> org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(Pr ogressDistributor.java:96)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicatingCommit(CommitTransactionIndication.ja va:324)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicating(CommitTransactionIndication.java:197 )
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicating(CommitTransactionIndication.java:139 )
>
> at
> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating (IndicationWithMonitoring.java:84)
>
> at
> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedIn put(IndicationWithResponse.java:90)
>
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:317)
> at
> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:63)
>
> at
> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(In dicationWithMonitoring.java:63)
>
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactio nStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:6 3)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. commit(CDOTransactionImpl.java:572)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. commit(CDOTransactionImpl.java:586)
>
> at
> org.pubcurator.docs.providers.DocumentRepositoryInitializer. initialize(DocumentRepositoryInitializer.java:37)
>
> at
> org.pubcurator.core.managers.ServerManager$2.run(ServerManag er.java:229)
> at
> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>
>
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] M6 and ClassCastException + missing setLazyPackageRegistry() method [message #428487 is a reply to message #428458] |
Mon, 23 March 2009 17:57 |
|
Víctor Roldán Betancort schrieb:
> Kai,
>
> comments below
>
>>> You can use CDOPackageRegistryPopulator to get a similar effect to
>>> lazy package. It will load all packages from
>>> EPackage.Registry.INSTANCE, wrapping up descriptors in another
>>> delegated descriptor, so as soon as you use one of these
>>> descriptors, it will get loaded.
>>
>> Do I really have to use CDOPackageRegistryPopulator? As it seems to
>> me, my code works completely without it (I just deleted the
>> setLazyPackageRegistry line).
>> If I oversee something, do you have a simple snippet that would work
>> with my setup (please see server and client code below)?
>
> No, you don't need it, unless you want to obtain a similar effect to
> the former lazy package registry. Everything would work fine without
> it. I just thought you needed a "lazy package" registration mechanism
> and that's why I pointed out CDOPackageRegistryPopulator
It's a replacement for the former *eager* package registry behaviour!
Cheers
/Eike
----
http://thegordian.blogspot.com
>
> Without the populator (again, its optional) the effect would be that
> your package registry doesn't contain any package unless you
> explicitly register it :) (except from some implicitly registered
> packages, as Ecore and EresourcePackage).
>
>> Do I have to use
>> CDOPackageRegistryPopulator.populate(CDOPackageRegistry target)?
>> I tried something like
>> CDOPackageRegistryPopulator.populate(config.getPackageRegist ry()),
>> but got a NullPointerException.
>
> I believe I experienced some time ago the same. I suspect the reason
> you get that NPE is because the CDOPackageRegistry is not initialized
> (Lifecycle initialized) until you open the session. You have first to
> obtained the opened the session, then fetch the CDOPackageRegistry and
> populate it.
>
>>> So I can't say very much about this class cast, except that I was
>>> getting the same problem with MySQL, and the solution was the
>>> configuration of the JDBC delegate in the server (cdo-server.xml)
>>> which I had to set to <jdbcDelegate type="preparedStatement" />
>>> instead of
>>> <jdbcDelegate type="prepared" />. I believe Derby does not support
>>> prepared statements. Just try switching those and see what happens,
>>> otherwise, don't hesitate submitting a bug.
>>
>> I am not using the prebuilt CDO server, as I set up the server myself
>> inside my application. So I also don't have a cdo-server.xml settings
>> file and setup all settings programmatically instead (code below).
>>
>> I did setup the derby store with:
>> IDBStore store = CDODBUtil.createStore(strategy, adapter, provider,
>> CDODBUtil.createStatementJDBCDelegateProvider());
>>
>> Now I switched to
>> CDODBUtil.createPreparedStatementJDBCDelegateProvider() and
>> everything works fine again.
>> So it seems that CDODBUtil.createStatementJDBCDelegateProvider() is
>> somehow broken.
>
> Glad it worked out for you :) Yes, I fear that delegate provider might
> be broken. The same happens in MySQL. Do you mind submitting a bug
> with the ClassCast exception stacktrace so we keep track of it? Thanks!
>
> Cheers!
> ViK
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
| |
Re: [CDO] M6 and ClassCastException + missing setLazyPackageRegistry() method [message #428651 is a reply to message #428487] |
Wed, 25 March 2009 21:57 |
Kai Schlamp Messages: 344 Registered: July 2009 |
Senior Member |
|
|
Comment below.
Eike Stepper schrieb:
>>> Do I really have to use CDOPackageRegistryPopulator? As it seems to
>>> me, my code works completely without it (I just deleted the
>>> setLazyPackageRegistry line).
>>> If I oversee something, do you have a simple snippet that would work
>>> with my setup (please see server and client code below)?
>>
>> No, you don't need it, unless you want to obtain a similar effect to
>> the former lazy package registry. Everything would work fine without
>> it. I just thought you needed a "lazy package" registration mechanism
>> and that's why I pointed out CDOPackageRegistryPopulator
> It's a replacement for the former *eager* package registry behaviour!
Just for clarification. The population has to do with the eager package
registration, and not with the lazy package registration?
So, when I want do explicitly say, use that and that package for CDO
persistence, then I must use the populator.
But if I just want to use the lazy mechanism (not explicitly defining
those packages), then I don't have to use the populator (as this is the
standard behavior).
Did I get things right?
Kai
|
|
| | | |
Goto Forum:
Current Time: Tue Apr 23 13:49:45 GMT 2024
Powered by FUDForum. Page generated in 0.58227 seconds
|