Line 437 in ptolemy.actor.CompositeActor is marked below
                    if (port.isInput()) {
                        // Clear all receivers.
                        Receiver[][] receivers = port.getReceivers();
--->                    for (int i = 0; i < receivers.length; i++) {
                            Receiver[] receivers2 = receivers[i];
                            for (int j = 0; j < receivers2.length; j++) {
                                receivers2[j].clear();
                            }
                        }
                    }
                }
            }

IOPort.getReceivers() is presumably returning null, which it should
not do.  I would start debugging there.
You could hack around this by doing:
                   for (int i = 0; receivers != null && i < receivers.length; i++) {

but the problem is likely to bite you elsewhere.

I would guess that you are having some sort of problem with ports
in a CompositeActor that has a DEDirector?

It looks like you have parsed the model and are running it.
One thing to try would be to call exportMoML() on the
toplevel model after parsing your XML file and then print out
the contents

    System.out.println(foo.exportMoML());

You could then try re-reading the output and see if you get a parse
error.

BTW - Mail to the mailing list gets sent to the newsgroup, but
newsgroup posts do not get sent to the mailing list.

I read the newsgroup every day or so and respond to messages as I see
fit, some of them I cc the mailing list, some of them I only post
to the newsgroup

-Christopher
--------

    [I previously posted this to the newsgroup, but it didn't make it to the ma
   iling list ...]
    
    I'm trying to initialize and run a Ptolemy model generated by XSLT
    from an existing XML description of an experiment (not a MoML file). 
    When I try to run the model, I get the error:
    
    java.lang.NullPointerException
     at ptolemy.actor.CompositeActor.initialize(CompositeActor.java:437)
     at ptolemy.domains.de.kernel.DEDirector.initialize(DEDirector.java:721)
     at ptolemy.actor.CompositeActor.initialize(CompositeActor.java:464)
     at ptolemy.actor.Manager.initialize(Manager.java:420)
     at ptolemy.actor.Manager.execute(Manager.java:277)
     at ptolemy.actor.Manager.run(Manager.java:831)
     at ptolemy.actor.Manager$1.run(Manager.java:880)
    
    I suspect the error lies in my generated XML code, and not in Ptolemy,
    but I'm having trouble tracking it down.  (The generated code includes
    several Ptolemy actors that execute okay outside of the model, so it's
    most likely an "integration bug".)  What sorts of errors in the MoML
    file might cause this exception?
    
    ALZ
    
    -----
    Andrew Zimdars
    Modeling, Simulation, and Information Sciences (Org. ABCS)
    Advanced Technology Center, Lockheed Martin Space Systems Co.
    Bldg. 153, Col. 2J4
    1111 Lockheed Martin Way, Sunnyvale, CA  94089
    
    w: 408.742.2111 m: 510.915.0662
    
    ---------------------------------------------------------------------------
   -
    Posted to the ptolemy-hackers mailing list.  Please send administrative
    mail for this list to: [EMAIL PROTECTED]
--------

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

Reply via email to