I am having a problem writing a Ptolemy actor and need some help.

I am writing RangeReader.java, an actor to read a range from an Excel
spreadsheet.  I based it on FileReader in ptolemy.actor.lib.io.  I am using
the Apache POI/HSSF from http://jakarta.apache.org/poi/index.html to read
the file.  The file compiles, but when I use the actor in Vergil, I get a
NoClassDefFoundError in the line:

  POIFSFileSystem fs = new POIFSFileSystem (in);

This line is straight out of the POI/HSSF samples.  The file I am opening
exists.  I tested with an incorrect filename and got an different exception
in a previous line.

I think the error means that it found the class at compile time, but not at
run time.  Is there something I need to do so that Ptolemy will find the POI
.jar file?

I put RangeReader.java in C:\Ptolemy\ptII5.0-beta\ptolemy\actor\lib\io and I
put the POI directory in C:\Ptolemy\ptII5.0-beta.  I compile with:

  javac -classpath
c:\Ptolemy\ptII5.0-beta\poi\poi-2.5.1-final-20040804.jar;c:\Ptolemy\ptII5.0-
beta RangeReader.java

I'm a lifelong c/c++ programmer and new to Java.  I suspect this is a simple
problem that an experienced Java programmer can solve easily.

The whole stack trace is:

ptolemy.kernel.util.IllegalActionException:   in.range.manager
Because: org/apache/poi/poifs/filesystem/POIFSFileSystem
        at ptolemy.actor.Manager.execute(Manager.java:383)
        at ptolemy.actor.Manager.run(Manager.java:951)  at
ptolemy.actor.Manager$2.run(Manager.java:1003) 
Caused by: java.lang.NoClassDefFoundError:
org/apache/poi/poifs/filesystem/POIFSFileSystem
        at ptolemy.actor.lib.io.RangeReader.fire(RangeReader.java:123)
        at ptolemy.domains.de.kernel.DEDirector.fire(DEDirector.java:506)
        at ptolemy.actor.CompositeActor.fire(CompositeActor.java:329)
        at ptolemy.actor.Manager.iterate(Manager.java:601)      at
ptolemy.actor.Manager.execute(Manager.java:319)         ... 2 more 
Caused by: java.lang.NoClassDefFoundError:
org/apache/poi/poifs/filesystem/POIFSFileSystem
        at ptolemy.actor.lib.io.RangeReader.fire(RangeReader.java:123)
        at ptolemy.domains.de.kernel.DEDirector.fire(DEDirector.java:506)
        at ptolemy.actor.CompositeActor.fire(CompositeActor.java:329)
        at ptolemy.actor.Manager.iterate(Manager.java:601)      at
ptolemy.actor.Manager.execute(Manager.java:319)
        at ptolemy.actor.Manager.run(Manager.java:951) 


Thanks in advance for any help you can give me.

Wayne Goode, SAIC, Huntsville, AL

----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to