You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Geddes, Mark (ANTS)" <ma...@ants.co.uk> on 2002/07/08 13:32:41 UTC

RE: Newbie getting NoClassDefFoundError when running servlet

The .war is incomplete. You will need to add fop.jar (plus others) to the
WEB-INF/lib directory.
I also had problems with batik.jar, and ended up removing some of the sax
classes.
 
Good luck
 
Mark

-----Original Message-----
From: Gary Bauer [mailto:gary.bauer@bigfoot.com]
Sent: 08 July 2002 13:20
To: fop-user@xml.apache.org
Subject: Newbie getting NoClassDefFoundError when running servlet


I am getting the error message "java.lang.NoClassDefFoundError:
org/apache/fop/apps/XSLTInputHandler" when I try to run fop as a servlet.
 
Operating System: Windows 98
FOP Version:        fop-0.20.4
Tomcat Version:    4.04
 
I have copied the file fop.jar (that contains "XSLTInputHandler" class) to
directories on my path, and to several Tomcat subdirectories all to no
avail.
 
The story:
 
1. Downlaoded fop-0.20.4 & unzipped it into a sundry directory.  Got fop.bat
to convert a FO to PDF
2. Copied fop.war to Tomacat/webapps
3. Started Tomcat.  Tomcat reported a problem:
"org.xml.sax.SAXParseException:The content of element type "servlet-mapping"
must match "<servlet-name,url-pattern>"".  I found the problem in the
web.xml supplied with this relase (see below for the solution if you have
the same issue)
4. Fixed web.xml and started Tomcat again
5. In my browser, tried opening http://localhost:8080/fop/fop?fo=/article.fo
<http://localhost:8080/fop/fop?fo=/article.fo>   ("article.fo" is my FO file
located in Tomcat/webapps/Root)
6.  Got a ton of error messages, at the root of which seems to be
"java.lang.NoClassDefFoundError: org/apache/fop/apps/XSLTInputHandler".
Attempting the same url again, Tomcat tells me the servlet is currently
unavailable.  I have to restart Tomcat to try again.
 
Can anyone tell me where I am going wrong?
 
Thanks!
 
Gary Bauer
 
 
ps Here is the solution to the web.xml problem:
 
The error message is saying that in a <servlet-mapping> element it is
expecting to see one <servlet-name> and one <url-pattern>.  In the web.xml
that installed itself on my system, I had the entry:
 

<servlet-mapping>
    <servlet-name>
        Fop
    </servlet-name>
    <url-pattern>
        /fop
    </url-pattern>
    <url-pattern>
        /servlet/fop
    </url-pattern>
</servlet-mapping>
 

There are two <url-patterns>'s for one servlet name.  The solution is
simple.  Create an additional <servlet-mapping> and put one of the
<url-patterns> in it as below:

 
<servlet-mapping>
    <servlet-name>
        Fop
    </servlet-name>
     <url-pattern>
        /fop
    </url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>
        Fop
    </servlet-name>
    <url-pattern>
        /servlet/fop
    </url-pattern>
</servlet-mapping>



***************************************************************************
This communication (including any attachments) contains confidential information.  If you are not the intended recipient and you have received this communication in error, you should destroy it without copying, disclosing or otherwise using its contents.  Please notify the sender immediately of the error.

Internet communications are not necessarily secure and may be intercepted or changed after they are sent.  Abbey National Treasury plc does not accept liability for any loss you may suffer as a result of intercepption or any liability for such changes.  If you wish to confirm the origin or content of this communication, please contact the sender by using an alternative means of communication.

This communication does not create or modify any contract and, unless otherwise stated, is not intended to be contractually binding.

Abbey National Treasury Services plc. Registered Office:  Abbey National House, 2 Triton Square, Regents Place, London NW1 3AN.  Registered in England under Company Registration Number: 2338548.  Regulated by the Financial Services Authority (FSA).
***************************************************************************


Re: 20_0_1 vs higher version

Posted by Oleg Tkachenko <ol...@multiconn.com>.
Petr Hanek wrote:

> I have simple xml and xsl file.
> It works on fop 0_20_1 but it doesn't run on higher version (0_20_3,
> 0_20_4).
> I see this error:
> 
> [ERROR] org.apache.fop.apps.FOPException: 'master-reference' for
> 'fo:page-sequence'matches no 'simple-page-master' or 'page-sequence-master'

That's faq actually, fo syntax has changed in xsl recommendation, now masters 
have master-name attribute and master references have master-reference.

>  <fo:simple-page-master master-name="all"
>   page-height="11.5in" page-width="8.5in"
>  margin-top="1in" margin-bottom="1in"
>         margin-left="0.75in" margin-right="0.75in">
>   <fo:region-body margin-top="1in" margin-bottom="0.75in"/>
>   <fo:region-before extent="0.75in"/>
>   <fo:region-after extent="0.5in"/>
>  </fo:simple-page-master>
> 
>  </fo:layout-master-set>
> 
>  <fo:page-sequence master-name="all" format="1">
Should be <fo:page-sequence master-reference="all" format="1">

