Archived

This forum has been archived. Please start a new discussion on GitHub.

errors with "Greeting" classes while compiling the demo sources

Hi

I try to compile the Ice-3.3.1 "demos" release but errors occur during the ant job...

here are the error messages:

[javac] Compiling 3 source files to /home/yohann/Bureau/tmp/Ice-3.3.1/java/demo/Ice/serialize/classes
    [javac] /home/yohann/Bureau/tmp/Ice-3.3.1/java/demo/Ice/serialize/Client.java:91: cannot find symbol
    [javac] symbol  : method sendGreeting(Demo.MyGreeting)
    [javac] location: interface Demo.GreetPrx
    [javac]             greet.sendGreeting(nullGreeting);
    [javac]                  ^
    [javac] /home/yohann/Bureau/tmp/Ice-3.3.1/java/demo/Ice/serialize/Client.java:95: cannot find symbol
    [javac] symbol  : method sendGreeting(Demo.MyGreeting)
    [javac] location: interface Demo.GreetPrx
    [javac]                 greet.sendGreeting(greeting);
    [javac]                      ^
    [javac] /home/yohann/Bureau/tmp/Ice-3.3.1/java/demo/Ice/serialize/GreetI.java:12: GreetI is not abstract and does not override abstract method sendGreeting(byte[],Ice.Current) in Demo._GreetOperations
    [javac] public class GreetI extends _GreetDisp
    [javac]        ^
    [javac] 3 errors


cause of the 2 first errors:
the "sendGreeting" method expects a "Greeting" object as argument.
But the "nullGreeting" argument (first error message) and the "greeting" argument (second error message) are both "MyGreeting" objects...
and the "MyGreeting" class doesn't extend the "Greeting" class! :D


cause of the third error:
the "GreetI" class implements the "_GreetOperations.sendGreeting" method but while the interface defines a "byte[]" as first argument, the "GreetI.sendGreeting" method is declared with a "MyGreeting" object as first argument (besides, why a "MyGreeting" and not a "Greeting" object for this method?... :confused: )


could you send me a message please when a corrected release will be available? :)

thank you


Yohann

Comments

  • dwayne
    dwayne St. John's, Newfoundland
    Are you sure you are using the 3.3.1 version of slice2java? The errors you are seeing would indicate that you are not.
  • Hi,

    thank you for your quick reply.

    But I don't understand why the problems could be caused by a bad version of slice2java...

    let's take a look at the Ice-3.3.1-demos.tar.gz from the "download" page (without having run "ant" nor directly used "slice2java").

    In the directory "Ice-3.3.1-demos/demoj/Ice/serialize" there is a "Client.java" file.
    In this file, line 91 and line 95, the "sendGreeting" method of a "GreetPrx" object is invoked with a "MyGreeting" object as argument (defined in there Ice-3.3.1-demos/demoj/Ice/serialize/Demo/MyGreeting.java).
    But in the "Ice-3.3.1-demos/demoj/Ice/serialize/Greet.ice" file the "sendGreeting" method is defined with a "sequence<byte>" as argument...
    So how the "sendGreeting" method in "Client.java" could accept a "MyGreeting" object instead of a java equivalent of ICE "sequence<byte>"?

    that was the first and second errors...
    for the third one the problem is the same:

    The "GreetI.java" you give (in "Ice-3.3.1-demos/demoj/Ice/serialize") extends well the "_GreetDisp" class and so should implements the "sendGreeting" method (still defined in the "Ice-3.3.1-demos/demoj/Ice/serialize/Greet.ice" file).
    But in the code of the "GreetI.java" class the "sendGreeting" method is defined with a "MyGreeting" argument, instead of a java equivalent of ICE "sequence<byte>".

    How that could work?
  • dwayne
    dwayne St. John's, Newfoundland
    The demo show how to transmit serializable java classes with Ice. This feature was only added in Ice 3.3.1, thus older versions of slice2java will not work. Please read the README in the demo directory or check the manual for more information on this feature.
  • ... well, nice...
    and about my question?
  • matthew
    matthew NL, Canada
    I'm sorry, but I don't understand. What question do you think Dwayne didn't answer?