[kepler-dev] Kepler Training Videos/Exercise 1 Problem

Glen Jarvis glen at glenjarvis.com
Tue Apr 24 14:52:45 PDT 2007


Dan,
    Thank you for your suggestions to everyone on the list. I had ran  
into the same difficulties as others. And, your suggestion corrected  
those difficulties. I am now stuck in a beginning exercise.

To anyone:

    I had wanted to get back to the training videos now the other two  
projects I was working on were completed. I wanted to take an initial  
walk through the Developer's Tutorial. I had been following the  
Developer's Tutorial closely:  
http://www.kepler-project.org/Wiki.jsp?page=KeplerDevelopersTutorial

    I initially was running into a difficulty that appeared to be  
specific to JDK1.5 on Mac. However, I was also trying to compile, per  
the directions, both $PTII and $KEPLER directories. From your email to  
others here, I believed I could start fresh (clean $HOME/.kepler/,  
deleting all old directories, and fresh extracts of kepler_beta3).  
And, I was then able to compile the actors that came in that  
directory, and then I was able to finish "Exercise 0."

    However, I have not been able to get past Exercise 1 and am  
completely stuck. I believe the problem may be because the directions  
in Exercise 1 are very stale compared to what has happened in  
development. After creating (attached):

/Users/gjarvis/kepler20070102/src/edu/tutorial/glendemo/HelloWorld.java

the following errors are reported (output.txt is also attached):


[glen-jarvis-computer:~/kepler20070102] gjarvis% ant compile > output.txt

> BUILD FAILED
> /Users/gjarvis/kepler20070102/build.xml:564: Compile failed; see the  
> compiler error output for details.
>
> Total time: 2 seconds


It seems there is a problem importing ptolemy.actor.IOPort (and other  
similar errors):

> [javac] /Users/.../HelloWorld.java:32: package ptolemy.actor does not exist
> [javac] import ptolemy.actor.IOPort;
> [javac]                      ^

Has the ptolemy.actor package moved or renamed? Or, is this as simple  
as an environment variable that I missed? (env output also attached).

Warmest Regards,


Glen Jarvis
-- 
913-486-8775
glen at glenjarvis.com
http://www.glenjarvis.com

"You must be the change you wish to see in the world." -M. Gandhi
-------------- next part --------------
Buildfile: build.xml

preinit:
     [echo] ant is using JDK version: 1.5

checkOS:

win.prep:

lin.prep:
     [echo] Guessing that you are running: Unix

init:

copy-lib-win:

copy-lib-unix:

setcommonclasspath:

prepare:

checkForJ1_4:
     [echo] ${isJava14}

J1_4_Only:

