cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barbara Slupik <barbara_slu...@wro.vectranet.pl>
Subject HSSF serializer stand-alone
Date Tue, 09 Nov 2010 08:21:15 GMT
Hello

I am using HSSF serializer as stand-alone in java. It works with  
cocoon-2.0.4.jar:

   void serializeHSSF(Document doc, OutputStream out) throws Exception
   {
     PipedOutputStream outStream=new PipedOutputStream();
     PipedInputStream inStream=new PipedInputStream(outStream);
     HSSFSerializer hssf=new HSSFSerializer();
     hssf.setLogger((new  
org.apache.commons.logging.impl.LogKitLogger("HSSF")).getLogger()); // 
only with cocoon-2.0
     hssf.initialize();
     hssf.setOutputStream(out);
     XMLReader  
reader=SAXParserFactory.newInstance().newSAXParser().getXMLReader();
     reader.setContentHandler(hssf);
     serializeXML(doc,outStream,false);
     reader.parse(new InputSource(inStream));
     out.flush();
     out.close();
     LOG.debug("HSSF serialization completed");
   }

but it fails on reader.parse(new InputSource(inStream));  with  
cocoon-2.1.11.jar and cocoon-poi-2.1.11.jar:

      [java] java.lang.NullPointerException
      [java] 	at  
org 
.apache 
.cocoon 
.components 
.elementprocessor 
.impl.poi.hssf.elements.EPStyleRegion.initialize(EPStyleRegion.java:93)
      [java] 	at  
org 
.apache 
.cocoon 
.serialization 
.ElementProcessorSerializer 
.startElement(ElementProcessorSerializer.java:347)
      [java] 	at  
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
      [java] 	at  
org 
.apache 
.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown  
Source)
      [java] 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl 
$FragmentContentDispatcher.dispatch(Unknown Source)
      [java] 	at  
org 
.apache 
.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      [java] 	at  
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      [java] 	at  
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      [java] 	at org.apache.xerces.parsers.XMLParser.parse(Unknown  
Source)
      [java] 	at  
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      [java] 	at org.apache.xerces.jaxp.SAXParserImpl 
$JAXPSAXParser.parse(Unknown Source)

Does anybody use cocoon-2.1 HSSF serializer as  stand-alone? How do  
you run it?

Barbara
Mime
View raw message