[kepler-dev] Kepler compilation problem

Xiaowen Xin xin2 at llnl.gov
Mon Mar 8 13:28:14 PST 2004


Hi Everyone,

I have a compilation problem with Kepler.

The error message is:

    [javac] Compiling 108 source files to /home/xiaowen/kepler/build/classes
    [javac] /home/xiaowen/kepler/build/src/com/numericsolutions/geomodeltools/DensityGridActor.java: In class `com.numericsolutions.geomodeltools.DensityGridActor':
    [javac] /home/xiaowen/kepler/build/src/com/numericsolutions/geomodeltools/DensityGridActor.java: In method `finit$()':
    [javac] /home/xiaowen/kepler/build/src/com/numericsolutions/geomodeltools/DensityGridActor.java:58: error: Exception `ptolemy.kernel.util.IllegalActionException' can't be thrown in initializer.
    [javac]       public TypedIOPort inDataFile = new TypedIOPort(this, "inDataFile", true,
    [javac]                                           ^
    [javac] /home/xiaowen/kepler/build/src/com/numericsolutions/geomodeltools/DensityGridActor.java:58: error: Exception `ptolemy.kernel.util.NameDuplicationException' can't be thrown in initializer.
    [javac]       public TypedIOPort inDataFile = new TypedIOPort(this, "inDataFile", true,
    [javac]                                           ^

followed by a few more errors similar to this one.

The relevant lines in DensityGridActor.java are:

55 public class DensityGridActor extends TypedAtomicActor
56 {
57   //input ports
58    public TypedIOPort inDataFile = new TypedIOPort(this, "inDataFile", true,
59      false);
60    public TypedIOPort radius = new TypedIOPort(this, "radius", true, false);
61    public TypedIOPort xmin = new TypedIOPort(this, "xmin", true, false);
62    public TypedIOPort xmax = new TypedIOPort(this, "xmax", true, false);
63    public TypedIOPort ymin = new TypedIOPort(this, "ymin", true, false);
64    public TypedIOPort ymax = new TypedIOPort(this, "ymax", true, false);

and the relevant lines in TypedIOPort.java are:

169     public TypedIOPort(ComponentEntity container, String name,
170             boolean isInput, boolean isOutput)
171             throws IllegalActionException, NameDuplicationException {
172         super(container, name, isInput, isOutput);
173     }

So it looks like the initialization of these instance variables might cause
an exception to be thrown, and since these are checked exceptions, and no
mechanism is in place to catch them, the compilation fails.  This same code
compiles on someone else's computer without a hitch, so does anyone see
what could be different on my machine?

Thanks for the help,
Xiaowen



More information about the Kepler-dev mailing list