LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-19-2005, 01:06 AM   #1
richard22
Member
 
Registered: Apr 2001
Posts: 60

Rep: Reputation: 15
java works but only part with php to transform xml


I am wanting to transform xml to pdf. This works from the command line using

java org.apache.xalan.xslt.Process -in fobar.xml -xsl foobar.xsl -outfoobar.fo

java org.apache.fop.apps.Fop -foobar.fo -pdf foobar.pdf

However when run from a script on a web page, on the same machine, using php with

exec('java org.apache.xalan.xslt.Process -in fobar.xml -xsl foobar.xsl -outfoobar.fo')

exec('java org.apache.fop.apps.Fop -foobar.fo -pdf foobar.pdf');

only the first line works. If I put the top two lines in an executable bash script and call it from the page it works but I don't want to open up the system so much.

I presume this is a question about path or classpath but have tried every variation that I can think of in bash.bashrc and profile.

Any thoughts would be appreciated - I work in php but java is actually a mystery to me.

Regards Richard
 
Old 03-19-2005, 01:46 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Try tracing your php program (strace -f ...) and see what happen when you run the second java command.
 
Old 03-19-2005, 10:18 AM   #3
richard22
Member
 
Registered: Apr 2001
Posts: 60

Original Poster
Rep: Reputation: 15
I wasn't sure how that was to be used but when 2>&1',$output applied to the line I get:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/fop/apps/Fop

hence my feeling it must be something about the path used by xwindows or apache compared to the bash shell (which works)

Regards Richard
 
Old 03-19-2005, 06:16 PM   #4
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
And what about? exec('java org.apache.xalan.xslt.Process -in fobar.xml -xsl foobar.xsl -outfoobar.fo && java org.apache.fop.apps.Fop -foobar.fo -pdf foobar.pdf');
 
Old 03-20-2005, 10:42 PM   #5
richard22
Member
 
Registered: Apr 2001
Posts: 60

Original Poster
Rep: Reputation: 15
That doesn't work either. Using:
echo $output;
foreach($output as $outputline){
echo("$outputline<br>");
}
reveals $output to be an empty array followed by the same exception!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
transform month number to month name in php ALInux Programming 1 11-09-2005 10:45 AM
java and xml infected Programming 2 11-26-2004 02:28 AM
What packages are needed to generate lib-javox-xml-transform-2.4.1.so, etc. satimis Fedora 0 09-25-2004 09:51 AM
How can I transform XML into HTML on bash? pedrosan Linux - Newbie 0 04-22-2004 02:37 AM
how to transform an object into an array of bytes on Java! poeta_boy Programming 3 02-15-2004 07:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration