Re: The number of this PDFNumber must not be empty

2007-12-05 Thread altmax

If someone is interested, 

i solve my problem changing version of apache fop from 0.94 to 0.20.5.




altmax wrote:
 
 Hello,
 
 i have a problem with apache fop 0.94.
 
 My os is windows xp , my application server oracle 9ias oc4j1.0.2.2.1,
 jdk1.3.1_09 with jre 1.3.1_09.
 
 Class java is:
 .
 import
 ..
 
 public class Case2PDF {
 
 // configure fopFactory as desired
 private FopFactory fopFactory = FopFactory.newInstance();
  
 public void convertCase2PDF(CaseVO caseVO, File xslt, File pdf)
 throws Exception, IOException, FOPException,
 TransformerException {
 
 // Setup output
 OutputStream out = new java.io.FileOutputStream(pdf);
 out = new java.io.BufferedOutputStream(out);
 
 try {
 //Setup user agent
 FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
 PDFRenderer pdfrenderer = new PDFRenderer();
 pdfrenderer.setUserAgent(foUserAgent);
 foUserAgent.setRendererOverride(pdfrenderer);
 
 fopFactory.addElementMapping(new FOElementMapping());
 fopFactory.addElementMapping(new SVGElementMapping());
 fopFactory.addElementMapping(new
 BatikExtensionElementMapping());
 fopFactory.addElementMapping(new ExtensionElementMapping());
 fopFactory.addElementMapping(new XMPElementMapping());
 fopFactory.addElementMapping(new RDFElementMapping());
 fopFactory.addElementMapping(new PSExtensionElementMapping());
 
 // Construct fop with desired output format
 Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,
 foUserAgent, out);
 
 // Setup XSLT
 TransformerFactory factory = new
 org.apache.xalan.processor.TransformerFactoryImpl();//TransformerFactory.newInstance();
 Transformer transformer = factory.newTransformer(new
 StreamSource(xslt));
 
 CaseForm caseForm = new CaseForm();
 caseForm.map(caseVO);
 
 // Setup input for XSLT transformation
 Source src = new SAXSource(new CaseXMLReader(),new
 CaseInputSource(caseForm));
 
 //System.out.println(input source:
 +((SAXSource)src).getInputSource().getByteStream().available());
 
 // Resulting SAX events (the generated FO) must be piped
 through to FOP
 Result res = new SAXResult(fop.getDefaultHandler());
 
 // Start XSLT transformation and FOP processing
 transformer.transform(src, res);
 }catch(Exception ex){
System.out.println(Case2pdf - exception in export:  +
 ex.getMessage());
ex.printStackTrace();
throw new Exception(ex.getMessage());
 }
 finally {
 out.close();
 }
 
}
 
 }
 
 .
 
 at runtime, I get a error from Apache FOP (The number of this PDFNumber
 must not be empty):
 
 -71066 [HttpRequestHandler-6502834] ERROR org.apache.fop.fo.FOTreeBuilder 
 - java.lang.IllegalArgumentException: The numbe
 -Case2pdf - exception in export: java.lang.IllegalArgumentException: The
 number of this PDFNumber must not be empty
 javax.xml.transform.TransformerException:
 java.lang.IllegalArgumentException: The number of this PDFNumber must not
 be emp
 at
 org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1226)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:638)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
 at com.bms.util.pdf.Case2PDF.convertCase2PDF(Case2PDF.java:93)
 at
 com.bms.presentation.action.assurance.ExportPDFAction.execute(ExportPDFAction.java:84)
 at
 org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
 at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
 at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 at
 org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at
 com.bms.presentation.servlet.BmsActionServlet.service(BmsActionServlet.java:222)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
 com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:721)
 at
 com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
 at
 com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767

The number of this PDFNumber must not be empty

2007-11-14 Thread altmax

Hello,

i have a problem with apache fop 0.94.

My os is windows xp , my application server oracle 9ias oc4j1.0.2.2.1,
jdk1.3.1_09 with jre 1.3.1_09.

Class java is:
.
import
..

