Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-03-2005
csammis's Avatar
csammis csammis is offline
Registered User
 
 
Join Date: Jul 2005
Location: Des Moines, IA
Posts: 3
UnmarshalOutOfBoundsException when sending byte sequences

I'm using Ice 2.1.0 on SunOS. I have an application where the client and server will be exchanging sequences of bytes. Both client and server are being built from the same Slice defintion.

My client code:
Code:
//// A proxy to the server, sg, and the ByteSeq, bs, are both being created successfully ////
// Set the new geometry
sg->setGeometry(bs);
cout << "Set geometry (" << bs.size() << " bytes) for segment " << name << endl;
My server code:
Code:
virtual void setGeometry(const ByteSeq &geom,const Ice::Current &)
{
    cout << "Setting geometry, size " << geom.size() << " bytes" << endl;
    geometry = geom;
}
The relevent Slice code:
Code:
sequence<byte> ByteSeq;
...
interface SegmentI {
    ...
    void setGeometry(ByteSeq geom);
    ...
};
...
class PersistentPsu implements SegmentI {
    ...
    ByteSeq geometry;
};
When the client runs, it prints its message "Set geometry ......" successfully, but then dies with a Bus Error. The server does not print its message, but dies with the message 'terminate called after throwing an instance of 'Ice::UnmarshalOutOfBoundsException'

Does anyone have any ideas as to what might be causing this?
__________________
Chris Sammis
CSSM, http://www.cssm.iastate.edu
Reply With Quote
  #2 (permalink)  
Old 08-03-2005
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 751
I don't see anything suspicious in your code fragments. Can you post a simple (and complete) test case that reproduces this crash?

Thanks,
Bernard
Reply With Quote
  #3 (permalink)  
Old 08-03-2005
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,762
The first thing you should check is if your server and client are indeed using the same Slice definitions. In most cases, and UnmarshalOutOfBoundsException is caused by the client and the server using different interface and type definitions.
Reply With Quote
  #4 (permalink)  
Old 08-03-2005
csammis's Avatar
csammis csammis is offline
Registered User
 
 
Join Date: Jul 2005
Location: Des Moines, IA
Posts: 3
Well, problem solved. The client and server applications were using the same Slice definitions, but our application uses Freeze, and the Berkeley database was initialized by an application with an older version of the Slice file now in use; specifically, the datatypes for the geometry information were different. When the server went to commit the newly updated information to the database, it couldn't be unmarshaled correctly and thus the server threw the exception.

Thanks for your help on this.
__________________
Chris Sammis
CSSM, http://www.cssm.iastate.edu
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Patch #6 for Ice 3.1.0: byte sequences in dictionaries dwayne Patches 1 07-31-2006 09:35 AM
UserException but catches Ice.UnmarshalOutOfBoundsException David Help Center 1 06-15-2006 10:35 AM
UnmarshalOutOfBoundsException Xlinthisias Help Center 6 02-14-2006 12:53 AM
Newbie question about sending data AlexKom Help Center 11 07-18-2005 03:37 PM
Sending Broadcast-like messages aroan Help Center 2 12-27-2004 12:10 PM


All times are GMT -4. The time now is 04:48 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.