Personal tools
You are here: Home Developer Developer Forum Actor and Workflow Design Interest Group problem in running helloworld

problem in running helloworld

Up to Actor and Workflow Design Interest Group

problem in running helloworld

Posted by mehdi sarikhani at February 06. 2012

Hi 

i made a hello world project, according to manual and attached picture. It have problem to main class. actually it can make HelloWorld.class.

So if i want to run this project i can run by changing run configuration (just by changing the Project from hello-world to build-area).

in this way also i can not import hello -world actor into Kepler by  Tools->Instantiate Component .

what can i do to solve this problem?

i will appreciate if you can give any suggestion that you have, in oder to solve this problem.

Cheers

Attachments

Re: problem in running helloworld

Posted by Daniel Crawl at February 07. 2012

 

Hi Mehdi,

 

Are you able to import the hello-world actor if you run from the command line using ant?

ant change-to -Dsuite=hello-world
ant run

Re: problem in running helloworld

Posted by mehdi sarikhani at February 08. 2012

Hi Daniel

Thank you for answering my questions.

Unfortunately, No i can't.

After using these command or running from eclipse (just by changing the Project from hello-world to build-area). i can not import hello-world actor.

following errors (stack trace) appear after importing request:

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.

-- /Users/medisarikhani/kepler/org/helloworld/HelloWorld.xml

/Users/medisarikhani/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:3642)

at com.microstar.xml.XmlParser.parseElement(XmlParser.java:922)

at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1105)

at com.microstar.xml.XmlParser.parseElement(XmlParser.java:925)

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:1538)

at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1510)

at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1666)

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:738)

at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1778)

at ptolemy.actor.CompositeActor.requestChange(CompositeActor.java:1922)

at ptolemy.vergil.actor.ActorGraphFrame$InstantiateEntityAction.actionPerformed(ActorGraphFrame.java:735)

at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)

at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)

at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)

at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)

at javax.swing.AbstractButton.doClick(AbstractButton.java:389)

at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:95)

at java.awt.MenuItem.processActionEvent(MenuItem.java:627)

at java.awt.MenuItem.processEvent(MenuItem.java:586)

at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:337)

at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:325)

at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)

at java.awt.EventQueue.access$000(EventQueue.java:85)

at java.awt.EventQueue$1.run(EventQueue.java:638)

at java.awt.EventQueue$1.run(EventQueue.java:636)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)

at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)

at java.awt.EventQueue$2.run(EventQueue.java:652)

at java.awt.EventQueue$2.run(EventQueue.java:650)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:649)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

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.

-- /Users/medisarikhani/kepler/org/helloworld/HelloWorld.xml

/Users/medisarikhani/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:4077)

at ptolemy.moml.MoMLParser.startElement(MoMLParser.java:2694)

... 43 more

Caused by: com.microstar.xml.XmlException: -- no protocol: org/helloworld/HelloWorld.xml

-- XML file not found relative to classpath.

-- /Users/medisarikhani/kepler/org/helloworld/HelloWorld.xml

/Users/medisarikhani/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:1310)

at ptolemy.moml.MoMLParser._findOrParse(MoMLParser.java:4978)

at ptolemy.moml.MoMLParser._attemptToFindMoMLClass(MoMLParser.java:3849)

at ptolemy.moml.MoMLParser._createEntity(MoMLParser.java:4072)

... 44 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.

-- /Users/medisarikhani/kepler/org/helloworld/HelloWorld.xml

/Users/medisarikhani/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:4077)

at ptolemy.moml.MoMLParser.startElement(MoMLParser.java:2694)

at com.microstar.xml.XmlParser.parseElement(XmlParser.java:922)

at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1105)

at com.microstar.xml.XmlParser.parseElement(XmlParser.java:925)

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:1538)

at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1510)

at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1666)

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:738)

at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1778)

at ptolemy.actor.CompositeActor.requestChange(CompositeActor.java:1922)

at ptolemy.vergil.actor.ActorGraphFrame$InstantiateEntityAction.actionPerformed(ActorGraphFrame.java:735)

at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)

at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)

at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)

at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)

at javax.swing.AbstractButton.doClick(AbstractButton.java:389)

at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:95)

at java.awt.MenuItem.processActionEvent(MenuItem.java:627)

at java.awt.MenuItem.processEvent(MenuItem.java:586)

at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:337)

at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:325)

at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)

at java.awt.EventQueue.access$000(EventQueue.java:85)

at java.awt.EventQueue$1.run(EventQueue.java:638)

at java.awt.EventQueue$1.run(EventQueue.java:636)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)

at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)

at java.awt.EventQueue$2.run(EventQueue.java:652)

at java.awt.EventQueue$2.run(EventQueue.java:650)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:649)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Caused by: com.microstar.xml.XmlException: -- no protocol: org/helloworld/HelloWorld.xml

-- XML file not found relative to classpath.

-- /Users/medisarikhani/kepler/org/helloworld/HelloWorld.xml

/Users/medisarikhani/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:1310)

at ptolemy.moml.MoMLParser._findOrParse(MoMLParser.java:4978)

at ptolemy.moml.MoMLParser._attemptToFindMoMLClass(MoMLParser.java:3849)

at ptolemy.moml.MoMLParser._createEntity(MoMLParser.java:4072)

... 44 more

Caused by: com.microstar.xml.XmlException: -- no protocol: org/helloworld/HelloWorld.xml

-- XML file not found relative to classpath.

-- /Users/medisarikhani/kepler/org/helloworld/HelloWorld.xml