public class Case2PDF {

// configure fopFactory as desired
private FopFactory fopFactory = FopFactory.newInstance();
 
public void convertCase2PDF(CaseVO caseVO, File xslt, File pdf)
throws Exception, IOException, FOPException,
TransformerException {

// Setup output
OutputStream out = new java.io.FileOutputStream(pdf);
out = new java.io.BufferedOutputStream(out);

try {
//Setup user agent
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
PDFRenderer pdfrenderer = new PDFRenderer();
pdfrenderer.setUserAgent(foUserAgent);
foUserAgent.setRendererOverride(pdfrenderer);

fopFactory.addElementMapping(new FOElementMapping());
fopFactory.addElementMapping(new SVGElementMapping());
fopFactory.addElementMapping(new
BatikExtensionElementMapping());
fopFactory.addElementMapping(new ExtensionElementMapping());
fopFactory.addElementMapping(new XMPElementMapping());
fopFactory.addElementMapping(new RDFElementMapping());
fopFactory.addElementMapping(new PSExtensionElementMapping());

// Construct fop with desired output format
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent,
out);

// Setup XSLT
TransformerFactory factory = new
org.apache.xalan.processor.TransformerFactoryImpl();//TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new
StreamSource(xslt));

CaseForm caseForm = new CaseForm();
caseForm.map(caseVO);

// Setup input for XSLT transformation
Source src = new SAXSource(new CaseXMLReader(),new
CaseInputSource(caseForm));

//System.out.println(input source:
+((SAXSource)src).getInputSource().getByteStream().available());

// Resulting SAX events (the generated FO) must be piped through
to FOP
Result res = new SAXResult(fop.getDefaultHandler());

// Start XSLT transformation and FOP processing
transformer.transform(src, res);
}catch(Exception ex){
   System.out.println(Case2pdf - exception in export:  +
ex.getMessage());
   ex.printStackTrace();
   throw new Exception(ex.getMessage());
}
finally {
out.close();
}

   }

}

.

at runtime, I get a error from Apache FOP (The number of this PDFNumber must
not be empty):

-71066 [HttpRequestHandler-6502834] ERROR org.apache.fop.fo.FOTreeBuilder  -
java.lang.IllegalArgumentException: The numbe
-Case2pdf - exception in export: java.lang.IllegalArgumentException: The
number of this PDFNumber must not be empty
javax.xml.transform.TransformerException:
java.lang.IllegalArgumentException: The number of this PDFNumber must not be
emp
at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1226)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:638)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
at com.bms.util.pdf.Case2PDF.convertCase2PDF(Case2PDF.java:93)
at
com.bms.presentation.action.assurance.ExportPDFAction.execute(ExportPDFAction.java:84)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at
com.bms.presentation.servlet.BmsActionServlet.service(BmsActionServlet.java:222)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:721)
at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at 

Re: The number of this PDFNumber must not be empty

2007-11-14 Thread altmax

Sure oracle interfering with fop, but can i use it with this application
server??

Where can i find this FO file??


