Ridzwan Aminuddin wrote at 2007-2-9 17:53 -0800:
>Oh yes, i forgot to mention that in my code i did use the absolute paths to my 
>java .jar file as you can see i my code below, the absolute path to the 
>Extensions directory is in the variable homedir. I also set my classpath to 
>point to the folder just in case..

Relative paths do work -- but, they are (as always) relative to
the current working directory.
And unless you (or some buggy extension) have changed it, the
current working directory will be Zope's instance home.

> ...
>homedir = os.getcwd()
>homedir = homedir + "/Extensions"
>command = "cd "+homedir

The "popen" above still has no effect. You should remove
code without effect as it clutters the source.

>command = "java -jar "+ '"' + homedir + "/" + "ActiveLearningTools.jar" + '" ' 
>"prepArticles >> test.txt"

This will look for "ActiveLearningTools.jar" in
"<instancehome>/Extensions". But the output file "test.txt"
will be put into "<instancehome>" (as this name is still relative).

Have you already told us in what way your "ExternalMethod" fails?
Do you get an exception? Or is simply the output file not produced?
Or does the output file remain empty?

Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to