Hi Pietschmann, Look at what I got from tomcat community.
==== reply from tomcat-user mailing list ==== As the stack trace shows, the exception is in the FOP classes. So the amount of blame you can give Tomcat, and the amount of help you can get on this list, are both severely limited. However, just out of curiosity I went to FOP's CVS repository, to try to find the Service or Driver classes that are in the relevant part of your stack trace. I couldn't. Why aren't they at http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/apps/? If you're using an old version of FOP, the amount of support you can get here is even more limited. >root cause > >java.lang.NullPointerException > at org.apache.fop.apps.Service.providers(Driver.java:597) > at org.apache.fop.apps.Driver.setupDefaultMappings(Driver.java:319) However, speaking generically without knowing FOP internals well (though I've used it in the past): if it works the 2nd time, as you say, that must mean the Service class has initialized itself properly. And that definitely suggests the bug is in FOP itself, if there's a bug at all. Perhaps some explicit programmatic initialization (e.g. a setClassloader call) is needed to make FOP work the first time. === end of the reply === The fop I use is version 0.20.5, which is the latest one I can find in the download site. Why can we not find the classes Service and Driver reported in the exception? Liang MA Software Analyst -------------------------------------------------- RADARSAT Mission Control Centre 6767, route de l'Aeroport Saint-Hubert, Quebec J3Y 8Y9 Canada Tel: (450) 926-5099 Fax: (450) 926-5127 --------------------------------------------------- -----Original Message----- From: J.Pietschmann [mailto:[EMAIL PROTECTED] Sent: November 6, 2004 6:27 AM To: [EMAIL PROTECTED] Subject: Re: fo failed to process Unicode CJK in servlet Ma, Liang wrote: > Now here is another minor problem. Every time when I first run the servlet > to generate a pdf file after rebooting tomcat or leaving it for a couple of > days, it gives me the following exception. Then I run it again, it works > fine. Looks like there is something missing to initialize fop in my servlet. > root cause > > java.lang.NullPointerException > at org.apache.fop.apps.Service.providers(Driver.java:597) Ah, the dreaded class loader problem. Actually, I don't understand class loading in web apps well enough to point you to a solution. You might ask this on an appropriate Tomcat list (be prepared for getting flamed for using code which is not "web app ready") J.Pietschmann --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
