Hello.  I'm trying to use FOP to generate PDF/HTML/text files from XML using 
the XML Resume Library (xmlresume.sourceforge.net).  I was able to get HTML and 
TEXT output a la xalan but PDF output fails with the following error:

<snip>
[EMAIL PROTECTED]:~/resume/examples$ make
java org.apache.xalan.xslt.Process  -in resume.xml -xsl 
http://xmlresume.sourceforge.net/xsl/output/us-html.xsl -out resume.html

java org.apache.xalan.xslt.Process  -in resume.xml -xsl 
http://xmlresume.sourceforge.net/xsl/output/us-text.xsl -out resume.txt

java org.apache.fop.apps.Fop -fo  resume.fo -pdf resume.pdf
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/avalon/framework/logger/Logger
        at org.apache.fop.apps.Fop.main(Unknown Source)
make: *** [resume.pdf] Error 1
<snip>

I checked the FOP FAQ and found this error listed in the COMMON STUMBLING 
BLOCKS section.  It says the problem is most likely due to my classpath.  Up 
until yesterday, I didn't know what a classpath was.  I google searched for 
java classpath and found a somewhat decent article at 
http://www.kevinboone.com/classpath.html.  The problem is this article is 
geared towards a java developer.  Unfortunatly I've never wrote any java code 
in my life.  To learn a bunch about it now to understand how the classpath 
works is just too much at this time as I have to focus on looking for a job.  
Anyhow, based on the FAQ, it says to check the fop.sh script to ensure the 
.jar's are in the correct location.  I checked the shell script and it tries to 
look for FOP under /opt/fop then, if not found, under $HOME/opt/fop  ...

<snip>
if [ -z "$FOP_HOME" ] ; then
  # try to find FOP
  if [ -d /opt/fop ] ; then 
    FOP_HOME=/opt/fop
  fi

  if [ -d ${HOME}/opt/fop ] ; then 
    FOP_HOME=${HOME}/opt/fop
  fi
<snip>

My original FOP installation was to basically copy the fop.sh to /usr/local/bin 
and fop.jar to /usr/lib/j2se/1.3/jre/lib/ext (from now on referred to as 
$JAVA_EXT).  This is where I copied the .jar's for Xerces and xalan also.  
While looking for the location of $JAVA_EXT (before I copied the jar's over), I 
noticed /usr/lib/j2se/ext exists but nothing is in the directory.  I'm not sure 
if this is a Debian thing or a j2se thing that created that dir. but it's empty 
and I left it that way.  I also checked the Xerces and xalan Debian packages to 
see where they put the .jar's.  Debian places them in /usr/share/java so I 
copied the Xerces, xalan and FOP jar's there also.  At this point I'm able to 
use the XML Resume Library to create envoke xalan and output an XML to HTML and 
TEXT but the PDF generation fails when FOP is envoked.

After reading the FOP FAQ and checking the shell script, I created 
$HOME/opt/fop and copied fop.sh to that dir.  Still no dice.  I also copied the 
fop.jar to that same dir with no luck.  I also copied the org subdir which 
resides under the src dir in the source distribution of FOP (is it obvious I'm 
clueless about the classpath? :-) to $HOME/opt/fop with no luck.  I went as far 
as to copy the build dir to there also with no luck.  If I run fop.sh alone 
with no args, I get the same error so I'm sure it's a classpath problem.  The 
README.Debian I extracted from the Debian libfop-java package says this:

<snip>
libfop-java for Debian
----------------------

  The classpath for fop have to include xalan2, bsf, svg, batik, jimi,
  and xerces jar files. See /usr/bin/fop for the full classpath needed.

  xalan2, bsf and xerces are part of debian, the other ones you have to
  find yourself and put in /usr/share/java.

  You can download the svg and batik library from
  http://xml.apache.org/batik/index.html.
  
  You have to find jimi yourself. I got it from the upstream source of
  fop.
<snip>

Which is very confusing to a non-java developer.  However, what is stated in 
here may be irrelevant because I've strated away from the Debian packages 
because they're older and failed to produce PDF output with a different error.  
I strayed away from the .deb's because I thought I may be having problems with 
slightly older versions of FOP, Xerces, and xalan Debian packages working with 
the XML Resume Library and used the latest versions to eleviate the problem.  
Any help on this matter would be greatly appreciated.  I need to find a job... 
SOON! :-)  Thanks everyone.

- Ken

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to