Re: Using krysalis with Tomcat to output PDF barcodes

Jeremias Maerki <[email protected]> Thu, 02 Sep 2004 12:56:15 +0200
Newsgroups gmane.comp.krysalis.user
Message-ID <[email protected]>
Have you tried the step-by-step procedure I described in my earlier mail?

The error message "no handler defined" normally indicates a classloader
problem. I have no Tomcat 4.0.x to try the whole thing and 4.0.x is not
available for download anymore. So I can't test your environment. Maybe
4.0 does something wrong with the classloaders. I remember that this has
been a problem in several older Tomcat releases.

There's one other thing you can try. In your servlet you can add the
following line after the Driver is instantiated:

driver.addElementMapping("org.krysalis.barcode.fop0205.BarcodeElementMapping");

This will manually plug the barcode interface into FOP what normally
happens automatically due to Java's Service Provider mechanism.
http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider

You can also monitor the class loading process by specifying "java
-verbose:class ......" on the command line.

If that still doesn't help I'm really out of ideas and you will have to
ask the Tomcat guys for more help. Everything works here under Tomcat
4.1 and 5.0 under Win32, and I know it works at least for someone under
Linux.

Good luck!

On 02.09.2004 12:02:37 Alexandre Anfray wrote:
> Sorry to ask again for your help, maybe I'm not so far to make it work...
> 
> My initial problem was because I'm under unix with no Server X available.
> I've tried several solutions ( -Djava.awt.headless=true, Xvfb (X virtual
> frame buffer) and the PJA library wich replace AWT). In each cases, I've got
> the same results: works in command-line but not in Tomcat servlet. However,
> I noticed that the previous solutions enable the krysalis sample servlet to
> output images (PNG, JPEG) whereas it didn't work without a solution for the
> serverX. So i think the server X isn't the actual problem for my
> krysalis-fop-extension servlet.
> 
> The result I obtain now invoking my fop servlet with a .fo input file (with
> barcode instructions) is a PDF file with some text but without barcode.
> There's no error messages except the following in the logs/catalina.out:
> 
> Apache Tomcat/4.0
> Starting service Tomcat-Apache
> Apache Tomcat/4.0
> [ERROR]: Logger not set
> [INFO]: building formatting object tree
> [ERROR]: Unknown formatting object
> http://www.krysalis.org/barcode/ns^barcode
> [ERROR]: Unknown formatting object
> http://www.krysalis.org/barcode/ns^code128
> [ERROR]: Unknown formatting object http://www.krysalis.org/barcode/ns^height
> [INFO]: [1]
> [ERROR]: no handler defined for http://www.krysalis.org/barcode/ns:barcode
> foreign xml
> [INFO]: Parsing of document complete, stopping rendererbash: Starting:
> command not found
> 
> 
> Hope it's a good clue for you, as for me, i don't know what's wrong and what
> to do....


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