You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Dane Foster <df...@equitytg.com> on 2001/02/22 23:44:01 UTC
I am stumped :-( Help please!
I have come across a problem while using FOP that I just can't figure out.
I have embedded FOP in a Servlet and I'm trying to create PDF's on the fly
using DOM objects. The Servlet's doPost method (along with some private
methods) are responsible for creating the XML DOM representation of the
information submitted in the HTML Form. I have a doTransform method that
applies an XSL document to the XML DOM to produce an XSL:FO DOM object. The
XSL:FO DOM object is then passed to FOP to produce the PDF document.
Everything works great until FOP's Driver class' buildFOTree( Document dom )
method is called. I get the following Exception:
java.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java(Compiled Code))
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:253)
at org.apache.fop.apps.Driver.buildFOTree(Driver.java:637)
at com.equitytg.webTools.FormIDServlet._$84056(FormIDServlet.java:404)
at com.equitytg.webTools.FormIDServlet.doPost(FormIDServlet.java:63)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:83)
Since I can't attach a debugger to my running servlet I added a main method
to the servlet to simulate (to a minimal extent) what happens on the web in
hopes of isolating the problem area. In the main method I build a DOM just
like the one (minus most of the elements) in the doPost method. I pass the
DOM to the doTransform method as would happend on the web, then I pass the
newly created XSL:FO DOM to FOP as would happend on the web, but instead of
crashing as it does on the web, FOP works perfectly. I can't figure out
why.
I have attached the following documents:
- FormIDServlet - The Servlet where all the stuff happens
- formID.fo.xslt - The XSL Transformation document with the XSL:FO markup
I'm using:
- Xalan J2 v. 2
- Xerces-J v 1.3.0
- I'm not sure what version. Fotis Jannidis was kind enough to investigate
an earlier problem I was having with FOP and applied a fix to the CVS. He
then sent me a link to the version he was using because the CVS version I
was using was not reflecting the change he had made. I'm really pressed for
time and any help would be greatly appreciated. Thanx
Dane Foster
Equity Technology Group, Inc
http://www.equitytg.com.
954.360.9800
Re: I am stumped :-( Help please!
Posted by Arved Sandstrom <Ar...@chebucto.ns.ca>.
Cool. Thanks. I'll beat my brains out on it tonight. :-)
Arved
At 11:11 AM 2/23/01 -0500, Dane Foster wrote:
>With pleasure.
>
>Dane Foster
>Equity Technology Group, Inc
>http://www.equitytg.com.
>954.360.9800
>----- Original Message -----
>From: "Arved Sandstrom" <Ar...@chebucto.ns.ca>
>To: <fo...@xml.apache.org>
>Sent: Thursday, February 22, 2001 8:14 PM
>Subject: Re: I am stumped :-( Help please!
>
>
>At 05:44 PM 2/22/01 -0500, Dane Foster wrote:
>>I have attached the following documents:
>>- FormIDServlet - The Servlet where all the stuff happens
>>- formID.fo.xslt - The XSL Transformation document with the XSL:FO markup
>>
>>I'm using:
>>- Xalan J2 v. 2
>>- Xerces-J v 1.3.0
>
>Hi, Dane
>
>I'm willing to take a quick look at this. Can you post your HTML form
>also? Thanks.
>
>Regards,
>Arved
>
>Fairly Senior Software Type
>e-plicity (http://www.e-plicity.com)
>Wireless * B2B * J2EE * XML --- Halifax, Nova Scotia
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
>For additional commands, email: fop-dev-help@xml.apache.org
>
>
>
>Attachment Converted: "c:\eudora\attach\formId.zip"
>---------------------------------------------------------------------
>To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
>For additional commands, email: fop-dev-help@xml.apache.org
Fairly Senior Software Type
e-plicity (http://www.e-plicity.com)
Wireless * B2B * J2EE * XML --- Halifax, Nova Scotia
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
Re: I am stumped :-( Help please!
Posted by Arved Sandstrom <Ar...@chebucto.ns.ca>.
Hi, Dane
I have your servlet working fine, with no code tweaks (OK, one, I changed
the package so I didn't have to nest it) to either it, or the XSLT. The
Reader plugin launches properly and displays a pretty good looking form (I
enclose that as proof :-)).
I used Orion application server (1.3.8), and gave it the required JARs that
come with FOP 0.17: Xerces, Xalan, FOP itself, and w3c.jar (the SVG stuff).
The web.xml I used is:
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>FormIDServlet</servlet-name>
<display-name>FormID</display-name>
<servlet-class>FormIDServlet</servlet-class>
<init-param>
<param-name>XSLTPath</param-name>
<param-value>c:/DistributedComputing/orion/applications/DFoster/foserv-web/f
ormID.fo.xslt</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>FormIDServlet</servlet-name>
<url-pattern>/FormIDServlet</url-pattern>
</servlet-mapping>
</web-app>
and I should add that the HTML form opening tag I changed a bit to
<FORM name=formId action=/foserv/FormIDServlet method=post>
because that context root maps to the actual web-app folder, the way
_I_ have it set up.
I never saw the error you had most recently. FOP version maybe? Has to be -
what you're seeing is not a servlet thing. In any case, there _is_ a
combination of stuff that works. It's not your code.
Hope this helps. Regards,
Arved
At 11:11 AM 2/23/01 -0500, Dane Foster wrote:
>With pleasure.
>
>Dane Foster
>Equity Technology Group, Inc
>http://www.equitytg.com.
>954.360.9800
>----- Original Message -----
>From: "Arved Sandstrom" <Ar...@chebucto.ns.ca>
>To: <fo...@xml.apache.org>
>Sent: Thursday, February 22, 2001 8:14 PM
>Subject: Re: I am stumped :-( Help please!
>
>
>At 05:44 PM 2/22/01 -0500, Dane Foster wrote:
>>I have attached the following documents:
>>- FormIDServlet - The Servlet where all the stuff happens
>>- formID.fo.xslt - The XSL Transformation document with the XSL:FO markup
>>
>>I'm using:
>>- Xalan J2 v. 2
>>- Xerces-J v 1.3.0
>
>Hi, Dane
>
>I'm willing to take a quick look at this. Can you post your HTML form
>also? Thanks.
>
>Regards,
>Arved
>
>Fairly Senior Software Type
>e-plicity (http://www.e-plicity.com)
>Wireless * B2B * J2EE * XML --- Halifax, Nova Scotia
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
>For additional commands, email: fop-dev-help@xml.apache.org
>
>
>
>Attachment Converted: "c:\eudora\attach\formId.zip"
>---------------------------------------------------------------------
>To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
>For additional commands, email: fop-dev-help@xml.apache.org
Re: I am stumped :-( Help please!
Posted by Dane Foster <df...@equitytg.com>.
With pleasure.
Dane Foster
Equity Technology Group, Inc
http://www.equitytg.com.
954.360.9800
----- Original Message -----
From: "Arved Sandstrom" <Ar...@chebucto.ns.ca>
To: <fo...@xml.apache.org>
Sent: Thursday, February 22, 2001 8:14 PM
Subject: Re: I am stumped :-( Help please!
At 05:44 PM 2/22/01 -0500, Dane Foster wrote:
>I have attached the following documents:
>- FormIDServlet - The Servlet where all the stuff happens
>- formID.fo.xslt - The XSL Transformation document with the XSL:FO markup
>
>I'm using:
>- Xalan J2 v. 2
>- Xerces-J v 1.3.0
Hi, Dane
I'm willing to take a quick look at this. Can you post your HTML form
also? Thanks.
Regards,
Arved
Fairly Senior Software Type
e-plicity (http://www.e-plicity.com)
Wireless * B2B * J2EE * XML --- Halifax, Nova Scotia
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
Re: I am stumped :-( Help please!
Posted by Arved Sandstrom <Ar...@chebucto.ns.ca>.
At 05:44 PM 2/22/01 -0500, Dane Foster wrote:
>I have attached the following documents:
>- FormIDServlet - The Servlet where all the stuff happens
>- formID.fo.xslt - The XSL Transformation document with the XSL:FO markup
>
>I'm using:
>- Xalan J2 v. 2
>- Xerces-J v 1.3.0
Hi, Dane
I'm willing to take a quick look at this. Can you post your HTML form
also? Thanks.
Regards,
Arved
Fairly Senior Software Type
e-plicity (http://www.e-plicity.com)
Wireless * B2B * J2EE * XML --- Halifax, Nova Scotia
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org