can't preview document (xml source). Error filling print


I use xml datasource. I ve made several fields, put in them data from xml - data-source (with XPath metchod).

Then I compile document, everything is right. And then iReport has announced error like this:

Error filling print... XPath compilation failed. Expression: 
Setting up the file resolver... 
net.sf.jasperreports.engine.JRException: XPath compilation failed. Expression:  
    at net.sf.jasperreports.engine.util.xml.JaxenXPathExecuter.getXPath( 
    at net.sf.jasperreports.engine.util.xml.JaxenXPathExecuter.selectNodeList( 
    at net.sf.jasperreports.engine.query.JRXPathQueryExecuter.createDatasource( 
    at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource( 
    at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource( 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters( 
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill( 
    at net.sf.jasperreports.engine.fill.JRFiller.fill( 
    at net.sf.jasperreports.engine.JasperFillManager.fill( 
    at net.sf.jasperreports.engine.JasperFillManager.fill( 
    at net.sf.jasperreports.engine.JasperFillManager.fillReport( 
    at org.openide.util.RequestProcessor$ 
    at org.openide.util.RequestProcessor$ 
Caused by: org.jaxen.XPathSyntaxException: Unexpected '' 
    at org.jaxen.BaseXPath.<init>( 
    at org.jaxen.BaseXPath.<init>( 
    at org.jaxen.dom.DOMXPath.<init>( 
    at net.sf.jasperreports.engine.util.xml.JaxenXPathExecuter.getXPath( 
    ... 15 more 
Caused by: class org.jaxen.saxpath.XPathSyntaxException: : 0: Unexpected '' 
    at org.jaxen.saxpath.base.XPathReader.createSyntaxException( 
    at org.jaxen.saxpath.base.XPathReader.pathExpr( 
    at org.jaxen.saxpath.base.XPathReader.unionExpr( 
    at org.jaxen.saxpath.base.XPathReader.unaryExpr( 
    at org.jaxen.saxpath.base.XPathReader.multiplicativeExpr( 
    at org.jaxen.saxpath.base.XPathReader.additiveExpr( 
    at org.jaxen.saxpath.base.XPathReader.relationalExpr( 
    at org.jaxen.saxpath.base.XPathReader.equalityExpr( 
    at org.jaxen.saxpath.base.XPathReader.andExpr( 
    at org.jaxen.saxpath.base.XPathReader.orExpr( 
    at org.jaxen.saxpath.base.XPathReader.expr( 
    at org.jaxen.saxpath.base.XPathReader.parse( 
    at org.jaxen.BaseXPath.<init>( 
    ... 18 more 
Print not filled. Try to use an EmptyDataSource...]

I ve change files in dicrectoru ireport/libs like Xalan and others, how it advised in forums, but nothing has helped me. 

I have tryed to use diffirent versions of programm, but in vain. Maybe IReport can't work with xml datasource at all?

Can you help me?


victorsambist's picture
Joined: Jun 4 2013 - 2:38pm
Last seen: 5 years 8 months ago

2 Answers:


The exceptions tell us that there is a syntax error in one or more of your XPath expressions. XPath expressions are compiled runtime, not when you compile the report.

nicolaifriis's picture
Joined: May 25 2010 - 4:32am
Last seen: 4 years 5 months ago

Hello nocolaifriis, i ve sent file, where you can see stages of my making of report

victorsambist - 6 years 3 months ago
can you provide JRXML File ?
netti royala's picture
Joined: Oct 28 2013 - 11:43pm
Last seen: 5 years 2 months ago

Hellow netti royala, I ve sent JRXML file.

victorsambist - 6 years 3 months ago