Personal tools
You are here: Home Developer Developer Forum Actor and Workflow Design Interest Group Re: No protocol: org/helloworld/HelloWorld.xml

Re: No protocol: org/helloworld/HelloWorld.xml

Up to Actor and Workflow Design Interest Group

Re: No protocol: org/helloworld/HelloWorld.xml

Posted by Ron Mak at January 21. 2011

I did the tutorial "Developing a Hello World Actor using the Kepler Build System and Eclipse". At the end, I was able to start Kepler with "ant run", instantiate my new HelloWorld actor, and use it in the workflow as per the tutorial.

However, if I start Kepler from within Eclipse and then try to instantiate the HelloWorld actor (via Tools ==> Instantiate Component), I get an error dialog about Kepler not finding the class org.helloworld.HelloWorld because there is no protocol org/helloworld/HelloWorld.xml. I've copied the stack trace below.

Doing the tutorial did not create a file HelloWorld.xml that I could find. Why is it possible to create the HelloWorld actor if Kepler was started by "ant run" but not if Kepler was started within Eclipse? Are there steps that you must do in Eclipse that are missing in the tutorial?

Here's the stack trace:

com.microstar.xml.XmlException: XML element "entity" triggers exception. in [external stream] at line 1 and column 72
Caused by:
 ptolemy.kernel.util.IllegalActionException: Cannot find class: org.helloworld.HelloWorld
Because:
-- no protocol: org/helloworld/HelloWorld.xml
-- XML file not found relative to classpath.
-- /home/rlmak/kepler/kepler/org/helloworld/HelloWorld.xml
/home/rlmak/kepler/kepler/org/helloworld/HelloWorld.xml (No such file or directory)
 in [external stream] at line 1 and column 72
    at ptolemy.moml.MoMLParser.startElement(MoMLParser.java:3442)
    at com.microstar.xml.XmlParser.parseElement(XmlParser.java:921)
    at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1104)
    at com.microstar.xml.XmlParser.parseElement(XmlParser.java:924)
    at com.microstar.xml.XmlParser.parseDocument(XmlParser.java:481)
    at com.microstar.xml.XmlParser.doParse(XmlParser.java:159)
    at com.microstar.xml.XmlParser.parse(XmlParser.java:132)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1402)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1374)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1530)
    at ptolemy.moml.MoMLChangeRequest._execute(MoMLChangeRequest.java:289)
    at ptolemy.kernel.util.ChangeRequest.execute(ChangeRequest.java:171)
    at ptolemy.kernel.util.NamedObj.executeChangeRequests(NamedObj.java:735)
    at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1775)
    at ptolemy.actor.CompositeActor.requestChange(CompositeActor.java:1921)
    at ptolemy.vergil.actor.ActorGraphFrame$InstantiateEntityAction.actionPerformed(ActorGraphFrame.java:709)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1220)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1261)
    at java.awt.Component.processMouseEvent(Component.java:6041)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
    at java.awt.Component.processEvent(Component.java:5806)
    at java.awt.Container.processEvent(Container.java:2058)
    at java.awt.Component.dispatchEventImpl(Component.java:4413)
    at java.awt.Container.dispatchEventImpl(Container.java:2116)
    at java.awt.Component.dispatchEvent(Component.java:4243)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
    at java.awt.Container.dispatchEventImpl(Container.java:2102)
    at java.awt.Window.dispatchEventImpl(Window.java:2440)
    at java.awt.Component.dispatchEvent(Component.java:4243)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: ptolemy.kernel.util.IllegalActionException: Cannot find class: org.helloworld.HelloWorld
Because:
-- no protocol: org/helloworld/HelloWorld.xml
-- XML file not found relative to classpath.
-- /home/rlmak/kepler/kepler/org/helloworld/HelloWorld.xml
/home/rlmak/kepler/kepler/org/helloworld/HelloWorld.xml (No such file or directory)
 in [external stream] at line 1 and column 72
    at ptolemy.moml.MoMLParser._createEntity(MoMLParser.java:3877)
    at ptolemy.moml.MoMLParser.startElement(MoMLParser.java:2493)
    ... 42 more