Jeremias Maerki-2 wrote:
 
 Not without the FO file to reproduce the problem, no. You can do some
 more testing yourself by running the same document on the command-line.
 It's probably a good idea to do such a test outside the Oracle server to
 make sure it's not something from Oracle interfering here. The Oracle
 server caused some grief in the past because of bugs in the JAXP
 implementation (XML parser, XSLT processor).
 
 Jeremias Maerki
 
 
 
 On 14.11.2007 10:40:28 altmax wrote:
 
 Hello,
 
 i have a problem with apache fop 0.94.
 
 My os is windows xp , my application server oracle 9ias oc4j1.0.2.2.1,
 jdk1.3.1_09 with jre 1.3.1_09.
 
 Class java is:
 .
 import
 ..
 
 public class Case2PDF {
 
 // configure fopFactory as desired
 private FopFactory fopFactory = FopFactory.newInstance();
  
 public void convertCase2PDF(CaseVO caseVO, File xslt, File pdf)
 throws Exception, IOException, FOPException,
 TransformerException {
 
 // Setup output
 OutputStream out = new java.io.FileOutputStream(pdf);
 out = new java.io.BufferedOutputStream(out);
 
 try {
 //Setup user agent
 FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
 PDFRenderer pdfrenderer = new PDFRenderer();
 pdfrenderer.setUserAgent(foUserAgent);
 foUserAgent.setRendererOverride(pdfrenderer);
 
 fopFactory.addElementMapping(new FOElementMapping());
 fopFactory.addElementMapping(new SVGElementMapping());
 fopFactory.addElementMapping(new
 BatikExtensionElementMapping());
 fopFactory.addElementMapping(new ExtensionElementMapping());
 fopFactory.addElementMapping(new XMPElementMapping());
 fopFactory.addElementMapping(new RDFElementMapping());
 fopFactory.addElementMapping(new
 PSExtensionElementMapping());
 
 // Construct fop with desired output format
 Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,
 foUserAgent,
 out);
 
 // Setup XSLT
 TransformerFactory factory = new
 org.apache.xalan.processor.TransformerFactoryImpl();//TransformerFactory.newInstance();
 Transformer transformer = factory.newTransformer(new
 StreamSource(xslt));
 
 CaseForm caseForm = new CaseForm();
 caseForm.map(caseVO);
 
 // Setup input for XSLT transformation
 Source src = new SAXSource(new CaseXMLReader(),new
 CaseInputSource(caseForm));
 
 //System.out.println(input source:
 +((SAXSource)src).getInputSource().getByteStream().available());
 
 // Resulting SAX events (the generated FO) must be piped
 through
 to FOP
 Result res = new SAXResult(fop.getDefaultHandler());
 
 // Start XSLT transformation and FOP processing
 transformer.transform(src, res);
 }catch(Exception ex){
System.out.println(Case2pdf - exception in export:  +
 ex.getMessage());
ex.printStackTrace();
throw new Exception(ex.getMessage());
 }
 finally {
 out.close();
 }
 
}
 
 }
 
 .
 
 at runtime, I get a error from Apache FOP (The number of this PDFNumber
 must
 not be empty):
 
 -71066 [HttpRequestHandler-6502834] ERROR org.apache.fop.fo.FOTreeBuilder 
 -
 java.lang.IllegalArgumentException: The numbe
 -Case2pdf - exception in export: java.lang.IllegalArgumentException: The
 number of this PDFNumber must not be empty
 javax.xml.transform.TransformerException:
 java.lang.IllegalArgumentException: The number of this PDFNumber must not
 be
 emp
 at
 org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1226)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:638)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
 at com.bms.util.pdf.Case2PDF.convertCase2PDF(Case2PDF.java:93)
 at
 com.bms.presentation.action.assurance.ExportPDFAction.execute(ExportPDFAction.java:84)
 at
 org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
 at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
 at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 at
 org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740

Re: The number of this PDFNumber must not be empty

2007-11-14 Thread altmax

hi,
the FO file is as follows:

?xml version=1.0 encoding=UTF-8?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
fo:layout-master-set
fo:simple-page-master margin-right=2cm margin-left=2cm
margin-bottom=2cm margin-top=2cm page-width=21cm page-height=29.7cm
master-name=simpleA4
fo:region-body/
/fo:simple-page-master
/fo:layout-master-set
fo:page-sequence master-reference=simpleA4
fo:flow flow-name=xsl-region-body
fo:block space-after=5mm font-weight=bold font-size=16ptTipologia:
Comunicazione di disservizio/fo:block
fo:block space-after=5mm font-size=12ptStato: Restituita a Wind per
accettazione/fo:block
fo:block font-size=10pt
numero: 548/2007/fo:block
/fo:flow
/fo:page-sequence
/fo:root