/Users/medisarikhani/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:1310)

at ptolemy.moml.MoMLParser._findOrParse(MoMLParser.java:4978)

at ptolemy.moml.MoMLParser._attemptToFindMoMLClass(MoMLParser.java:3849)

at ptolemy.moml.MoMLParser._createEntity(MoMLParser.java:4072)

at ptolemy.moml.MoMLParser.startElement(MoMLParser.java:2694)

at com.microstar.xml.XmlParser.parseElement(XmlParser.java:922)

at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1105)

at com.microstar.xml.XmlParser.parseElement(XmlParser.java:925)

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:1538)

at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1510)

at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1666)

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:738)

at ptolemy.kernel.util.NamedObj.requestChange(NamedObj.java:1778)

at ptolemy.actor.CompositeActor.requestChange(CompositeActor.java:1922)

at ptolemy.vergil.actor.ActorGraphFrame$InstantiateEntityAction.actionPerformed(ActorGraphFrame.java:735)

at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)

at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)

at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)

at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)

at javax.swing.AbstractButton.doClick(AbstractButton.java:389)

at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:95)

at java.awt.MenuItem.processActionEvent(MenuItem.java:627)

at java.awt.MenuItem.processEvent(MenuItem.java:586)

at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:337)

at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:325)

at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)

at java.awt.EventQueue.access$000(EventQueue.java:85)

at java.awt.EventQueue$1.run(EventQueue.java:638)

at java.awt.EventQueue$1.run(EventQueue.java:636)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)

at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)

at java.awt.EventQueue$2.run(EventQueue.java:652)

at java.awt.EventQueue$2.run(EventQueue.java:650)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:649)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

cd ..

 



Re: problem in running helloworld

Posted by Daniel Crawl at February 09. 2012

Hi Mehdi,

 

This error occurs because org.helloworld.HelloWorld is not in the classpath. In Kepler, you can see what the classpath is by using Tools->Check System Settings. The classpath is in java.class.path. Is the directory containing Helloworld.class in java.class.path? What is in java.class.path?

 

In build-area/, what are the contents of current-suite.txt and modules.txt?

Re: problem in running helloworld

Posted by mehdi sarikhani at February 09. 2012

HI Daniel

you right. there is no "Helloworld.class" into this class path.

So how can i solve this problem?

by the way, in the process of compiling helloworld. there are many error which means that they didnot found ptolemy. So i add ptolemy jar file as a external jar files. So that problem is solved.may be it is a problem

Cheers

Re: problem in running helloworld

Posted by mehdi sarikhani at February 13. 2012

HI Daniel

I can't find a way to solve this problem. i am right now in the middle of a project. So i want to write a program to retrieve provenance data from database, and in the next step working with semantic database and query.

Thank you again, i am looking forward to hearing from you.

Cheers.

Re: problem in running helloworld

Posted by Daniel Crawl at February 14. 2012

 

Hi Mehdi,

 

The source for org.helloworld.HelloWorld needs to be in the hello-world module: hello-world/src/org/helloword/HelloWorld.java. If you compile with ant, HelloWorld.class is in hello-world/target/classes/org/helloworld/, and if you compile with eclipse, HelloWorld.class is in hello-world/target/eclipse/classes/org/helloworld.

 

Re: problem in running helloworld

Posted by mehdi sarikhani at February 14. 2012

Hi Daniel

The source code is in the correct directory, but  the .class is not in the those folder that you mentioned.the .class is in hello-world/bin/org/helloworld. As i mentioned before, i can't run helloworld by eclipse because of the error that say i can "Exception in thread "main" java.lang.NoClassDefFoundError: org/kepler/Kepler". 

even if i run kepler from different run confiquration i can not find " org.helloworld.HelloWorld ".

So i just try to compile with ant, and also i can't find " org.helloworld.HelloWorld ".

this time i try to make all directory that you said and put .class file into, but the same senario( i can't find " org.helloworld.HelloWorld ").

i will be happy, if i can run these problem from eclipse. i thought that may be helloword project is not in the same project of kepler or some others problems in installation. So, I installed kepler from scratch in different folder and do all stuff again from scratch , but i can't find any differences.

i know my question may be become so frustrating for you.Please accept my apology.

i will appreciate if you tell me what others things comes to your mind regarding these problems.or any suggestion.

Cheers,


Re: problem in running helloworld

Posted by Daniel Crawl at February 15. 2012

 

Hi Mehdi,

 

Here are some things to check:

  • HelloWorld.java is in hello-world/src/org/helloworld/
  • hello-world directory is contained in same directory as other Kepler modules, like build-area, actors, gui, etc.
  • build-area/current-suite.txt contains hello-world
 
If you compile with ant:

cd build-area

ant compile

then HelloWorld.class should be hello-world/target/classes/org/helloworld/

Re: problem in running helloworld

Posted by mehdi sarikhani at February 21. 2012

Hi Daniel 

the above mentioned DIrectory (folder) are not made after compiling with both ant and eclipse.

Just  i have "hello-world/src/org/helloworld/HelloWorld.java" and "hello-world/bin/org/helloworld/HelloWorld.class"

i mean that compiling with ant and eclipse can n't make appropriate directories and files for me (like other kepler modules, like actors,..)

i donot have some directories like ""target", ..

Re: problem in running helloworld

Posted by mehdi sarikhani at February 23. 2012

Hi Daniel

I had problem in make new module.

Thank you for helping.

Reagrds

Powered by Ploneboard
Document Actions