Home Help Center

Can't figure out why the Printer autogenerated files are not compiling

caos1234caos1234 Member Carlos HurtadoOrganization: U de ChileProject: Sixbell
Hello, I'm just starting with ice, but I have an issue compiling the sample Printer.ice file after I use slice2java which works fine.

I'm doing the following:
$ slice2java Printer.ice --output-dir=generated

where Printer.ice is:
module Demo {
    interface Printer {
        void printString(string s);
    };
};

after that I compile using the following line:
javac -d classes -classpath classes:/usr/share/java/Ice.jar -source 1.4 generated/Demo/*.java 
So i'm just compiling the autogenerated files (no files made by me)
And I get the following 9 errors:
generated/Demo/_PrinterDelD.java:18: cannot resolve symbol
symbol  : class LocalExceptionWrapper 
location: package IceInternal
        throws IceInternal.LocalExceptionWrapper
                          ^
generated/Demo/_PrinterDel.java:17: cannot resolve symbol
symbol  : class LocalExceptionWrapper 
location: package IceInternal
        throws IceInternal.LocalExceptionWrapper;
                          ^
generated/Demo/_PrinterDelM.java:18: cannot resolve symbol
symbol  : class LocalExceptionWrapper 
location: package IceInternal
        throws IceInternal.LocalExceptionWrapper
                          ^
generated/Demo/_PrinterDelD.java:47: cannot resolve symbol
symbol  : class LocalExceptionWrapper 
location: package IceInternal
                    throw new IceInternal.LocalExceptionWrapper(__ex, false);
                                         ^
generated/Demo/_PrinterDelM.java:50: cannot resolve symbol
symbol  : class LocalExceptionWrapper 
location: package IceInternal
                throw new IceInternal.LocalExceptionWrapper(__ex, false);
                                     ^
generated/Demo/PrinterPrxHelper.java:35: cannot resolve symbol
symbol  : class LocalExceptionWrapper 
location: package IceInternal
            catch(IceInternal.LocalExceptionWrapper __ex)
                             ^
generated/Demo/PrinterPrxHelper.java:98: cannot resolve symbol
symbol  : method ice_facet (java.lang.String)
location: interface Ice.ObjectPrx
            Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
                                      ^
generated/Demo/PrinterPrxHelper.java:121: cannot resolve symbol
symbol  : method ice_facet (java.lang.String)
location: interface Ice.ObjectPrx
            Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
                                      ^
generated/Demo/PrinterPrxHelper.java:157: cannot resolve symbol
symbol  : method ice_facet (java.lang.String)
location: interface Ice.ObjectPrx
            Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
                                      ^
9 errors

Weirdly, i had no problem compiling the C++ example.
Any ideas? if you need any more information please reply. Thanks

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi Carlos,

    Welcome to the forum!

    I tried to reproduce your errors on Linux with Ice 3.2.0 and Java5, but everything worked fine. You have verified that /usr/share/java/Ice.jar actually exists and has the necessary permission settings?

    If you're still having trouble, please provide a detailed description of your environment (OS version, Ice version, Java version, etc.).

    Take care,
    - Mark
  • caos1234caos1234 Member Carlos HurtadoOrganization: U de ChileProject: Sixbell
    i'm using java 1.4
    javac : /usr/lib/j2se/1.4/bin/javac

    (java -version)
    java version "1.4.2-02"
    Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.4.2-02)
    Java HotSpot(TM) Client VM (build Blackdown-1.4.2-02, mixed mode)


    Ice.jar exists. I've chmoded it to 777 and it still happens
    If i don't use Ice.jar as a classpath, I get about 71 errors (cause it doesn't find Ice objects)

    ice:3.1.0
    ubuntu edgy (i know 3.2 is not supported, so i donwloaded the latest supported version from ubuntu's repositories using apt-get)

    Really hope you can help me, cause i'm stuck.

    Thanks!
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    I suspect that the Ice.jar file you are using is from an older (pre-3.1.0) version of Ice, since the LocalExceptionWrapper and ice_facet symbols were added in Ice 3.1.0. You can verify the Ice version of a translator by running

    $ slice2java -v

    To verify the version of Ice.jar, compile and run the following program:
    public class IceVersion
    {
        public static void main(String[] args)
        {
            System.out.println(IceUtil.Version.ICE_STRING_VERSION);
        }
    }
    
    Hope that helps,
    - Mark
  • caos1234caos1234 Member Carlos HurtadoOrganization: U de ChileProject: Sixbell
    One step to go

    You were right. The Ice.jar version is 3.0.1
    Could you help me with where I could download a 3.1.0 version of Ice.jar?
    I appreciate it a lot.
    Thanks
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Ice downloads

    Hi caos1234 go to
    http://www.zeroc.com/download/Ice/3.0/
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    caos1234 wrote: »
    Could you help me with where I could download a 3.1.0 version of Ice.jar?
    I'm not sure how things are structured in the Ice packages for Ubuntu, but on Fedora and RHEL you would need to install the ice-java and ice-java-devel RPMs. If you can't find the correct package, you can download this file:

    IceJ-3.1.0-java2.tar.gz

    Take care,
    - Mark
  • caos1234caos1234 Member Carlos HurtadoOrganization: U de ChileProject: Sixbell
    Thank you very much

    I really appreciate your help
    Now i can go on and do some work on some Ice thingies :)

    bye!
Sign In or Register to comment.