[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

apache fop report - encoded string too long

Subject: apache fop report - encoded string too long
From: "Johnston, Scott" <Scott.Johnston@xxxxxxxxxxxxxx>
Date: Mon, 29 Sep 2008 09:57:20 -0700
 apache fop report - encoded string too long
Hi,

We are upgrading an application from Java 1.4 to 1.5 that uses FOP (and
subsequently an XSL transform).  In the upgrade, the FOP report fails
with the following stack trace:

java.io.UTFDataFormatException: encoded string too long: 81879 bytes
            at
java.io.DataOutputStream.writeUTF(DataOutputStream.java:347)
            at
java.io.DataOutputStream.writeUTF(DataOutputStream.java:306)
            at
com.sun.org.apache.bcel.internal.classfile.ConstantUtf8.dump(ConstantUtf
8.java:121)
            at
com.sun.org.apache.bcel.internal.classfile.ConstantPool.dump(ConstantPoo
l.java:226)
            at
com.sun.org.apache.bcel.internal.classfile.JavaClass.dump(JavaClass.java
:303)
            at
com.sun.org.apache.bcel.internal.classfile.JavaClass.dump(JavaClass.java
:288)
            at
com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.dumpClass(XSLTC.j
ava:766)
            at
com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.translate(St
ylesheet.java:735)
            at
com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.jav
a:354)
            at
com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.jav
a:429)
            at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newT
emplates(TransformerFactoryImpl.java:796)
            at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newT
ransformer(TransformerFactoryImpl.java:623)

This report works fine in 1.4, but not in 1.5.

The code that we've written looks like this:

            // Setup XSLT
            TransformerFactory factory =
TransformerFactory.newInstance();
            Transformer transformer = factory.newTransformer(new
StreamSource(xslIn));

Where xslIn is a JarURLInputStream, since the XSL file is included in
the JAR.  Our first thought was to use a BufferedInputStream like this:

            // Setup XSLT
            BufferedInputStream bis = new
BufferedInputStream(xslIn,1000);
            TransformerFactory factory =
TransformerFactory.newInstance();
            Transformer transformer = factory.newTransformer(new
StreamSource(bis));


But this doesn't solve the problem at all.  The bigger issue that we
probably have is that the XSL file doesn't need to be this big.  The
reason for it is that we have embedded images in the XSL file, since FOP
works better this way.  So because of this, our XSL file is 1.5mb.


Has anyone else seen this problem in an upgrade from Java 1.4 to 1.5?

Thanks,

-Scott

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.