[kaffe] javac error on simple rmi test program

tlewis at mindspring.com tlewis at mindspring.com
Sun Aug 10 10:03:02 PDT 2003


I'm having a problem compiling a simple RMI example from Sun.  JDK1.1 has
no problem with it.

I'm happy to supply the rest of the project if need be, but I'm unclear on
what could be the problem, and I hate to drown the list with unneeded info.
I'm a java newbie (I'm working on a transaction server in C and am looking
into supporting JTS), and so I may be overlooking something trivial and
dumb.  However, for my sake, a simple line number reference to the exception
would have helped a lot.

I have yet to get an RMI example working under kaffe; I am hoping to be
able to do so, since I don't want to use unfree software and will rather
wait on the support I need from kaffe or gcj than use the JDK.

Any ideas or suggestions are welcome.  Feel free to mail me privately if need
be.

######################################################################
############################### ERROR ################################
######################################################################

% /usr/lib/kaffe/bin/javac -v CalculatorServer.java
[ start compilation in verbose mode ]
[ parsed CalculatorServer.java in 386 ms ]
[ checked interfaces in 258 ms ]
java.lang.ArrayIndexOutOfBoundsException
        at at.dms.kjc.CClassOrInterfaceType.getArguments(CClassOrInterfaceType.java:180)
        at at.dms.kjc.CClass.descendsFrom(CClass.java:406)
        at at.dms.kjc.CReferenceType.isAssignableTo(CReferenceType.java:259)
        at at.dms.kjc.CReferenceType.isAssignableTo(CReferenceType.java:236)
        at at.dms.kjc.CReferenceType.isAssignableTo(CReferenceType.java:225)
        at at.dms.kjc.JExpression.isAssignableTo(JExpression.java:270)
        at at.dms.kjc.JVariableDefinition.analyse(JVariableDefinition.java:140)
        at at.dms.kjc.JVariableDeclarationStatement.analyse(JVariableDeclarationStatement.java:99)
        at at.dms.kjc.JBlock.analyse(JBlock.java:88)
        at at.dms.kjc.JTryCatchStatement.analyse(JTryCatchStatement.java:86)
        at at.dms.kjc.JBlock.analyse(JBlock.java:88)
        at at.dms.kjc.JConstructorBlock.analyse(JConstructorBlock.java:126)
        at at.dms.kjc.JConstructorDeclaration.checkBody1(JConstructorDeclaration.java:143)
        at at.dms.kjc.JClassDeclaration.compileConstructors(JClassDeclaration.java:551)
        at at.dms.kjc.JClassDeclaration.checkTypeBody(JClassDeclaration.java:460)
        at at.dms.kjc.JCompilationUnit.checkBody(JCompilationUnit.java:248)
        at at.dms.kjc.Main.checkBody(Main.java:417)
        at at.dms.kjc.Main.run(Main.java:187)
        at at.dms.kjc.Main.compile(Main.java:69)
        at at.dms.kjc.Main.main(Main.java:60)

######################################################################
############################## VERSION ###############################
######################################################################

% dpkg -l `dpkg -S /usr/lib/kaffe/bin/javac|awk -F: '{print $1}'`
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name          Version                 Description
+++-=============-=======================-============================
ii  kaffe         1.0.7-3                 A JVM to run Java bytecode

######################################################################
############################## SOURCE ################################
######################################################################

**********************************************************************
// Taken from: http://developer.java.sun.com/developer/onlineTraining/rmi/RMI.html#RMIImplementations

import java.rmi.Naming;

public class CalculatorServer {

   public CalculatorServer() {
     try {
       Calculator c = new CalculatorImpl();
       Naming.rebind("rmi://127.0.0.1:1099/CalculatorService", c);
     } catch (Exception e) {
       System.out.println("Trouble: " + e);
     }
   }

   public static void main(String args[]) {
     new CalculatorServer();
   }
}
**********************************************************************

--
Todd Lewis
tlewis at mindspring.com






More information about the kaffe mailing list