Hello 

I want to change from fop 0.20 to fop 094 and it works fine with
standalone examples and also with tomcat but when i try with resin i got
the following exception:



        public void convertFO2PDF(File fo, File pdf, PrintWriter out)
throws IOException, FOPException 
        {
                OutputStream outx = null;
                        try 
                        {
                                    FOUserAgent foUserAgent =
fopFactory.newFOUserAgent();
                                    // configure foUserAgent as desired
                                
                                    
                                    outx = new FileOutputStream(pdf);
                                    outx = new
BufferedOutputStream(outx);
                                
                                    // Construct fop with desired output
format
                                    Fop fop =
fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, outx);
                                
                                    TransformerFactory factory = new
org.apache.xalan.processor.TransformerFactoryImpl();
                                   // TransformerFactory factory = new
org.apache.xalan.xsltc.trax.TransformerFactoryImpl(); //OLD ONE WOERKS
FINE!
                                    //TransformerFactory factory =
TransformerFactory.newInstance();
                                    
                                    Transformer transformer =
factory.newTransformer(); // identity transformer
                                    
                                    mylog(factory.getClass().getName());
        
mylog(transformer.getClass().getName());

                                    Source src = new StreamSource(fo);
                                
                                    
                                   // DefaultHandler dh =
fop.getDefaultHandler();
                                   // Result res = new SAXResult(dh);
                                    
                                    Result res = new
SAXResult(fop.getDefaultHandler());
                                   
                                    
                                   
                                    try
                                    {
                                        transformer.transform(src, res);
                                    }catch(Exception e1) 
                                    {
                                        mylog2("ERROR:" +
e1.toString());
        
out.println("<html><body><b><br/>");
                                        e1.printStackTrace(out);
        
out.println("</b><br/></body></html>");
                                    }
                                    
                                   
                                    
                                   // Result processing
                                    FormattingResults foResults =
fop.getResults();
                                    java.util.List pageSequences =
foResults.getPageSequences();
                                   for (java.util.Iterator it =
pageSequences.iterator(); it.hasNext();) 
                                        {
                                      PageSequenceResults
pageSequenceResults = (PageSequenceResults)it.next();
        
System.out.println("PageSequence " 
                                                +
(String.valueOf(pageSequenceResults.getID()).length() > 0 
                                                         ?
pageSequenceResults.getID() : "<no id>") 
                                                + " generated " +
pageSequenceResults.getPageCount() + " pages.");
                                }   
                            
                        
                        } catch (Exception e) 
                        {
                                mylog(e.toString());
                                out.println("<html>");
                                out.println("<body>");
                                out.println(e.toString());
                                out.println("<br/>");
                                out.println("</body>");
                                out.println("</html>");
                        } finally 
                        {
                                outx.close();
                        }
                }

javax.xml.transform.TransformerException:
org.xml.sax.SAXNotSupportedException:
http://xml.org/sax/handlers/DeclHandler
        at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transform
erIdentityImpl.java:502)
        at
j_servlets.j_testservlet.convertFO2PDF(j_testservlet.java:133)
        at j_servlets.j_testservlet.doGet(j_testservlet.java:53)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:114)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
        at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChai
n.java:103)
        at
com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:
159)
        at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.ja
va:175)
        at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.j
ava:240)
        at
com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:424)
        at
com.caucho.server.port.TcpConnection.run(TcpConnection.java:481)
        at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685)
        at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.xml.sax.SAXNotSupportedException:
http://xml.org/sax/handlers/DeclHandler
        at
com.caucho.xml.AbstractParser.setProperty(AbstractParser.java:473)
        at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transform
erIdentityImpl.java:480)
        ... 13 more
---------
org.xml.sax.SAXNotSupportedException:
http://xml.org/sax/handlers/DeclHandler
        at
com.caucho.xml.AbstractParser.setProperty(AbstractParser.java:473)
        at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transform
erIdentityImpl.java:480)
        at
j_servlets.j_testservlet.convertFO2PDF(j_testservlet.java:133)
        at j_servlets.j_testservlet.doGet(j_testservlet.java:53)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:114)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
        at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChai
n.java:103)
        at
com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:
159)
        at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.ja
va:175)
        at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.j
ava:240)
        at
com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:424)
        at
com.caucho.server.port.TcpConnection.run(TcpConnection.java:481)
        at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685)
        at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607)
        at java.lang.Thread.run(Thread.java:619)


Does anyone know this problem? 

Ciao 
jogl



"The information in this e-mail and in any attachments is confidential and 
intended solely 
for the attention and use of the named addressee(s). This information may be 
subject to legal, 
professional or other privilege and further distribution of it is strictly 
prohibited without 
our authority. If you are not the intended recipient, you are not authorised to 
and must not 
disclose, copy, distribute, or retain this message or any part of it, and 
should notify us 
immediately.

This footnote also confirms that this email has been automatically scanned for 
the presence 
of computer viruses, profanities and certain file types."
_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to