Caused by: com.microstar.xml.XmlException: -- no protocol: org/helloworld/HelloWorld.xml
-- XML file not found relative to classpath.
-- /home/rlmak/kepler/kepler/org/helloworld/HelloWorld.xml
/home/rlmak/kepler/kepler/org/helloworld/HelloWorld.xml (No such file or directory)
 in [external stream] at line 1 and column 72
    at ptolemy.moml.MoMLParser.fileNameToURL(MoMLParser.java:1176)
    at ptolemy.moml.MoMLParser._findOrParse(MoMLParser.java:4778)
    at ptolemy.moml.MoMLParser._attemptToFindMoMLClass(MoMLParser.java:3649)
    at ptolemy.moml.MoMLParser._createEntity(MoMLParser.java:3872)
    ... 43 more
Caused by: ptolemy.kernel.util.IllegalActionException: Cannot find class: org.helloworld.HelloWorld
Because:
-- no protocol: org/helloworld/HelloWorld.xml
-- XML file not found relative to classpath.
-- /home/rlmak/kepler/kepler/org/helloworld/HelloWorld.xml
/home/rlmak/kepler/kepler/org/helloworld/HelloWorld.xml (No such file or directory)
 in [external stream] at line 1 and column 72
    at ptolemy.moml.MoMLParser._createEntity(MoMLParser.java:3877)
    at ptolemy.moml.MoMLParser.startElement(MoMLParser.java:2493)
    at com.microstar.xml.XmlParser.parseElement(XmlParser.java:921)
    at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1104)
    at com.microstar.xml.XmlParser.parseElement(XmlParser.java:924)
    at com.microstar.xml.XmlParser.parseDocument(XmlParser.java:481)
    at com.microstar.xml.XmlParser.doParse(XmlParser.java:159)
    at com.microstar.xml.XmlParser.parse(XmlParser.java:132)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1402)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1374)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1530)
    at ptolemy.moml.MoMLChangeRequest._execute(MoMLChangeRequest.java:289)
    at ptolemy.kernel.util.ChangeRequest.execute(ChangeRequest.java:171)
    at ptolemy.kernel.util.NamedObj.executeChangeRequests(NamedObj.java:735)
    at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1775)
    at ptolemy.actor.CompositeActor.requestChange(CompositeActor.java:1921)
    at ptolemy.vergil.actor.ActorGraphFrame$InstantiateEntityAction.actionPerformed(ActorGraphFrame.java:709)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1220)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1261)
    at java.awt.Component.processMouseEvent(Component.java:6041)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
    at java.awt.Component.processEvent(Component.java:5806)
    at java.awt.Container.processEvent(Container.java:2058)
    at java.awt.Component.dispatchEventImpl(Component.java:4413)
    at java.awt.Container.dispatchEventImpl(Container.java:2116)
    at java.awt.Component.dispatchEvent(Component.java:4243)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
    at java.awt.Container.dispatchEventImpl(Container.java:2102)
    at java.awt.Window.dispatchEventImpl(Window.java:2440)
    at java.awt.Component.dispatchEvent(Component.java:4243)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: com.microstar.xml.XmlException: -- no protocol: org/helloworld/HelloWorld.xml
-- XML file not found relative to classpath.
-- /home/rlmak/kepler/kepler/org/helloworld/HelloWorld.xml
/home/rlmak/kepler/kepler/org/helloworld/HelloWorld.xml (No such file or directory)
 in [external stream] at line 1 and column 72
    at ptolemy.moml.MoMLParser.fileNameToURL(MoMLParser.java:1176)
    at ptolemy.moml.MoMLParser._findOrParse(MoMLParser.java:4778)
    at ptolemy.moml.MoMLParser._attemptToFindMoMLClass(MoMLParser.java:3649)
    at ptolemy.moml.MoMLParser._createEntity(MoMLParser.java:3872)
    ... 43 more
