Re: New Problem With IO.popen?

John Marsan
Sat, 16 Apr 2005 13:19:14 -0000

Problem solved - it was as suggested by Micahael at the end of his comments
a permissions problem - the jar file I was trying to access from within the
controller was not accessbile to the apache process.  Thanks again for the
help.

>----- Original Message -----
>From: "Michael Campbell"
<michael.campbell-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>To: <rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org>
>Sent: Saturday, April 16, 2005 6:19 AM
>Subject: Re: [Rails] New Problem With IO.popen?
>

>> Code for above failure from the controller:  displayXml >>
IO.popen("/usr/lib/java/jre/bin/java -version", "w+")
>
>When running this from the command line for ruby, that works fine for
>me.  Does it you?

Yes.

>>
>> Which is a bit strange.  Also what I really want to do is use Java to
run
>> Saxon to apply an XSLT stylesheet to a document that needs some
>> transforming...this behaves really oddly (at least to me) in that it
>> misses
>> my classpath option on the command line but does seem to find the call
to
>> the stylesheet but since the classpath is "missing" the thing
breaks.
>> And
>> this is the error I see:
>>
>> [Fri Apr 15 19:38:03 2005] [error] [client 10.10.1.48] The java class
is
>> not
>> found:  com/icl/saxon/StyleSheet, referer:
>> http://10.10.99.101/filing/search
>>
>> The failing code for the above:  displayXml >>
IO.popen("/usr/lib/java/jre/bin/java \-classpath
>> /usr/local/saxon/saxon.jar
>> com.icl.saxon.StyleSheet /usr/local/rails/edgar/data/#{@xmlDoc}
>> /usr/local/rails/edgar/data/xmlToHtml.xsl", "w+")
>
>2 things to check:
> * Why the "\" preceding your classpath parameter?

Left over from my earlier troubleshooting attempts.  Didn''t seem to
have any
affect positive or negative.

>* Silly, but is com/icl/saxon/StyleSheet.class in fact, IN the
>/usr/local/saxon/saxon.jar?  (And is the jar (and its directory tree)
>readable by whatever process rails is running under?)

Ahh - jar file not readable by apache!

John