[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
ClassCastException in LinkedBlockingQueue  XML
Forum Index -> Terracotta Platform
Author Message
ankushb

neo

Joined: 03/10/2011 00:43:11
Messages: 3
Offline

Hi,
I am using Terracotta 3.4.1 for my product and I am sharing a LinkedBlockingQueue as a DSO. Problem is when I tried to read the objects of this queue from other JVM(which is obviously terracotta client), I am getting class cast exception. "java.lang.ClassCastException: com.tc.object.ObjectID" We are just trying to shift to 3.4.1 and this code is running fine in terracotta 2.7.3.

Any hints?

Thanks
Ankush
gkeim

ophanim

Joined: 12/05/2006 10:22:37
Messages: 685
Location: Terracotta, Inc.
Offline

The full stacktrace is required.

Gary Keim (terracotta developer) Want to post to this forum? Join the Terracotta Community
ankushb

neo

Joined: 03/10/2011 00:43:11
Messages: 3
Offline

This is the full stack trace and its not of much help too...

java.lang.ClassCastException: com.tc.object.ObjectID
at net.deepvalue.alert.AlertEngineService.run(AlertEngineService.java:121)
at java.lang.Thread.run(Thread.java:595)

teck

seraphim
[Avatar]
Joined: 05/24/2006 15:03:25
Messages: 1099
Offline

Hmm, that sure smells like a bug. ObjectID is our internal type for a handle/pointer to clustered object. It should be resolved to a real object before it ever escapes a method like take() or poll() on an LBQ

Any chance you have something that reproduces the issue? That would be the easiest way to debug this :-)

Not that I know what I'll do with this information but what methods do you use for reading/writing this queue? What is the bound? Does the problem go away if you use a larger or smaller capacity?

Tim Eck (terracotta engineer)
lutey

neo

Joined: 03/29/2011 02:28:26
Messages: 1
Offline

I also observed the same exception when using the .toArray() and .iterator() methods on Queue obtained by toolkit.getBlockingQueue():
The exception only occured for elements that had been in the queue before the client was started.

Tested with terracotta 3.4.0_1 and 3.4.1.

Attached is a test class showing the issue:

1. Start local TC server
2. Run all the tests in the class
=> all tests succeed
3. Run all the tests again (without restarting the tc server)
=> testBlockingQueueToArray, testBlockingQueueToArrayNoneDefaultCapacity and testBlockingQueueIterator FAIL

 Filename TerracottaTest.java [Disk] Download
 Description
 Filesize 3 Kbytes
 Downloaded:  119 time(s)

macieq

neo

Joined: 10/14/2011 06:10:43
Messages: 2
Location: Berlin
Offline

I can see that this issue has been fixed: http://jira.terracotta.org/jira/browse/CDV-1580

Can you tell me if it was already released?

I am checking with Terracotta 3.5.2, 3.5.3 and terracotta-toolkit-1.3-runtime 3.3.0 and I still can reproduce this bug.

Best,
Maciej
teck

seraphim
[Avatar]
Joined: 05/24/2006 15:03:25
Messages: 1099
Offline

CDV-1580 is only fixed in our upcoming 3.6.0 release unfortunately.

Tim Eck (terracotta engineer)
macieq

neo

Joined: 10/14/2011 06:10:43
Messages: 2
Location: Berlin
Offline

Thanks for the information. It's not critical for us so we can wait, but it could be nice to preview the queue from maintenance point of view.

In the CDV-1580 ticket it is mentioned: "Feature failure (but usable), workaround available". I couldn't find any Terracota Toolkit API to fetch the object using ObjectID, so does any workaround exist?

Best,
Maciej
teck

seraphim
[Avatar]
Joined: 05/24/2006 15:03:25
Messages: 1099
Offline

Sorry that "serverity" field is very often not properly used. There is no workaround that I know of


Tim Eck (terracotta engineer)
 
Forum Index -> Terracotta Platform
Go to:   
Powered by JForum 2.1.7 © JForum Team