>     <!-- header with running glossary entries -->
>     <fo:static-content flow-name="xsl-region-before">
>   <fo:block text-align="start"
>    font-size="10pt" line-height="1em + 2pt">
>      <fo:retrieve-marker retrieve-class-name="title"
>    retrieve-boundary="page"
>    retrieve-position="first-starting-within-page"/>
>   <fo:leader leader-alignment="reference-area" leader-pattern="dots"
>    leader-length="4in"/>
>      <fo:retrieve-marker retrieve-class-name="title"
>    retrieve-boundary="page"
>    retrieve-position="last-ending-within-page"/>
>       </fo:block>
>     </fo:static-content>
>     <fo:static-content flow-name="xsl-region-after">
>   <fo:block text-align="start"
>    font-size="10pt" line-height="1em + 2pt">
>    Page (<fo:page-number/>)
>       </fo:block>
>     </fo:static-content>
>     <fo:flow flow-name="xsl-region-body">
>   <xsl:apply-templates select="term-entry"/>
>  </fo:flow>
>  </fo:page-sequence>
> </fo:root>
> </xsl:template>
> 
> <xsl:template match="term-entry">
>  <fo:block text-align="start" font-size="12pt" font-family="Arial">
>   <xsl:apply-templates select="title"/>  ....
>   <xsl:apply-templates select="author"/>
>  </fo:block>
> </xsl:template>
> 
> </xsl:stylesheet>
> 



-- 
Oleg Tkachenko
Multiconn International, Israel


Re: Just what is proportional-column-width() ?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Richard Bondi wrote:
> The definition from the spec is (at least to me) almost completely 
> opaque. Here's the original defition, followed by my interpretation of it.
> 
>     * Function: */numeric/ *proportional-column-width*( /numeric/) The
>     proportional-column-width function returns /proportional factor/
>     (the argument) units of proportional measure. The column widths are
>     first determined ignoring the proportional measures. The difference
>     between the table-width and the sum of the column widths is the
>     available proportional width. One unit of proportional measure is
>     the available proportional width divided by the sum of the
>     proportional factors. It is an error to use this function on
>     formatting objects other than an fo:table-column. It is also an
>     error to use this function if the fixed table layout is not used.
> 

My interpretation is:
  1. Evaluate each column width with proportional-column-width() set
     to zero.
  2. Subtract the sum of 1. from the table width.
  3. Divide the result of 2. by the sum of all arguments of the
     proportional-column-width() functions. The result is the proportional
     width.
  4. Evaluate the column widths again, this time
     proportional-column-width(X) returning X times the proportional
     width
This means:
- a table with
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="proportional-column-width(1)"/>
   has two columns of equal width.
- a table with
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="proportional-column-width(2)"/>
   has two columns, the second twice as wide as the first.
- a table with
   <fo:table width="100mm">
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="40mm"/>
     <fo:table-column column-width="proportional-column-width(2)"/>
   has columns of 20mm, 40mm and 40mm width
- a table with
   <fo:table width="100%">
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="40mm"/>
     <fo:table-column column-width="proportional-column-width(1)"/>
   has a the second column of 40mm width and rest width equally distributed
   between the first and the third row.
- a table with
   <fo:table width="100mm">
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="40mm+proportional-column-width(1)"/>
   hastwo columns of 30mm and 70mm width.

> To sum up: none of the main terms in this definition are ever defined. 
> It really ought to be rewritten.

This happens.

HTH
J.Pietschmann


20_0_1 vs higher version

Posted by Petr Hanek <pe...@kctdata.cz>.
Hi,

I have simple xml and xsl file.
It works on fop 0_20_1 but it doesn't run on higher version (0_20_3,
0_20_4).
I see this error:

[ERROR] org.apache.fop.apps.FOPException: 'master-reference' for
'fo:page-sequence'matches no 'simple-page-master' or 'page-sequence-master'

Thanks

petr

XML:
<?xml version="1.0" encoding="utf-8" ?>

<source>
<term-entry>
<title>test</title>
<author>test</author>
</term-entry>

<term-entry>
<title>test2</title>
<author>test2</author>
</term-entry>
</source>

XSL:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:fo="http://www.w3.org/1999/XSL/Format"
     version="1.0">


<xsl:template match="source">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

 <fo:layout-master-set>

 <fo:simple-page-master master-name="all"
  page-height="11.5in" page-width="8.5in"
 margin-top="1in" margin-bottom="1in"
        margin-left="0.75in" margin-right="0.75in">
  <fo:region-body margin-top="1in" margin-bottom="0.75in"/>
  <fo:region-before extent="0.75in"/>
  <fo:region-after extent="0.5in"/>
 </fo:simple-page-master>

 </fo:layout-master-set>

 <fo:page-sequence master-name="all" format="1">
    <!-- header with running glossary entries -->
    <fo:static-content flow-name="xsl-region-before">
  <fo:block text-align="start"
   font-size="10pt" line-height="1em + 2pt">
     <fo:retrieve-marker retrieve-class-name="title"
   retrieve-boundary="page"
   retrieve-position="first-starting-within-page"/>
  <fo:leader leader-alignment="reference-area" leader-pattern="dots"
   leader-length="4in"/>
     <fo:retrieve-marker retrieve-class-name="title"
   retrieve-boundary="page"
   retrieve-position="last-ending-within-page"/>
      </fo:block>
    </fo:static-content>
    <fo:static-content flow-name="xsl-region-after">
  <fo:block text-align="start"
   font-size="10pt" line-height="1em + 2pt">
   Page (<fo:page-number/>)
      </fo:block>
    </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
  <xsl:apply-templates select="term-entry"/>
 </fo:flow>
 </fo:page-sequence>
</fo:root>
</xsl:template>

<xsl:template match="term-entry">
 <fo:block text-align="start" font-size="12pt" font-family="Arial">
  <xsl:apply-templates select="title"/>  ....
  <xsl:apply-templates select="author"/>
 </fo:block>
</xsl:template>

</xsl:stylesheet>