Re: Using krysalis with Tomcat to output PDF barcodes
Jeremias Maerki <[email protected]> Mon, 30 Aug 2004 22:44:23 +0200
| Newsgroups | gmane.comp.krysalis.user |
|---|---|
| Message-ID | <[email protected]> |
On 30.08.2004 16:51:56 Alexandre Anfray wrote:
> Thanks Jeremias for your fast and encouraging answer !!!
>
> I'm using Tomcat 4.0 but as you told me it works with a newer version,
I've just tried with Tomcat 4.1.29 and JDK 1.3.1_10. Works fine.
> I've set up Tomcat 5.0.28 and Java2sdk-1.4.2_05 (on another machine).
> The server works, the examples work as well, then I tried to add a Fop
> Servlet
> but can't make it work.
>
> I know it's not a krysalis issue...but here's what I've done:
> I copy the fop folder (the one which works on Tomcat 4.0) in the webapps
> folder
> and when I try to access the servlet, i've got a 404 error.
404 usually means that the page is not found and the URL is wrong. What
URLs are you using?
> Here is the web.xml file form the fop folder:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <!DOCTYPE web-app
> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> "http://java.sun.com/dtd/web-app_2_3.dtd">
>
> <web-app>
> <servlet>
> <servlet-name>Fop</servlet-name>
> <servlet-class>FopServlet</servlet-class>
> <load-on-startup>1</load-on-startup>
> </servlet>
> <servlet-mapping>
> <servlet-name>Fop</servlet-name>
> <url-pattern>*.pdf</url-pattern>
> </servlet-mapping>
> <servlet-mapping>
> <servlet-name>Fop</servlet-name>
> <url-pattern>/fop</url-pattern>
> </servlet-mapping>
> </web-app>
I've tried your web.xml and it works fine.
> I've read information about how to set up web application in Tomcat but
> haven't
> found what's wrong as the fop folder is the same on Tomcat 4.0 and Tomcat
> 5.0.28
It's not clear to me either.
> I tried the Krysalis Servlet on Tomcat 5.0.28 with success (but it generates
> SVG,
> and I need PDF....)
Then let's try it differently. Here's what I've done, step by step:
1. Unzip Tomcat (whatever version)
2. Build FOP and the FOP Servlet in the examples/servlet directory.
3. Drop fop.war into Tomcat's webapps directory
4. run startup.bat/sh
5. Browser: http://localhost:8080/fop/servlet/FopServlet?fo=C:\Dev\krysalis.org\_releases\krysalis-barcode-1.0beta\examples\xsl-fo\fop-extension-demo.fo&ext=.pdf
(obviously you have to adjust the path, the "&ext=.pdf" is to trick
Internet Explorer to handle the PDF correctly.)
6. You should now get the PDF without any barcode. Error messages from
Tomcat complaining about unknown extension objects.
7. Stop Tomcat
8. Copy krysalis-barcode-fop-ext-0.20.5-complete.jar into the
webapps/fop/WEB-INF/lib directory.
9. Copy avalon-framework-4.1.4.jar (or newer) into webapps/fop/WEB-INF/lib
and delete the old one from FOP.
10. Start Tomcat again and use the same URL as above.
The big difference we have here is that I'm obviously on Windows and
you're on a Unix. But I've done things like that on Unixes before so I
don't think that's the difference.
So if you follow the procedure above and you still run into problems I'm
pretty much out of ideas. This SHOULD work! I've done it three times now
and it worked each time.
Good luck.
Jeremias Maerki
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click