Jeremias Maerki-2 wrote:
 
 Yes, it's possible to use FOP inside Oracle, but if you run into
 certain problems (the one at hand is not normally one of them) you may
 need to replace the XML support bundled with Oracle with Apache
 Xerces/Xalan in order to avoid possible bugs in Oracle code. Please see
 the mailing list archives for further information. My reaction is simply
 triggered by your stating that you're running inside Oracle. But it
 would really help to know if the same problem appears outside Oracle,
 just to know on which side we have to look. Basic error finding strategy.
 
 The FO (XSL-FO) file in your case is just virtual (actually a SAX
 event stream). You get it by converting the XML file using the XSLT
 stylesheet you have. You can also do:
 
 fop -xml myfile.xml -xsl mystylesheet.xsl -pdf out.pdf
 
 ...on the command-line. But you know about that, don't you?
 
 To get the FO file:
 fop -xml myfile.xml -xsl mystylesheet.xsl -foout out.fo
 (and you'd post the out.fo file here)
 
 Jeremias Maerki
 
 
 

-- 
View this message in context: 
http://www.nabble.com/The-number-of-this-PDFNumber-must-not-be-empty-tf4803765.html#a13746939
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: The number of this PDFNumber must not be empty

2007-11-14 Thread altmax

Already I read the previous mail, but i didn't solve my problem :(

So I do not hope to use Apache FOP with Oracle 9ias


Jeremias Maerki-2 wrote:
 
 Bull I just remembered that we've had this before:
 
 http://fop-users.markmail.org/search/?q=PDFNumber+not+empty
 
 Back then it was suggested that it could be a multi-threading problem
 but looking at what the exception raises tells me it has nothing to do
 with the (still unsolved) issue with DecimalFormat. That code is just
 hanging around there. But then, without being able to reproduce the
 problem here, I don't really know what to do. Maybe someone else has an
 idea.
 
 Jeremias Maerki
 
 
 
 On 14.11.2007 10:40:28 altmax wrote:
 
 Hello,
 
 i have a problem with apache fop 0.94.
 
 My os is windows xp , my application server oracle 9ias oc4j1.0.2.2.1,
 jdk1.3.1_09 with jre 1.3.1_09.
 
 Class java is:
 .
 import
 ..
 
 public class Case2PDF {
 
 // configure fopFactory as desired
 private FopFactory fopFactory = FopFactory.newInstance();
  
 public void convertCase2PDF(CaseVO caseVO, File xslt, File pdf)
 throws Exception, IOException, FOPException,
 TransformerException {
 
 // Setup output
 OutputStream out = new java.io.FileOutputStream(pdf);
 out = new java.io.BufferedOutputStream(out);
 
 try {
 //Setup user agent
 FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
 PDFRenderer pdfrenderer = new PDFRenderer();
 pdfrenderer.setUserAgent(foUserAgent);
 foUserAgent.setRendererOverride(pdfrenderer);
 
 fopFactory.addElementMapping(new FOElementMapping());
 fopFactory.addElementMapping(new SVGElementMapping());
 fopFactory.addElementMapping(new
 BatikExtensionElementMapping());
 fopFactory.addElementMapping(new ExtensionElementMapping());
 fopFactory.addElementMapping(new XMPElementMapping());
 fopFactory.addElementMapping(new RDFElementMapping());
 fopFactory.addElementMapping(new
 PSExtensionElementMapping());
 
 // Construct fop with desired output format
 Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,
 foUserAgent,
 out);
 
 // Setup XSLT
 TransformerFactory factory = new
 org.apache.xalan.processor.TransformerFactoryImpl();//TransformerFactory.newInstance();
 Transformer transformer = factory.newTransformer(new
 StreamSource(xslt));
 
 CaseForm caseForm = new CaseForm();
 caseForm.map(caseVO);
 
 // Setup input for XSLT transformation
 Source src = new SAXSource(new CaseXMLReader(),new
 CaseInputSource(caseForm));
 
 //System.out.println(input source:
 +((SAXSource)src).getInputSource().getByteStream().available());
 
 // Resulting SAX events (the generated FO) must be piped
 through
 to FOP
 Result res = new SAXResult(fop.getDefaultHandler());
 
 // Start XSLT transformation and FOP processing
 transformer.transform(src, res);
 }catch(Exception ex){
System.out.println(Case2pdf - exception in export:  +
 ex.getMessage());
ex.printStackTrace();
throw new Exception(ex.getMessage());
 }
 finally {
 out.close();
 }
 
}
 
 }
 
 .
 
 at runtime, I get a error from Apache FOP (The number of this PDFNumber
 must
 not be empty):
 
 -71066 [HttpRequestHandler-6502834] ERROR org.apache.fop.fo.FOTreeBuilder 
 -
 java.lang.IllegalArgumentException: The numbe
 -Case2pdf - exception in export: java.lang.IllegalArgumentException: The
 number of this PDFNumber must not be empty
 javax.xml.transform.TransformerException:
 java.lang.IllegalArgumentException: The number of this PDFNumber must not
 be
 emp
 at
 org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1226)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:638)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
 at
 org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
 at com.bms.util.pdf.Case2PDF.convertCase2PDF(Case2PDF.java:93)
 at
 com.bms.presentation.action.assurance.ExportPDFAction.execute(ExportPDFAction.java:84)
 at
 org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
 at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
 at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 at
 org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507