Re: FopServlet example!

2003-02-12 Thread Ken Masters


Thank you both. I have now implemented a class that takes two strings 
(xml-source and xsl-source and the servlet-response) and the class deals 
with converting this.

If anyone would like a copy of this please let me know.

Thanks again.

Ghulam



From: J.Pietschmann [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: FopServlet example!
Date: Tue, 11 Feb 2003 23:44:50 +0100

Ken Masters wrote:

I am new to Apache FOP, and am finding a little problem with what I'm 
doing. The XSLTInputHandler class has two parameters, the XML and XSL 
File's. Basically what I would like to do is pass an XML as a Java String 
(since it is dynamically created) and the XSL can be passed as a File.

FAQ:
  http://xml.apache.org/fop/faq.html#faq-N102B3

J.Pietschmann


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



_
Express yourself with cool emoticons http://messenger.msn.co.uk


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




Re: FopServlet example!

2003-02-12 Thread Ken Masters

Hi,

Ive attached the Java class, (and included it at the bottom incase 
attachment fails to send).

There are two methods, and they both require the HttpServletResponse. It 
provides options for either sending it the XML and XSL as files or strings.

Ensure that you have copied the following jar files into your 
TOMCAT_HOME\lib directory:

* avalon-framework-cvs-20020315.jar
* batik.jar
* fop.jar

which are all found in the Apache FOP distribution.

Hope it help.

Ken



-
import javax.servlet.*;
import javax.servlet.http.*;

import java.io.*;
import javax.xml.transform.*;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.sax.SAXResult;

import org.apache.fop.apps.Driver;
import org.apache.fop.apps.Version;
import org.apache.fop.apps.XSLTInputHandler;
import org.apache.fop.messaging.MessageHandler;


public class ConvertToPDF
{

 private TransformerFactory xsltFact = TransformerFactory.newInstance();


   public ConvertToPDF()
   {
   //Default Constructor
   }//Constructor()



	public void convertXmlToPDF( String xmlsource, String xslsource, 
HttpServletResponse response )
	{
	  response.setContentType(application/pdf);

 try {

   Reader xmlReader = new StringReader(xmlsource);
   Reader xslReader = new StringReader(xslsource);

   Source xml = new StreamSource(xmlReader);
   Source xsl = new StreamSource(xslReader);


	Driver driver =new Driver();
	driver.setOutputStream(response.getOutputStream());
	driver.setRenderer(Driver.RENDER_PDF);

	Transformer transformer = 
TransformerFactory.newInstance().newTransformer(xsl);
	transformer.transform(xml, new SAXResult(driver.getContentHandler()));
   }//try
 catch (Exception ex) {
   ex.printStackTrace();
   }//catch

   }//convertXmlToPDF()




	public void convertXmlToPDF( String xmlsource, File xslPath, 
HttpServletResponse response )
	{
	response.setContentType(application/pdf);

 try {
   Reader xmlReader = new StringReader(xmlsource);

   Source xml = new StreamSource(xmlReader);
   Source xsl = new StreamSource(xslPath);


	Driver driver =new Driver();
	driver.setOutputStream(response.getOutputStream());
	driver.setRenderer(Driver.RENDER_PDF);

	Transformer transformer = 
TransformerFactory.newInstance().newTransformer(xsl);
	transformer.transform(xml, new SAXResult(driver.getContentHandler()));

   }//try
 catch (Exception ex) {
   ex.printStackTrace();
   }//catch

   }//convertXmlToPDF()

}//End all
-





_
Use MSN Messenger to send music and pics to your friends 
http://messenger.msn.co.uk


ConvertToPDF.java
Description: java/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


RE: FopServlet example!

2003-02-11 Thread Mark C. Allman
Write your own InputHandler to do what you need.  Then do the usual
driver.render() call:

Driver driver = new Driver();

InputHandler inputHandler =
new MyCustomInputHandler(..whatever your InputHandler needs..);

driver.setOutputStream(..wherever you want the output to go..);
driver.render(inputHandler.getParser(),
inputHandler.getInputSource());

-- Mark C. Allman
-- Allman Professional Consulting, Inc.
-- www.allmanpc.com, 617-947-4263


-Original Message-
From: Ken Masters [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, February 11, 2003 4:16 PM
To: [EMAIL PROTECTED]
Subject: FopServlet example!

Hi everyone,

I am new to Apache FOP, and am finding a little problem with what I'm
doing. 
The XSLTInputHandler class has two parameters, the XML and XSL File's. 
Basically what I would like to do is pass an XML as a Java String (since
it 
is dynamically created) and the XSL can be passed as a File.

How would I go about doing something like this, where the XML is created

dynamically by a Servlet (from an XML database,Apache-Xindice), and
passing 
this onto the XSLTInputHandler class (or any other class).

Thanking you in advance!

Ken



_
Overloaded with spam? With MSN 8, you can filter it out 
http://join.msn.com/?page=features/junkmailpgmarket=en-gbXAPID=32DI=1
059


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


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




Re: FopServlet example!

2003-02-11 Thread J.Pietschmann
Ken Masters wrote:

I am new to Apache FOP, and am finding a little problem with what I'm 
doing. The XSLTInputHandler class has two parameters, the XML and XSL 
File's. Basically what I would like to do is pass an XML as a Java 
String (since it is dynamically created) and the XSL can be passed as a 
File.

FAQ:
  http://xml.apache.org/fop/faq.html#faq-N102B3

J.Pietschmann


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




Re: FopServlet

2002-06-16 Thread J.Pietschmann

Nirupama Yalavarti wrote:
 I could do that..THE file is being saved in
 jtomcat/bin
 Is there any way to change that location? may be to
 jtomcat/webapps/deployment directory ?

Thousands of possibilities.
Hardcode
  FileOutputStream fos=new FileOutputStream(../webapps/whatever/test12.pdf);
or investigate what you can do with
HttpServletRequest.getPathTranslated()

Now this is gettin way off of topic...

J.Pietschmann


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




Re: FopServlet

2002-06-15 Thread J.Pietschmann

Nirupama Yalavarti wrote:
 But I have programmed that the pdf is saved to
 specific file(that is the way I want it) ie teh pdf
 generated be saved as a specific file in the server.
 But that doesnt seem to happen.I was expecting it to
 be saved in tomcat/bin.
 Any idea of setting something else for that?
 Thanks
 Nirupama
 
 This what I have written:
 
 ByteArrayOutputStream xslOut = new
 ByteArrayOutputStream();
 byte[] pdfOutData = doRenderPDF(xslOut);
  

 response.setContentType(application/pdf);
 
 response.setContentType(application/pdf;
 name=\test12.pdf\);
 response.setHeader(Content-Disposition,
 inline;filename=\test12.pdf\);

You should only set *one* of the above.

 response.setContentLength(pdfOutData.length);
 
 OutputStream resOut = response.getOutputStream();
 resOut.write(pdfOutData);
 resOut.close();

Apart from this, you are writing your PDF to the servlet's
output stream and therefore to the browser. The
content-disposition setting is a hint for the *browser* on
how to save the content if it chooses to.
If you want to write to a file on the server, use something
like
  FileOutputStream fos=new FileOutputStream(test12.pdf);
  fos.write(pdfOutData);
  fos.close();

J.Pietschmann


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




Re: FopServlet

2002-06-15 Thread Nirupama Yalavarti


--- J.Pietschmann [EMAIL PROTECTED] wrote:
 Nirupama Yalavarti wrote:
  But I have programmed that the pdf is saved to
  specific file(that is the way I want it) ie teh
 pdf
  generated be saved as a specific file in the
 server.
  But that doesnt seem to happen.I was expecting it
 to
  be saved in tomcat/bin.
  Any idea of setting something else for that?
  Thanks
  Nirupama
  
  This what I have written:
  
  ByteArrayOutputStream xslOut = new
  ByteArrayOutputStream();
  byte[] pdfOutData = doRenderPDF(xslOut);
   
 
  response.setContentType(application/pdf);
  
  response.setContentType(application/pdf;
  name=\test12.pdf\);
  response.setHeader(Content-Disposition,
  inline;filename=\test12.pdf\);
 
 You should only set *one* of the above.
 
  response.setContentLength(pdfOutData.length);
  
  OutputStream resOut = response.getOutputStream();
  resOut.write(pdfOutData);
  resOut.close();
 
 Apart from this, you are writing your PDF to the
 servlet's
 output stream and therefore to the browser. The
 content-disposition setting is a hint for the
 *browser* on
 how to save the content if it chooses to.
 If you want to write to a file on the server, use
 something
 like
   FileOutputStream fos=new
 FileOutputStream(test12.pdf);
   fos.write(pdfOutData);
   fos.close();
 
 J.Pietschmann
 
 

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

Thanks , I figured that out...
I could do that..THE file is being saved in
jtomcat/bin
Is there any way to change that location? may be to
jtomcat/webapps/deployment directory ?


=


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




Re: FopServlet

2002-06-14 Thread Holger Prause


- Original Message -
From: J.Pietschmann [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 14, 2002 1:47 AM
Subject: Re: FopServlet


 Nirupama Yalavarti wrote:
  Thats a great anwere...THE servlet seems to ahve run
  correctly( In fact it didnt show me any error..)
  But where can I find the produced pdf? any idea?

 In your browser? Look into the browser cache first.
 IEx is a bit fragile when it comes to showing PDF.
 Configure your webapp so that you can use an URL
 ending in .pdf for retrieving the PDF:
   http://my.host/some/path/to/servlet.pdf
 or

http://my.host/some/path/to/servlet.pdf?xml=foo.xmlxsl=foo.xsldummy=.pdf



Hello,

maybe you have Avtive X disabled and thats the reason why u dont see the
produced pdf.

I took my an half an hout to find this out .-)



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




Re: FopServlet

2002-06-14 Thread Nirupama Yalavarti


--- Holger Prause [EMAIL PROTECTED] wrote:
 
 - Original Message -
 From: J.Pietschmann [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, June 14, 2002 1:47 AM
 Subject: Re: FopServlet
 
 
  Nirupama Yalavarti wrote:
   Thats a great anwere...THE servlet seems to ahve
 run
   correctly( In fact it didnt show me any error..)
   But where can I find the produced pdf? any idea?
 
  In your browser? Look into the browser cache
 first.
  IEx is a bit fragile when it comes to showing PDF.
  Configure your webapp so that you can use an URL
  ending in .pdf for retrieving the PDF:
http://my.host/some/path/to/servlet.pdf
  or
 

http://my.host/some/path/to/servlet.pdf?xml=foo.xmlxsl=foo.xsldummy=.pdf
 
 
 
 Hello,
 
 maybe you have Avtive X disabled and thats the
 reason why u dont see the
 produced pdf.
 
 I took my an half an hout to find this out .-)

Thanks a lot, but I could get it by placing the dummy
parameter.
Nirupama


=


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




Re: FopServlet

2002-06-13 Thread J.Pietschmann

Nirupama Yalavarti wrote:
 Hi all...
 I am damn new to Tomcat  and Fop.Ive been trying to
 sue Fop thru a servlet and was using the example
 FopServlet of the examples/embedding. That minimal
 thing itself doesnt seemt ot work and it geives me
 errors..
 Can anyone help me out...
 It gives me the following errors...
...
 java.lang.ClassNotFoundException:
 javax.xml.transform.Transformer

The servlet's class loader can't find Xalan.

Are you using Tomcat 4.0.3? In this case, either copy
the Xalan jar, fop.jar and batik.jar from the webapp's
lib directory into Tomcat's lib directory, or upgrade
to Tomcat 4.0.4b3.
I think i've seen more detailed instructions in some
Tomcat documentation.

Otherwise, check yout webapp's lib directory whether it
contains all the jars from the FOP duirstribution's lib
directory.

J.Pietschmann


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




Re: FopServlet

2002-06-13 Thread Nirupama Yalavarti

Thats a great anwere...THE servlet seems to ahve run
correctly( In fact it didnt show me any error..)
But where can I find the produced pdf? any idea?

--- J.Pietschmann [EMAIL PROTECTED] wrote:
 Nirupama Yalavarti wrote:
  Hi all...
  I am damn new to Tomcat  and Fop.Ive been trying
 to
  sue Fop thru a servlet and was using the example
  FopServlet of the examples/embedding. That minimal
  thing itself doesnt seemt ot work and it geives me
  errors..
  Can anyone help me out...
  It gives me the following errors...
 ...
  java.lang.ClassNotFoundException:
  javax.xml.transform.Transformer
 
 The servlet's class loader can't find Xalan.
 
 Are you using Tomcat 4.0.3? In this case, either
 copy
 the Xalan jar, fop.jar and batik.jar from the
 webapp's
 lib directory into Tomcat's lib directory, or
 upgrade
 to Tomcat 4.0.4b3.
 I think i've seen more detailed instructions in some
 Tomcat documentation.
 
 Otherwise, check yout webapp's lib directory whether
 it
 contains all the jars from the FOP duirstribution's
 lib
 directory.
 
 J.Pietschmann
 
 

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


=


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




Re: FopServlet

2002-06-13 Thread J.Pietschmann

Nirupama Yalavarti wrote:
 Thats a great anwere...THE servlet seems to ahve run
 correctly( In fact it didnt show me any error..)
 But where can I find the produced pdf? any idea?

In your browser? Look into the browser cache first.
IEx is a bit fragile when it comes to showing PDF.
Configure your webapp so that you can use an URL
ending in .pdf for retrieving the PDF:
  http://my.host/some/path/to/servlet.pdf
or
   http://my.host/some/path/to/servlet.pdf?xml=foo.xmlxsl=foo.xsldummy=.pdf

More importantly, set the content type correctly
to application/pdf, and buffer the PDF output in
a ByteArrayOutputStream so that you can send the
exact length to the browser (IEx will show a
blank window if you fail to do this).

J.Pietschmann


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




Re: FopServlet

2002-06-13 Thread Nirupama Yalavarti

Yes! I noticed that..because that was working fine
with netscape. and should work now with IEx too.
But I have programmed that the pdf is saved to
specific file(that is the way I want it) ie teh pdf
generated be saved as a specific file in the server.
But that doesnt seem to happen.I was expecting it to
be saved in tomcat/bin.
Any idea of setting something else for that?
Thanks
Nirupama

This what I have written:

ByteArrayOutputStream xslOut = new
ByteArrayOutputStream();
byte[] pdfOutData = doRenderPDF(xslOut);
 
   
response.setContentType(application/pdf);

response.setContentType(application/pdf;
name=\test12.pdf\);
response.setHeader(Content-Disposition,
inline;filename=\test12.pdf\);
response.setContentLength(pdfOutData.length);

OutputStream resOut = response.getOutputStream();
resOut.write(pdfOutData);
resOut.close();



 In your browser? Look into the browser cache first.
 IEx is a bit fragile when it comes to showing PDF.
 Configure your webapp so that you can use an URL
 ending in .pdf for retrieving the PDF:
   http://my.host/some/path/to/servlet.pdf
 or
   

http://my.host/some/path/to/servlet.pdf?xml=foo.xmlxsl=foo.xsldummy=.pdf
 
 More importantly, set the content type correctly
 to application/pdf, and buffer the PDF output in
 a ByteArrayOutputStream so that you can send the
 exact length to the browser (IEx will show a
 blank window if you fail to do this).
 
 J.Pietschmann


=


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




RE: FopServlet error

2002-03-05 Thread Carlos Daniel Schafer

Hi

You have look the file web.xml into fop.war is configured for other Tomcat,
I think so Tomcat 3.0, may be and your Tomcat is diferent.
Today, I take this same problem.


I sorry, my English is very bad, may be Indian. I'm the Argentina, Buenos
Aires.


 -Mensaje original-
 De:   Dunning, John [SMTP:[EMAIL PROTECTED]]
 Enviado el:   martes, 05 de marzo de 2002 17:05
 Para: '[EMAIL PROTECTED]'
 Asunto:   FopServlet error
 
 Hello,
 I'm trying to get the FopServlet example working; I've placed the fop.war
 file in the /webapps/ directory, but now when I start Tomcat I get this
 message on the console window:
 
 Starting service Tomcat-Standalone
 Apache Tomcat/4.0.3
 PARSE error at line 26 column 23
 org.xml.sax.SAXParseException: The content of element type
 servlet-mapping
 must match (servlet-name,url-pattern).
 
 Looking at the configuration files that come with Tomcat, the
 servlet-mapping content is as expected.  Anyone else experiened this, or
 any suggestions?
 
 TIA,
 John
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]

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




Re: FopServlet error

2002-03-05 Thread david

The web.xml file in fop.war is bad.  Open the .war, and remove the
servlet-mapping element with /servlet/fop in it.  The extra
servlet-mapping child element violates the DTD.  The corrected web.xml file
should be:

?xml version=1.0 encoding=ISO-8859-1?
!-- edited with XML Spy v3.5 NT (http://www.xmlspy.com) by () --
!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
2.2//EN
http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;
web-app
servlet
servlet-nameFop/servlet-name
servlet-classFopServlet/servlet-class
/servlet
servlet-mapping
servlet-nameFop/servlet-name
url-pattern/fop/url-pattern
/servlet-mapping
/web-app

:)

- Original Message -
From: Carlos Daniel Schafer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 05, 2002 3:08 PM
Subject: RE: FopServlet error


 Hi

 You have look the file web.xml into fop.war is configured for other
Tomcat,
 I think so Tomcat 3.0, may be and your Tomcat is diferent.
 Today, I take this same problem.


 I sorry, my English is very bad, may be Indian. I'm the Argentina, Buenos
 Aires.


  -Mensaje original-
  De: Dunning, John [SMTP:[EMAIL PROTECTED]]
  Enviado el: martes, 05 de marzo de 2002 17:05
  Para: '[EMAIL PROTECTED]'
  Asunto: FopServlet error
 
  Hello,
  I'm trying to get the FopServlet example working; I've placed the
fop.war
  file in the /webapps/ directory, but now when I start Tomcat I get this
  message on the console window:
 
  Starting service Tomcat-Standalone
  Apache Tomcat/4.0.3
  PARSE error at line 26 column 23
  org.xml.sax.SAXParseException: The content of element type
  servlet-mapping
  must match (servlet-name,url-pattern).
 
  Looking at the configuration files that come with Tomcat, the
  servlet-mapping content is as expected.  Anyone else experiened this,
or
  any suggestions?
 
  TIA,
  John
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]

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



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




