Jump to content

JRXmlDataSource.subDataSource ClassCastExcept


2004 IR Help

Recommended Posts

By: sv1 - sv1

JRXmlDataSource.subDataSource ClassCastExcept

2005-11-02 03:27

I'm getting a strange error using JasperReports with JRXmlDataSource. I am calling a subreport with:

((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/VigtarnoturVRow/VigtanirView/VigtanirViewRow")

 

this works fine in my local deployment but when I deploy and run my project with Java Web Start I get the following exception:

 

java.lang.ClassCastException

 

at org.apache.crimson.tree.XmlDocument.importNode(Unknown Source)

 

at net.sf.jasperreports.engine.data.JRXmlDataSource.subDataSource(JRXmlDataSource.java:383)

 

at Vigtarnota.evaluate(Vigtarnota:232)

 

at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:608)

 

at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:536)

 

at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:299)

 

at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:286)

 

at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:353)

 

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1251)

 

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:586)

 

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:226)

 

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:129)

 

at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:953)

 

at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89)

 

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:428)

 

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:409)

 

at is.fiskistofa.ask.beans.aflaskraning.PanelLandanir.printNota(PanelLandanir.java:672)

...

 

NESTED BY :

 

java.lang.ClassCastException

 

at org.apache.crimson.tree.XmlDocument.importNode(Unknown Source)

 

at net.sf.jasperreports.engine.data.JRXmlDataSource.subDataSource(JRXmlDataSource.java:383)

 

at Vigtarnota.evaluate(Vigtarnota:232)

 

at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:608)

...

 

 

 

 

By: sv1 - sv1

RE: JRXmlDataSource.subDataSource ClassCastEx

2005-11-02 03:31

I have been trying to alter my xml libraries in Java Web Start without any luck.

Is there any way to control which XML-implementation jasperreports use ? I would like to be able to use something other than org.apache.crimson as this seems to be where the error comes from.

 

 

 

 

By: sv1 - sv1

RE: JRXmlDataSource.subDataSource ClassCastEx

2005-11-02 09:36

I managed to make it work. It seems that JasperReports has a depency on crimson jaxp xml parser but somewhere in my setup another implementation is the default.

 

After setting the System Property "javax.xml.parsers.DocumentBuilderFactory" to "org.apache.crimson.jaxp.DocumentBuilderFactoryImpl" it worked.

 

System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "org.apache.crimson.jaxp.DocumentBuilderFactoryImpl");

 

 

 

 

 

 

By: Murugapandian Barathee - barathee

datasource for a report with two subreports

2005-11-14 05:47

Hi,

I have two subreports C, D which have their own respective DS. C and D are added to another subreport , say Assembling report B,. B is a simple subreport which addes C and D. B is then added to A which is a portrait/landscape report. where B, C, D are created dynamically.

 

Datasources for C and D has been supplied by B as parameters. How can We prepare the DS for B. Is it possible to fill B without DS.

 

I had given the datasource of C to B (just a try) the table is getting printed, but in a wrong fashion.

 

Thanks a lot.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...