Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 11-15-2007
kwaclaw kwaclaw is offline
Registered User
 
Name: Karl Waclawek
Organization: Toronto Star Newspapers Ltd.
Project: Proof of concept
 
Join Date: Sep 2004
Location: Oshawa, Canada
Posts: 136
Ice 3.2.1: Java stream helper functions

I compiled some slice IDL with slice2java using the --stream option.
The resulting code does not compile. It might be my fault, but I don't know how to solve it.

The IDL in question is:

Code:
  struct Prop {
    int Index;
    Ice::ByteSeq Value;
  };
The last two methods in the generated code below do not compile, as it seems their parameter (of type InputStream or OutputStream) does not match the parameter type needed to pass to ByteSeqHelper.read/write:
(I have marked the problem spots with a comment)


Code:
public final class Prop implements java.lang.Cloneable
{
    public int Index;

    public byte[] Value;

    . . . 

    public void
    __write(IceInternal.BasicStream __os)
    {
        __os.writeInt(Index);
        Ice.ByteSeqHelper.write(__os, Value);
    }

    public void
    __read(IceInternal.BasicStream __is)
    {
        Index = __is.readInt();
        Value = Ice.ByteSeqHelper.read(__is);
    }

    public void
    ice_write(Ice.OutputStream __outS)
    {
        __outS.writeInt(Index);
        Ice.ByteSeqHelper.write(__outS, Value);  // issue here
    }

    public void
    ice_read(Ice.InputStream __inS)
    {
        Index = __inS.readInt();
        Value = Ice.ByteSeqHelper.read(__inS);  // issue here
    }

Karl
__________________
Karl Waclawek
The Toronto Star - http://www.thestar.com
Reply With Quote
  #2 (permalink)  
Old 11-15-2007
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 909
Thanks for the bug report Karl, I'll have a look at this.

Cheers,

Michi.
Reply With Quote
  #3 (permalink)  
Old 11-15-2007
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 909
Hi Karl,

the problem arises because BuiltinSequences.ice is not compiled with the --stream option. As a result, the generated Helper class does not have the method to marshal the stream, and you get the compilation error.

One way to solve this is to recompile BuiltinSequences.ice with --stream and to rebuild the Ice.jar file.

Another way would be to not use Ice::ByteSeq and instead define your own byte sequence type, which you compile with --stream.

Cheers,

Michi.
Reply With Quote
  #4 (permalink)  
Old 11-15-2007
kwaclaw kwaclaw is offline
Registered User
 
Name: Karl Waclawek
Organization: Toronto Star Newspapers Ltd.
Project: Proof of concept
 
Join Date: Sep 2004
Location: Oshawa, Canada
Posts: 136
Quote:
Originally Posted by michi View Post
Hi Karl,

the problem arises because BuiltinSequences.ice is not compiled with the --stream option. As a result, the generated Helper class does not have the method to marshal the stream, and you get the compilation error.

One way to solve this is to recompile BuiltinSequences.ice with --stream and to rebuild the Ice.jar file.

Another way would be to not use Ice::ByteSeq and instead define your own byte sequence type, which you compile with --stream.

Cheers,

Michi.
I understand. I am using only a few built-in Slice types, so it's not much
work to throw them out.

Thanks,

Karl
__________________
Karl Waclawek
The Toronto Star - http://www.thestar.com
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
Helper Classes not Generated zhi Help Center 5 01-04-2007 08:18 AM
How do I use Ice to process stream hyz1840 Help Center 3 05-25-2006 08:19 AM
Stream helper functions and C++ templates copton Help Center 7 01-20-2006 03:37 PM
Java Object Output Stream and Ice brian Help Center 8 10-31-2005 11:18 AM
Generated Java Helper class has errors ygarbourg Help Center 2 05-06-2005 03:13 PM


All times are GMT -4. The time now is 07:49 PM.


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.