Chad:

This is an odd stack trace... Looks like setting the container is
triggering ptolemy.moml.EntityLibrary.populate, which is the mechanism
that is used to defer construction of a library until its contents
are needed.  Is the container a library here?

I'm speculating, but it could be that populating the library
while in the middle of adding something to it causing the problem.
Perhaps you can explicitly call populate prior to adding the entity?

Just a guess here...

Edward


At 01:06 PM 10/14/2004 -0700, Chad Berkley wrote:
Hi,

I'm trying to add a CompositeActor (specifically, ptolemy.actor.lib.Sinewave) to a container. When I do so, several exceptions are thrown. All are of the same form:

ptolemy.kernel.util.IllegalActionException: Attempt to link more than one relation to a single port.
in .<Unnamed Object>.Actors.Mathematical Operations.Trig.Sinewave.output and .<Unnamed Object>.Actors.Mathematical Operations.Trig.Sinewave.relation3
at ptolemy.actor.IOPort._checkMultiportLink(IOPort.java:3104)
at ptolemy.actor.IOPort._checkLink(IOPort.java:2843)
at ptolemy.actor.TypedIOPort._checkLink(TypedIOPort.java:899)
at ptolemy.kernel.ComponentPort.link(ComponentPort.java:482)
at ptolemy.actor.IOPort.link(IOPort.java:1982)
at ptolemy.moml.MoMLParser._processLink(MoMLParser.java:4769)
at ptolemy.moml.MoMLParser.access$700(MoMLParser.java:200)
at ptolemy.moml.MoMLParser$LinkRequest.execute(MoMLParser.java:5614)
at ptolemy.moml.MoMLParser._processPendingRequests(MoMLParser.java:4872)
at ptolemy.moml.MoMLParser.endElement(MoMLParser.java:813)
at com.microstar.xml.XmlParser.parseETag(XmlParser.java:1049)
at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1119)
at com.microstar.xml.XmlParser.parseElement(XmlParser.java:947)
at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1125)
at com.microstar.xml.XmlParser.parseElement(XmlParser.java:947)
at com.microstar.xml.XmlParser.parseDocument(XmlParser.java:496)
at com.microstar.xml.XmlParser.doParse(XmlParser.java:176)
at com.microstar.xml.XmlParser.parse(XmlParser.java:146)
at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1199)
at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1290)
at ptolemy.moml.EntityLibrary.populate(EntityLibrary.java:502)
at ptolemy.moml.EntityLibrary.attributeList(EntityLibrary.java:220)
at ptolemy.kernel.util.NamedObj.validateSettables(NamedObj.java:1776)
at ptolemy.kernel.Entity.validateSettables(Entity.java:528)
at ptolemy.kernel.CompositeEntity.validateSettables(CompositeEntity.java:1161)
at ptolemy.kernel.CompositeEntity.validateSettables(CompositeEntity.java:1185)
at ptolemy.kernel.ComponentEntity.setContainer(ComponentEntity.java:522)
at org.ecoinformatics.seek.ecogrid.ResultTreeRebuilder.setContainer(ResultTreeRebuilder.java:285)


I'm using the same setContainer call to set the container on ComponentEntities and it works fine. It only fails when it hits a CompositeActor. Do you have any idea why this is? I noticed that CompositeActor overrides the setContainer method from CompositeEntity. Could there be a bug in this implementation? I'm not sure why it thinks it needs to link relations to any port. There is nothing of the sort going on. Any insights into this are appreciated.

thanks,
chad

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

------------ Edward A. Lee, Professor 518 Cory Hall, UC Berkeley, Berkeley, CA 94720 phone: 510-642-0455, fax: 510-642-2739 [EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal


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

Reply via email to