Archived

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

Unable to compile Java Demo: unknown symbol "method throwUnknownWrapper"

Hi,

I'm trying to build the Java HelloWorld demo as per the instructions in the documentation, section 3.4. However, when I try to compile the generated classes, I get a ton of errors such as:
generated/Demo/_PrinterDelD.java:64: cannot find symbol
symbol  : method throwUnknownWrapper(java.lang.Throwable)
location: class IceInternal.LocalExceptionWrapper
                IceInternal.LocalExceptionWrapper.throwUnknownWrapper(__ex);

This is on OS X, using the Ice 3.2.1 packages provided by MacPorts. I use the following commands to generate/compile:
slice2java --output-dir generated Printer.ice
 javac -d classes -classpath classes:/opt/local/share/java/Ice.jar -source 1.5 Server.java PrinterI.java generated/Demo/*.java

I've tried with -source 1.4 as well, but then I get a bunch of
generics are not supported in -source 1.4
 ...

errors, so that's not any better.

Note that I'm a total noob in Java. I've written an Ice Application in C++ for which I want to expose some of the interfaces to Java for our web guys to use. When I tried to build a simple client based on my Slice definitions I got the exact same symbol errors. At that point I tried to see if I would fare any better with the demo, but no such luck. I did however check that the versions of slice2java and Ice.jar are the same (the latter using the program you've provided in this post).

Apologies in advance if the question is exceedingly stupid.

Any suggestions?

Many thanks
-stefan

Comments

  • This looks like you are using a slice2java from Ice 3.3b and compiling the generated code against the 3.2.1 run time. 3.3b and 3.2.1 are binary incompatible, so this cannot work.

    Can you check that your are using a slice2java that matches the run time version of Ice.jar?

    Cheers,

    Michi.