RE: FopServlet

2002-03-04 Thread Volker [EMAIL PROTECTED]

It looks as if your tomcat installation does not pick up Xalan.jar.
You have to put all FOP jars (fop.jar, batik.jar etc.) into
yourwebapp/WEB-INF/lib/
directory.

Hope this helps

Volker

-Original Message-
From: Deb Schmutz [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 04, 2002 2:17 AM
To: [EMAIL PROTECTED]
Subject: FopServlet


I am new to Fop and having problems with the
FopServlet that came with Fop-0.20.2.  Please can
anyone give me any pointers.  TIA.

Error: 500
Location: /fop/fop
Internal Servlet Error:

javax.servlet.ServletException
at FopServlet.renderXML(FopServlet.java:135)
at FopServlet.doGet(FopServlet.java:77)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at
org.apache.tomcat.core.Handler.service(Handler.java:287)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:81
2)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)

Root cause:
org.apache.fop.apps.FOPException
at
org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:109)
at FopServlet.renderXML(FopServlet.java:128)
at FopServlet.doGet(FopServlet.java:77)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at
org.apache.tomcat.core.Handler.service(Handler.java:287)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:81
2)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)

-

java.lang.reflect.InvocationTargetException:
javax.xml.transform.TransformerFactoryConfigurationError:
java.lang.ClassNotFoundException:
org.apache.xalan.processor.TransformerFactoryImpl
at
javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:1
21)
at
org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:72)
at java.lang.reflect.Method.invoke(Native Method)
at
org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102)
at FopServlet.renderXML(FopServlet.java:128)
at FopServlet.doGet(FopServlet.java:77)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at
org.apache.tomcat.core.Handler.service(Handler.java:287)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:81
2)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
javax.xml.transform.TransformerFactoryConfigurationError:
java.lang.ClassNotFoundException:
org.apache.xalan.processor.TransformerFactoryImpl
at
javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:1
21)
at
org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:72)
at java.lang.reflect.Method.invoke(Native Method)
at
org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102)
at FopServlet.renderXML(FopServlet.java:128)
at FopServlet.doGet(FopServlet.java:77)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at

