[kepler-dev] Getting exception when using PNDirector
Christopher Brooks
cxh at eecs.berkeley.edu
Mon Jan 9 08:03:43 PST 2012
Hi Ravi,
You need to call _top.preinitialize() and _top.initialize() first.
I modified CompositeProcessDirector so that if _inputBranchController is
null, then an InternalErrorException is thrown:
Exception in thread "main" ptolemy.kernel.util.InternalErrorException:
_inputBranchController was null\
? Perhaps initialize() was not called?
in .top.<Unnamed Object>
at
ptolemy.actor.process.CompositeProcessDirector._resolveDeadlock(CompositeProcessDirector.ja\
va:701)
at
ptolemy.actor.process.ProcessDirector.fire(ProcessDirector.java:259)
at ptolemy.actor.CompositeActor.fire(CompositeActor.java:458)
at test.BowtieTest.init(BowtieTest.java:65)
at test.BowtieTest.main(BowtieTest.java:18)
See ptolemy/moml/MoMLSimpleApplication.java for how to use
ptolemy/actor/Manager.java to run your model:
_manager = new Manager(_toplevel.workspace(),
"MoMLSimpleApplication");
_toplevel.setManager(_manager);
_toplevel.addChangeListener(this);
_manager.addExecutionListener(this);
_activeCount++;
_manager.startRun();
Thread waitThread = new UnloadThread();
// Note that we start the thread here, which could
// be risky when we subclass, since the thread will be
// started before the subclass constructor finishes (FindBugs)
waitThread.start();
waitThread.join();
if (_sawThrowable != null) {
throw _sawThrowable;
}
For information about initialize(), see Chapter 5, Designing Actors,
page 178 of Volume 1 of the Ptolemy Design Docs at
http://ptolemy.eecs.berkeley.edu/ptolemyII/designdoc.htm
_Christopher
On 1/9/12 5:17 AM, Ravi Kumar wrote:
>
> Hi All,
>
> I am trying to create and run a workflow programmatically. I have
> created one and able to run if I use SDF director. But not able to run
> this using PNDirector. When I export the workflow in xml using
> *exportMoML()* method and open the xml file in kepler, it runs properly.
>
> Following error I am getting when trying to execute workflow
> programmatically using PNDirector.
>
> **
>
> Exception in thread "main" _java.lang.NullPointerException_
>
> at
> ptolemy.actor.process.CompositeProcessDirector._resolveDeadlock(_CompositeProcessDirector.java:699_)
>
> at
> ptolemy.actor.process.ProcessDirector.fire(_ProcessDirector.java:259_)
>
> at ptolemy.actor.CompositeActor.fire(_CompositeActor.java:459_)
>
> at test.BowtieTest.init(_BowtieTest.java:64_)
>
> at test.BowtieTest.main(_BowtieTest.java:18_)**
>
> I am not able to find out root cause for this. Any help on this would
> be really helpful.
>
> Regards,
>
> Ravi
>
> DISCLAIMER ========== This e-mail may contain privileged and
> confidential information which is the property of Persistent Systems
> Ltd. It is intended only for the use of the individual or entity to
> which it is addressed. If you are not the intended recipient, you are
> not authorized to read, retain, copy, print, distribute or use this
> message. If you have received this communication in error, please
> notify the sender and delete all copies of this message. Persistent
> Systems Ltd. does not accept any liability for virus infected mails.
>
>
>
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at kepler-project.org
> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
--
Christopher Brooks, PMP University of California
CHESS Executive Director US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust Berkeley, CA 94720-1774
ph: 510.643.9841 (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 cell: 707.332.0670
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20120109/a4394154/attachment-0001.html>
More information about the Kepler-dev
mailing list