Re: Problem with 6.3 - Application Example: Collaborative Example (in Developer's Guide)

  • To: Vimal Gopal <gopal@xxxxxxx>
  • Subject: Re: Problem with 6.3 - Application Example: Collaborative Example (in Developer's Guide)
  • From: Bill Hibbard <hibbard@xxxxxxxxxxxxxxxxx>
  • Date: Fri, 07 Jul 2000 12:40:47 -0500
Hi Gopal,

> I copied the code in section 6.3 (Application Example: Collaborative
> Example), and I am getting an unusual runtime error.  Here is the error:
> 
> Exception in thread "main" visad.TypeException: FunctionType: domain must be
> RealTupleType or RealType
>         at visad.FunctionType.<init>(FunctionType.java:76)
>         at reader2.<init>(reader2.java:26)
>         at reader2.main(reader2.java:73)
> 
> Here's the code as I wrote it:
> 
> public class reader2
> {
>     private RealType reala, realb, realc;  //note that these three variables
> have been declared as 'ReaTypes'
>     private DisplayImpl display1;
>     private GraphicsModeControl mode;
> 
>     private DataReferenceImpl ref_real, ref_real_tuple, ref_field;
> 
>     public reader2() throws VisADException, RemoteException
>     {
>         FunctionType field_type = new FunctionType(reala, realb);  //this is
> line 26, and this is where it complains
> . . .
> What could be causing this problem?  The according what I've written, reala,
> realb, and realc *are* RealTypes.

Sorry that Section 6.3 isn't more clear.  reala is declared
as a RealType but not constructed as one in the code 'fragment'
in 6.3.  So reala is null in the FunctionType constructor and
that causes the Exception.

Please add:

    reala = new RealType("reala");
    realb = new RealType("realb");
    realc = new RealType("realc");

at the start of your reader2() method.

Also, your ScalarMaps are all for 'reala'.  Please change them to:

    display1.addMap(new ScalarMap(reala, Display.XAxis));
    display1.addMap(new ScalarMap(realb, Display.YAxis));
    display1.addMap(new ScalarMap(realc, Display.ZAxis));

To experiment with this collaboration logic, you might
be better off starting with Test14.java and Test15.java
in the visad/examples directory.  Also, I think Dave
Glowacki will release his collaboration tutorial next
week that will include soem nice examples to start from.

Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html