Re: FopServlet

2002-03-04 Thread Karen Lease

Deb,

Which version of tomcat are you using? Especially with Tomcat 3.x I've
seen lots of classloader problems. Can you find out which jars are being
used by tomcat (in its lib or maybe lib/ext directory)? Look out for
jaxp.jar or perhaps a version of xerces at that level which would be
pulling in xalan. What can happen is that the javax.xml.transform is
found in tomcat's jaxp.jar and if it's set up to use Xalan, it will only
look for it in tomcat's classpath, not in your own webapp classpath,
which seems to have the right stuff in it.

Also do have any XML type jars in your java or jre lib/ext directory?

HTH,
Karen


Deb Schmutz wrote:
 
 I believe I have all the jar files that I need.  Here
 is what my war file looks like:
 
 META-INF/
 META-INF/MANIFEST.MF
 WEB-INF/
 WEB-INF/lib/
 WEB-INF/lib/ant.jar
 WEB-INF/lib/avalon-framework-4.0.jar
 WEB-INF/lib/batik.jar
 WEB-INF/lib/bsf.jar
 WEB-INF/lib/buildtools.jar
 WEB-INF/lib/jimi-1.0.jar
 WEB-INF/lib/logkit-1.0b4.jar
 WEB-INF/lib/stylebook.jar
 WEB-INF/lib/xalan-1.2.2.jar
 WEB-INF/lib/xalan-2.0.0.jar
 WEB-INF/lib/xalanj1compat.jar
 WEB-INF/lib/xerces-1.2.3.jar
 WEB-INF/lib/fop.jar
 WEB-INF/lib/servlet.jar
 WEB-INF/classes/
 WEB-INF/classes/FopServlet.class
 images/
 images/CompHealth-Logo.gif
 WEB-INF/web.xml
 
 --- Volker [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:
  It looks as if your tomcat installation does not
  pick up Xalan.jar.
  You have to put all FOP jars (fop.jar, batik.jar
  etc.) into
  yourwebapp/WEB-INF/lib/
  directory.
 
  Hope this helps
 
  Volker
 
  -Original Message-
  From: Deb Schmutz [mailto:[EMAIL PROTECTED]]
  Sent: Monday, March 04, 2002 2:17 AM
  To: [EMAIL PROTECTED]
  Subject: FopServlet
 
 
  I am new to Fop and having problems with the
  FopServlet that came with Fop-0.20.2.  Please can
  anyone give me any pointers.  TIA.
 
  Error: 500
  Location: /fop/fop
  Internal Servlet Error:
 
  javax.servlet.ServletException
at FopServlet.renderXML(FopServlet.java:135)
at FopServlet.doGet(FopServlet.java:77)
at
 
 javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at
 
 javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
 
 org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at
 
 org.apache.tomcat.core.Handler.service(Handler.java:287)
at
 
 org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
 
 org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:81
  2)
