Hello!
 
InputSource class have the only String constructor and that String is supposed to be system id (URI), for example, file name.
If you want to create InputSource from serialized xml you need something like
new InputSource(new StringReader(src))

---
Oleg Tkachenko,
Multiconn International, Israel

-----Original Message-----
From: Massimiliano Cuccia [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 4:05 PM
To: [EMAIL PROTECTED]
Subject: runtime ExceptionInInitializerError: first steps

I have a problem in running this code ... I had just cut&paste from documentation 
can anyone help me??? I don't know where to start ...
 
    public void test1(String src, String dst)
    {
         try
         {
            Driver driver = new Driver(new InputSource(src), new FileOutputStream(dst));
            driver.setRenderer(Driver.RENDER_PDF);
   
            driver.run();
        }
        catch (Exception ex)
        {
             ex.printStackTrace();
        }
    }
 
I'm calling test1 by this way
    test1("c:\\prova.fo", "c:\\prova.pdf");
 
I tryed passing a fo string for src parameter too
something like this
 
    String src =" "<?xml" version="1.0" encoding=\"ISO-8859-1\"?>"+
        "<fo:root xmlns:fo=\"http://www.w3.org/1999/XSL/Format\">"+
        ...
        ...
        ...
        "</fo:root>";
 
    test1(src, "c:\\prova.pdf");
 
every call generate an exception:java.lang.ExceptionInInitializerError
this is the Debugger Stack Trace Report:
 
Thread[main,5,main] (Alive)
Uncaught exception (java.lang.ExceptionInInitializerError)
 
 SVGElementMapping.setupSVG()
 SVGElementMapping.addToBuilder(TreeBuilder)
  this=(org.apache.fop.svg.SVGElementMapping) org.apache.fop.svg.SVGElementMapping@6266
  arg_1=(org.apache.fop.fo.TreeBuilder) org.apache.fop.fo.FOTreeBuilder@6cd4
 Driver.addElementMapping(ElementMapping)
  this=(org.apache.fop.apps.Driver) org.apache.fop.apps.Driver@1936
  arg_1=(org.apache.fop.fo.ElementMapping) org.apache.fop.svg.SVGElementMapping@6266
 Driver.addElementMapping(String)
  this=(org.apache.fop.apps.Driver) org.apache.fop.apps.Driver@1936
  arg_1=(java.lang.String) org.apache.fop.svg.SVGElementMapping
 Driver.setupDefaultMappings()
  this=(org.apache.fop.apps.Driver) org.apache.fop.apps.Driver@1936
 Driver()
  this=(org.apache.fop.apps.Driver) org.apache.fop.apps.Driver@1936
 Driver(InputSource, OutputStream)
  this=(org.apache.fop.apps.Driver) org.apache.fop.apps.Driver@1936
  arg_1=(org.xml.sax.InputSource) org.xml.sax.InputSource@4478
  arg_2=(java.io.OutputStream) java.io.FileOutputStream@4481
 ProvaFOP.test1(String, String)
  this=(xxx.prova.ProvaFOP) xxx.prova.ProvaFOP@261a
  src="(java.lang.String)" c:\prova.fo
  dst=(java.lang.String) c:\prova.pdf
 ProvaFOP.main(String [])
  args=([Ljava.lang.String;) [Ljava.lang.String;@1546
  pFOP=(xxx.prova.ProvaFOP) xxx.prova.ProvaFOP@261a
  fo=(java.lang.String) c:\prova.fo
 
 
 
thanks!!
bye
Massimiliano Cuccia

Reply via email to