Caused by: com.microstar.xml.XmlException: -- no protocol: org/helloworld/HelloWorld.xml
-- XML file not found relative to classpath.
-- /home/rlmak/kepler/kepler/org/helloworld/HelloWorld.xml
/home/rlmak/kepler/kepler/org/helloworld/HelloWorld.xml (No such file or directory)
 in [external stream] at line 1 and column 72
    at ptolemy.moml.MoMLParser.fileNameToURL(MoMLParser.java:1176)
    at ptolemy.moml.MoMLParser._findOrParse(MoMLParser.java:4778)
    at ptolemy.moml.MoMLParser._attemptToFindMoMLClass(MoMLParser.java:3649)
    at ptolemy.moml.MoMLParser._createEntity(MoMLParser.java:3872)
    at ptolemy.moml.MoMLParser.startElement(MoMLParser.java:2493)
    at com.microstar.xml.XmlParser.parseElement(XmlParser.java:921)
    at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1104)
    at com.microstar.xml.XmlParser.parseElement(XmlParser.java:924)
    at com.microstar.xml.XmlParser.parseDocument(XmlParser.java:481)
    at com.microstar.xml.XmlParser.doParse(XmlParser.java:159)
    at com.microstar.xml.XmlParser.parse(XmlParser.java:132)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1402)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1374)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1530)
    at ptolemy.moml.MoMLChangeRequest._execute(MoMLChangeRequest.java:289)
    at ptolemy.kernel.util.ChangeRequest.execute(ChangeRequest.java:171)
    at ptolemy.kernel.util.NamedObj.executeChangeRequests(NamedObj.java:735)
    at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1775)
    at ptolemy.actor.CompositeActor.requestChange(CompositeActor.java:1921)
    at ptolemy.vergil.actor.ActorGraphFrame$InstantiateEntityAction.actionPerformed(ActorGraphFrame.java:709)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1220)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1261)
    at java.awt.Component.processMouseEvent(Component.java:6041)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
    at java.awt.Component.processEvent(Component.java:5806)
    at java.awt.Container.processEvent(Container.java:2058)
    at java.awt.Component.dispatchEventImpl(Component.java:4413)
    at java.awt.Container.dispatchEventImpl(Container.java:2116)
    at java.awt.Component.dispatchEvent(Component.java:4243)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
    at java.awt.Container.dispatchEventImpl(Container.java:2102)
    at java.awt.Window.dispatchEventImpl(Window.java:2440)
    at java.awt.Component.dispatchEvent(Component.java:4243)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Re: No protocol: org/helloworld/HelloWorld.xml

Posted by Pramod at January 24. 2011

Ron,

You would generally see this error if the actor class file is not present in classpath.

So, if you are running from eclipse, verify that the actor class file is present at hello-world/target/eclipse/classes/org/helloworld/HelloWorld.class

If you don't see this file, it is possible that the hello-world project has not been compiled. In eclipse, go to "Project" menu and ensure that "Build Automatically" is checked. This should compile the project and generate the class file.

Re: No protocol: org/helloworld/HelloWorld.xml

Posted by Ron Mak at February 07. 2011

It turns out the problem in Eclipse (3.5 Galileo) is that the loader initially doesn't see the new hello-world project. Here's what I did to get it to work:

  1. Configure the build path of the hello-world project: Right-click hello-world in the Package Explorer, select the menu item Build Path | Configure Build Path. In the pop-up dialog box, select the Projects tab. Remove all projects except for the ptolemy project. If you don't do this, you will have circular reference errors when you do the next step.
  2. Configure the build path of the loader project: Right-click loader in the Package Explorer, select the menu item Build Path | Configure Build Path. In the pop-up dialog box, select the Projects tab. Add the hello-world project.

Now when you run Kepler from Eclipse, you should be able to instantiate a hello-world actor.

 

If you create another custom actor, you can add it to the loader's build path as in step 2 above, and when you run Kepler from Eclipse, you can also instantiate that actor.

 

However, I haven't figured out using the Ant scripts on the command line outside of Eclipse how to have more than one custom actor that you can instantiate. The Ant scripts in the tutorial appear to work with only one custom actor at a time.

 

Powered by Ploneboard
Document Actions