at
 
 org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at
 
 org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
  onnectionHandler.java:213)
at
 
 org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
 
 org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
 
  Root cause:
  org.apache.fop.apps.FOPException
at
 
 org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:109)
at FopServlet.renderXML(FopServlet.java:128)
at FopServlet.doGet(FopServlet.java:77)
at
 
 javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at
 
 javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
 
 org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at
 
 org.apache.tomcat.core.Handler.service(Handler.java:287)
at
 
 org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
 
 org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:81
  2)
at
 
 org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at
 
 org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
  onnectionHandler.java:213)
at
 
 org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
 
 org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
 
  -
 
  java.lang.reflect.InvocationTargetException:
 
 javax.xml.transform.TransformerFactoryConfigurationError:
  java.lang.ClassNotFoundException:
  org.apache.xalan.processor.TransformerFactoryImpl
at
 
 javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:1
  21)
at
 
 org.apache.fop.apps.TraxInputHandler.getXMLFilter(TraxInputHandler.java:72)
at java.lang.reflect.Method.invoke(Native Method)
at
 
 org.apache.fop.apps.XSLTInputHandler.getParser(XSLTInputHandler.java:102)
at FopServlet.renderXML(FopServlet.java:128)
at FopServlet.doGet(FopServlet.java:77)
at
 
 javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at
 
 javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at