Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] ClassCastException loading EJavaObject
[CDO] ClassCastException loading EJavaObject [message #1173489] Wed, 06 November 2013 15:04 Go to next message
Kyle B is currently offline Kyle BFriend
Messages: 14
Registered: April 2013
Junior Member
Hello,

I am looking for some help with a problem I am seeing when attempting to recall an EAttribute of type EJavaObject.

I run the data store, then run my client application. I am able to create and persist the object to the database. I then shut down the client application and data store. I restart the data store and when I attempt to restart the client application I get the following exception:

java.lang.ClassCastException: [B cannot be cast to java.lang.String
	at org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl$26.doWriteValue(CDOTypeImpl.java:558)
	at org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl$ObjectType.writeValue(CDOTypeImpl.java:1028)
	at org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl.writeCDOFeatureValue(CDODataOutputImpl.java:491)
	at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writeValues(BaseCDORevision.java:918)
	at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.write(BaseCDORevision.java:239)
	at org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl.writeCDORevision(CDODataOutputImpl.java:381)
	at org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.writeRevision(RevisionInfo.java:221)
	at org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.writeResult(RevisionInfo.java:159)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.LoadRevisionsIndication.responding(LoadRevisionsIndication.java:188)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndication.responding(CDOServerIndication.java:133)
	at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOutput(IndicationWithResponse.java:98)
	at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:298)
	at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:67)
	at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerReadIndication.execute(CDOServerReadIndication.java:36)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
	at org.eclipse.net4j.signal.Signal.run(Signal.java:149)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:724)


When inspecting the error, I can see that the byte[] extracted from the blob field is trying to be cast to a string.

Am I doing something incorrectly when setting the value to this EJavaObject EAttribute or is this a bug?

Thanks,
Kyle
Re: [CDO] ClassCastException loading EJavaObject [message #1173601 is a reply to message #1173489] Wed, 06 November 2013 16:32 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6441
Registered: July 2009
Senior Member
Am 06.11.2013 16:04, schrieb Kyle B:
> Hello,
>
> I am looking for some help with a problem I am seeing when attempting to recall an EAttribute of type EJavaObject.
> I run the data store, then run my client application. I am able to create and persist the object to the database. I
> then shut down the client application and data store. I restart the data store and when I attempt to restart the
> client application I get the following exception:
>
> java.lang.ClassCastException: [B cannot be cast to java.lang.String
> at org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl$26.doWriteValue(CDOTypeImpl.java:558)
> at org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl$ObjectType.writeValue(CDOTypeImpl.java:1028)
> at org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl.writeCDOFeatureValue(CDODataOutputImpl.java:491)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writeValues(BaseCDORevision.java:918)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.write(BaseCDORevision.java:239)
> at org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl.writeCDORevision(CDODataOutputImpl.java:381)
> at org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.writeRevision(RevisionInfo.java:221)
> at org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.writeResult(RevisionInfo.java:159)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.LoadRevisionsIndication.responding(LoadRevisionsIndication.java:188)
> at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndication.responding(CDOServerIndication.java:133)
> at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOutput(IndicationWithResponse.java:98)
> at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:298)
> at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:67)
> at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerReadIndication.execute(CDOServerReadIndication.java:36)
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:149)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:724)
>
> When inspecting the error, I can see that the byte[] extracted from the blob field is trying to be cast to a string.
>
> Am I doing something incorrectly when setting the value to this EJavaObject EAttribute or is this a bug?
What CDO version are you using? EJavaObject serialization support has been added in 4.2:

/**
* @since 4.2
*/
public static final CDOType JAVA_OBJECT = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.JAVA_OBJECT;

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] ClassCastException loading EJavaObject [message #1173633 is a reply to message #1173601] Wed, 06 November 2013 17:00 Go to previous messageGo to next message
Kyle B is currently offline Kyle BFriend
Messages: 14
Registered: April 2013
Junior Member
Hello,

I meant to include the CDO version in my original post. I apologize. We are using CDO 4.2.0.v20130613-1557.
Re: [CDO] ClassCastException loading EJavaObject [message #1184617 is a reply to message #1173489] Wed, 13 November 2013 15:21 Go to previous messageGo to next message
Kyle B is currently offline Kyle BFriend
Messages: 14
Registered: April 2013
Junior Member
Eike,

I believe EJavaObject serialization is implemented for the version of CDO I am using. Any further thoughts on the exception I am seeing?

Thanks,
Kyle
Re: [CDO] ClassCastException loading EJavaObject [message #1197239 is a reply to message #1173489] Tue, 19 November 2013 20:35 Go to previous messageGo to next message
Kyle B is currently offline Kyle BFriend
Messages: 14
Registered: April 2013
Junior Member
Tried upgrading to CDO 4.3-M2 (S20131002-0920) and issue persisted.
Re: [CDO] ClassCastException loading EJavaObject [message #1227414 is a reply to message #1197239] Sat, 04 January 2014 12:24 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6441
Registered: July 2009
Senior Member
Am 19.11.2013 21:35, schrieb Kyle B:
> Tried upgrading to CDO 4.3-M2 (S20131002-0920) and issue persisted.
I've fixed it in: https://bugs.eclipse.org/bugs/show_bug.cgi?id=423355

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:[CDO] ClassCastException persisting EJavaObject to DB
Next Topic:[CDO] Oracle: Writing null to boolean value probably should use Types.BIT instead if Types.BOOLEAN
Goto Forum:
  


Current Time: Sun Aug 18 20:03:00 GMT 2019

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

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

Back to the top