You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Roberto Venanzi <ve...@sigen.it> on 2003/02/27 12:25:21 UTC

FopServlet error in Oracle OC4J

HI, I have problems with the following code in the FopServlet that 
run in Oracle OC4J:

in the FopServlet I have modified the metod renderFO to add a barcode font:

 /**
     * renders an FO inputsource into a PDF file which is rendered
     * directly to the response object's OutputStream
     */
    public void renderFO(InputSource foFile,
                         HttpServletResponse response) throws 
ServletException {
        try {
            ByteArrayOutputStream out = new ByteArrayOutputStream();

            response.setContentType("application/pdf");

            // ---- ATT! ROWS ADDED TO ADD BARCODE FONT ----
            File userConfigFile = new File("C:\\FOP\\userconfig.xml");
            Options options = new Options(userConfigFile);
            // ---- END ROWS ADDED -------------------------

            Driver driver = new Driver(foFile, out);
            driver.setLogger(log);
            driver.setRenderer(Driver.RENDER_PDF);
            driver.run();

            byte[] content = out.toByteArray();
            response.setContentLength(content.length);
            response.getOutputStream().write(content);
            response.getOutputStream().flush();
        } catch (Exception ex) {
            throw new ServletException(ex);
        }
    }


the error is:

java.lang.ClassCastException: oracle.xml.jaxp.JXSAXParserFactory
at javax.xml.parsers.SAXParserFactory.newInstance(Unknown 
Source)
at 
org.apache.fop.configuration.ConfigurationReader.createParser(Unknown 
Source)
at org.apache.fop.configuration.ConfigurationReader.start
(Unknown Source)
at org.apache.fop.apps.Options.loadStandardConfiguration
(Unknown Source)
at org.apache.fop.apps.Options.<init>(Unknown Source)
at org.apache.fop.apps.Options.<init>(Unknown Source)
at FopServlet.renderFO(FopServlet.java:96)
at FopServlet.doGet(FopServlet.java:66)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for 
J2EE].server.http.ServletRequestDispatcher.invoke
(ServletRequestDispatcher.java:721)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for 
J2EE].server.http.ServletRequestDispatcher.forwardInternal
(ServletRequestDispatcher.java:306)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for 
J2EE].server.http.HttpRequestHandler.processRequest
(HttpRequestHandler.java:767)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for 
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for 
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run
(PooledExecutor.java:797)
at java.lang.Thread.run(Unknown Source)


Anyone can help me?


Roberto



Re: FopServlet error in Oracle OC4J

Posted by Johan Ã…brandt <jo...@profitsoftware.com>.
Jeremias Maerki wrote:

> I wonder what the Oracle guys did to that server that it generates so
> many problems. :-)

Bought it from Ironflare?

__________________________________________________________________________

This message and its attachments have been found clean from known viruses 
with three different antivirus programs.
__________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


FOP + JFOR

Posted by Eduardo Santilli <sa...@sicredi.com.br>.
Someone know how to integrate JFOR with FOP????


Thanks...
Eduardo Santilli


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: FopServlet error in Oracle OC4J

Posted by Jeremias Maerki <de...@greenmail.ch>.
I wonder what the Oracle guys did to that server that it generates so
many problems. :-)

Anyway, can you please check if you have any JAXP libraries from FOP in
the classpath (xml-api.jar, xalan.jar, xercesImpl.jar)? If yes try
removing them. Maybe something like that interferes with Oracle's JAXP
implementation.

FOP uses plain JAXP by the book in its latest version. So if anything
goes wrong with Oracle's implementation and you don't have any foreign
JAXP implementations in your classpath, I suggest you contact Oracle
support to help you, because the exception does not happen in FOP
directly but in the JAXP API (see top of stacktrace:
SAXParserFactory.newInstance).

On 27.02.2003 12:25:21 Roberto Venanzi wrote:
> HI, I have problems with the following code in the FopServlet that 
> run in Oracle OC4J:
> 
> in the FopServlet I have modified the metod renderFO to add a barcode font:

<snip/>

> the error is:
> 
> java.lang.ClassCastException: oracle.xml.jaxp.JXSAXParserFactory
> at javax.xml.parsers.SAXParserFactory.newInstance(Unknown 
> Source)
> at 
> org.apache.fop.configuration.ConfigurationReader.createParser(Unknown 
> Source)
> at org.apache.fop.configuration.ConfigurationReader.start
> (Unknown Source)

<snip/>

> Anyone can help me?



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org