compile:
    [javac] Compiling 2 source files to /Users/gjarvis/kepler20070102/build/classes
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:32: package ptolemy.actor does not exist
    [javac] import ptolemy.actor.IOPort;
    [javac]                      ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:33: package ptolemy.actor does not exist
    [javac] import ptolemy.actor.TypedIOPort;
    [javac]                      ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:34: package ptolemy.data does not exist
    [javac] import ptolemy.data.Token;
    [javac]                     ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:35: package ptolemy.data does not exist
    [javac] import ptolemy.data.StringToken;
    [javac]                     ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:36: package ptolemy.data.type does not exist
    [javac] import ptolemy.data.type.BaseType;
    [javac]                          ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:37: package ptolemy.data.type does not exist
    [javac] import ptolemy.data.type.Type;
    [javac]                          ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:38: package ptolemy.actor does not exist
    [javac] import ptolemy.actor.TypedAtomicActor;
    [javac]                      ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:39: package ptolemy.kernel does not exist
    [javac] import ptolemy.kernel.CompositeEntity;
    [javac]                       ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:50: cannot find symbol
    [javac] symbol: class TypedAtomicActor
    [javac] public class HelloWorld extends TypedAtomicActor {
    [javac]                                 ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:61: cannot find symbol
    [javac] symbol  : class CompositeEntity
    [javac] location: class edu.tutorial.glensdemo.HelloWorld
    [javac]     public HelloWorld(CompositeEntity container, String name)
    [javac]                       ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:62: cannot find symbol
    [javac] symbol  : class NameDuplicationException
    [javac] location: class edu.tutorial.glensdemo.HelloWorld
    [javac]             throws NameDuplicationException, IllegalActionException  {
    [javac]                    ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:62: cannot find symbol
    [javac] symbol  : class IllegalActionException
    [javac] location: class edu.tutorial.glensdemo.HelloWorld
    [javac]             throws NameDuplicationException, IllegalActionException  {
    [javac]                                              ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:82: cannot find symbol
    [javac] symbol  : class TypedIOPort
    [javac] location: class edu.tutorial.glensdemo.HelloWorld
    [javac] public TypedIOPort output = null;
    [javac]        ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:95: cannot find symbol
    [javac] symbol  : class IllegalActionException
    [javac] location: class edu.tutorial.glensdemo.HelloWorld
    [javac]     public void fire() throws IllegalActionException {
    [javac]                               ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:32: package actor does not exist
    [javac] import actor.IOPort;
    [javac]              ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:33: package actor does not exist
    [javac] import actor.TypedIOPort;
    [javac]              ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:34: package ptolemy.data does not exist
    [javac] import ptolemy.data.Token;
    [javac]                     ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:35: package ptolemy.data does not exist
    [javac] import ptolemy.data.StringToken;
    [javac]                     ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:36: package ptolemy.data.type does not exist
    [javac] import ptolemy.data.type.BaseType;
    [javac]                          ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:37: package ptolemy.data.type does not exist
    [javac] import ptolemy.data.type.Type;
    [javac]                          ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:38: package ptolemy.actor does not exist
    [javac] import ptolemy.actor.TypedAtomicActor;
    [javac]                      ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:39: cannot find symbol
    [javac] symbol  : class CompositeEntity
    [javac] location: package ptolemy.kernel
    [javac] import ptolemy.kernel.CompositeEntity;
    [javac]                       ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:50: cannot find symbol
    [javac] symbol: class TypedAtomicActor
    [javac] public class HelloWorld extends TypedAtomicActor {
    [javac]                                 ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:61: cannot find symbol
    [javac] symbol  : class CompositeEntity
    [javac] location: class edu.tutorial.glenspackage.HelloWorld
    [javac]     public HelloWorld(CompositeEntity container, String name)
    [javac]                       ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:62: cannot find symbol
    [javac] symbol  : class NameDuplicationException
    [javac] location: class edu.tutorial.glenspackage.HelloWorld
    [javac]             throws NameDuplicationException, IllegalActionException  {
    [javac]                    ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:62: cannot find symbol
    [javac] symbol  : class IllegalActionException
    [javac] location: class edu.tutorial.glenspackage.HelloWorld
    [javac]             throws NameDuplicationException, IllegalActionException  {
    [javac]                                              ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:82: cannot find symbol
    [javac] symbol  : class TypedIOPort
    [javac] location: class edu.tutorial.glenspackage.HelloWorld
    [javac] public TypedIOPort output = null;
    [javac]        ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:95: cannot find symbol
    [javac] symbol  : class IllegalActionException
    [javac] location: class edu.tutorial.glenspackage.HelloWorld
    [javac]     public void fire() throws IllegalActionException {
    [javac]                               ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:67: cannot find symbol
    [javac] symbol  : class TypedIOPort
    [javac] location: class edu.tutorial.glensdemo.HelloWorld
    [javac]         output = new TypedIOPort(this, "output", false, true);
    [javac]                      ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:70: cannot find symbol
    [javac] symbol  : variable BaseType
    [javac] location: class edu.tutorial.glensdemo.HelloWorld
    [javac]         output.setTypeEquals(BaseType.STRING);
    [javac]                              ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:72: cannot find symbol
    [javac] symbol  : method _attachText(java.lang.String,java.lang.String)
    [javac] location: class edu.tutorial.glensdemo.HelloWorld
    [javac]         _attachText("_iconDescription", "<svg>\n" +
    [javac]         ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:96: cannot find symbol
    [javac] symbol  : variable super
    [javac] location: class edu.tutorial.glensdemo.HelloWorld
    [javac]         super.fire();
    [javac]         ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glendemo/HelloWorld.java:98: cannot find symbol
    [javac] symbol  : class StringToken
    [javac] location: class edu.tutorial.glensdemo.HelloWorld
    [javac]         output.send(0, new StringToken("HelloWorld!"));
    [javac]                            ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:67: cannot find symbol
    [javac] symbol  : class TypedIOPort
    [javac] location: class edu.tutorial.glenspackage.HelloWorld
    [javac]         output = new TypedIOPort(this, "output", false, true);
    [javac]                      ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:70: cannot find symbol
    [javac] symbol  : variable BaseType
    [javac] location: class edu.tutorial.glenspackage.HelloWorld
    [javac]         output.setTypeEquals(BaseType.STRING);
    [javac]                              ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:72: cannot find symbol
    [javac] symbol  : method _attachText(java.lang.String,java.lang.String)
    [javac] location: class edu.tutorial.glenspackage.HelloWorld
    [javac]         _attachText("_iconDescription", "<svg>\n" +
    [javac]         ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:96: cannot find symbol
    [javac] symbol  : variable super
    [javac] location: class edu.tutorial.glenspackage.HelloWorld
    [javac]         super.fire();
    [javac]         ^
    [javac] /Users/gjarvis/kepler20070102/build/src/edu/tutorial/glenspackage/HelloWorld.java:98: cannot find symbol
    [javac] symbol  : class StringToken
    [javac] location: class edu.tutorial.glenspackage.HelloWorld
    [javac]         output.send(0, new StringToken("HelloWorld!"));
    [javac]                            ^
    [javac] 38 errors
-------------- next part --------------
/* HelloWorld actor for getting used to PtolemyII concepts.

 Copyright (c) 1998-2003 The Regents of the University of California.
 All rights reserved.
 Permission is hereby granted, without written agreement and without
 license or royalty fees, to use, copy, modify, and distribute this
 software and its documentation for any purpose, provided that the above
 copyright notice and the following two paragraphs appear in all copies
 of this software.

 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.

 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
 ENHANCEMENTS, OR MODIFICATIONS.

                                        PT_COPYRIGHT_VERSION_2
                                        COPYRIGHTENDKEY
*/

// Exercise#1: ADD THE PACKAGE DESCRIPTION HERE
package edu.tutorial.glensdemo;

// Exercise#1: ADD THE import STATEMENTS HERE
import ptolemy.actor.IOPort;
import ptolemy.actor.TypedIOPort;
import ptolemy.data.Token;
import ptolemy.data.StringToken;
import ptolemy.data.type.BaseType;
import ptolemy.data.type.Type;
import ptolemy.actor.TypedAtomicActor;
import ptolemy.kernel.CompositeEntity;
import ptolemy.kernel.util.*;

//////////////////////////////////////////////////////////////////////////
//// HellowWorld
/**
 * Exercise#1: Add the class description here
 "This is the implementation of a HelloWorld actor using Ptolemy II. This actor outputs "Hello World!" as string from its output port."
@author Glen Jarvis
*/

public class HelloWorld extends TypedAtomicActor {

// Exercise#1: ADD THE CLASS CONSTRUCTOR JAVADOC DESCRIPTION HERE.
 /** Construct a HelloWorld source with the given container and name.
     *  @param name The name of this actor.
     *  @exception IllegalActionException If the entity cannot be contained
     *   by the proposed container.
     *  @exception NameDuplicationException If the container already has an
     *   actor with this name.
     */

    public HelloWorld(CompositeEntity container, String name)
            throws NameDuplicationException, IllegalActionException  {
        super(container, name);
        // Exercise#1: CREATE THE PARAMETER HERE!

        // Exercise#1: CREATE THE OUTPUT HERE...AND SET THE TYPE
        output = new TypedIOPort(this, "output", false, true);

        // Set the type constraint.
        output.setTypeEquals(BaseType.STRING);

        _attachText("_iconDescription", "<svg>\n" +
                "<rect x=\"0\" y=\"0\" "
                + "width=\"60\" height=\"20\" "
                + "style=\"fill:white\"/>\n" +
                "</svg>\n");
    }

    ///////////////////////////////////////////////////////////////////
    ////                     ports and parameters                  ////
// Exercise#1: ADD THE OUTPUT PORT DEFINITION HERE.
public TypedIOPort output = null;


// Exercise#1: ADD THE PARAMETER DEFINITION HERE.

    ///////////////////////////////////////////////////////////////////
    ////                         public methods                    ////

// Exercise#1: ADD THE JAVADOC DESCRIPTION FOR THE FIRE METHOD HERE.
/** Send the token in the value  parameter to the output.
    *  @exception IllegalActionException If it is thrown by the
    *   send() method sending out the token.
    */
    public void fire() throws IllegalActionException {
        super.fire();
 // Exercise#1: ADD THE LINE TO SEND THE greeting message FROM THE OUTPUT PORT.
        output.send(0, new StringToken("HelloWorld!"));
    }
}

-------------- next part --------------
TERM_PROGRAM=Apple_Terminal
TERM=xterm-color
SHELL=/bin/bash
TERM_PROGRAM_VERSION=133
OLDPWD=/Users/gjarvis/kepler20070102/src/edu/tutorial
USER=gjarvis
__CF_USER_TEXT_ENCODING=0x1F5:0:0
PATH=/bin:/sbin:/usr/bin:/usr/sbin
PWD=/Users/gjarvis/kepler20070102/src/edu/tutorial/glendemo
SHLVL=2
HOME=/Users/gjarvis
LOGNAME=gjarvis
SECURITYSESSIONID=b86620
_=/bin/csh
HOSTTYPE=intel-pc
VENDOR=apple
OSTYPE=darwin
MACHTYPE=i386
GROUP=gjarvis
HOST=glen-jarvis-computer.local
KEPLER=/Users/gjarvis/kepler20070102/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HelloWorldManifest.zip
Type: application/zip
Size: 1846 bytes
Desc: not available
Url : http://mercury.nceas.ucsb.edu/ecoinformatics/pipermail/kepler-dev/attachments/20070424/53a9a1ab/HelloWorldManifest-0001.zip


More information about the Kepler-dev mailing list