Reply
Occasional Contributor

Error loading object from URL : subreport:testsubreport

Running using 4.0.1, but also tried on 4.0.0 and the nightly build:

The Exception:

Mon Nov 14 09:07:53 EST 2011:ERROR:net.sf.jasperreports.engine.JRException: Error loading object from URL : subreport:testsubreport
net.sf.jasperreports.engine.JRException: Error loading object from URL : subreport:testsubreport
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:154)
at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:247)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateReport(JRFillSubreport.java:301)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:327)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:263)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:258)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:499)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2036)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:760)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:270)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:946)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:864)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:84)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624)
at com.eviware.soapui.reporting.engine.jasper.GenerateJasperReport.createReport(SourceFile:467)
at com.eviware.soapui.reporting.engine.jasper.GenerateJasperReport$ReportFillWorker.construct(SourceFile:428)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.<init>(Unknown Source)
at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.<init>(ContextClassLoaderObjectInputStream.java:53)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:149)
... 19 more

ok, so I set up a subreport with the following xml, it pulls from a data sink, called DataSink, but which is called DataSinksSubReport within the clone interface:

<jasperReport xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xs ... report.xsd" name="report name" language="groovy" pageWidth="535" pageHeight="842" columnWidth="535" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<template>"../../styles.jrtx"</template>
<field name="inpval" class="java.lang.String"/>
<columnHeader>
<band height="59">
<staticText>
<reportElement style="ColumnHeader" x="0" y="35" width="122" height="20"/>
<textElement textAlignment="Left" verticalAlignment="Middle"/>
<text>runtime</text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="21">
<textField>
<reportElement x="0" y="1" width="50" height="20"/>
<textElement textAlignment="Left" verticalAlignment="Top"/>
<textFieldExpression class="java.lang.String">$F{runtime}</textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
the scope for this is Project, the report type loadtest, and the data source DataSinksSubReport.



the report seems to error out when loading it; here's the xml for loading it in the report:
<subreport isUsingCache="false" runToBottom="false">
<reportElement positionType="Float" isPrintRepeatedValues="false" x="0" y="424" width="500" height="30"/>
<subreportParameter name="FlowLayout">
<subreportParameterExpression>$P{FlowLayout}</subreportParameterExpression>
</subreportParameter>
<subreportParameter name="ErrorDetails">
<subreportParameterExpression>$P{ErrorDetails}</subreportParameterExpression>
</subreportParameter>
<dataSourceExpression>$P{DataSinksSubReport}</dataSourceExpression>
<subreportExpression class="java.lang.String">"subreport:testsubreport"</subreportExpression>
</subreport>
Occasional Contributor

Re: Error loading object from URL : subreport:testsubreport

also, I should note, I get a 08021 error from the test when trying to use the nightly build to test for some reason; I'm using the same url, but it won't work. that shouldn't actually affect the report any though, as I get the exact same error for report generation on both 4.0.1, which works, and the nightly build.
Occasional Contributor

Re: Error loading object from URL : subreport:testsubreport

I figured out what was causing the 08021, I still had a few components from an old install left over; then I figured out that i'd cloned the subreport off of one for testcases, not loadtests; no longer getting the interpretation error, but now the DataSink says result status is failed, and i'm getting errors from fetching the empty fields in the empty dataSink:

Tue Nov 15 10:06:49 EST 2011:ERROR:An error occured [net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : runtime], see error log for details

Tue Nov 15 10:06:49 EST 2011:ERROR:net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : runtime
net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : runtime
at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:711)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:329)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:419)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:378)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2038)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:760)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:270)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:946)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:864)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:84)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624)
at com.eviware.soapui.reporting.engine.jasper.GenerateJasperReport.createReport(SourceFile:467)
at com.eviware.soapui.reporting.engine.jasper.GenerateJasperReport$ReportFillWorker.construct(SourceFile:428)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
at java.lang.Thread.run(Unknown Source)
Caused by: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : runtime
at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:123)
at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getFieldValue(JRAbstractBeanDataSource.java:96)
at com.eviware.soapui.reporting.reports.support.ExportableJRBeanCollectionDataSource.getFieldValue(SourceFile:126)
at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:821)
at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:785)
at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1482)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:126)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:946)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:864)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:613)
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)
at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:205)
... 1 more
Caused by: java.lang.NoSuchMethodException: Unknown property 'runtime'
at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1122)
at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)
at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)
at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:111)
... 12 more

Re: Error loading object from URL : subreport:testsubreport

Hi!

sorry for not helping out earlier - this "runtime" field you are referring to - from where should it be getting its value?

regards!

/Ole
SmartBear Software
Occasional Contributor

Re: Error loading object from URL : subreport:testsubreport

right, so runtime is a property in a datasink that empties to a subreport. I'm casting runtime as a string:
${=(String)testRunner.results[testRunner.results.size()-1].timeTaken}

these are the other values that will eventually be in the report
${=(String)(((long)(System.currentTimeMillis()-${runtime})%86400000)/86400000)*24}
${=(String)(((long)System.currentTimeMillis()%86400000)/86400000)*24}
${=(String)${DataSource#chi}}


when used in a single run, the dataSink step shows the correct results.

the subreport code is above, along with the code in the report referencing the subreport, I think.

btw, the dataSink is shared across the load test, and for some reason the test step is called DataSink, but is referenced as DataSinksSubReport

also, i've switched over to the nightly build from a few days ago as my primary build.

Re: Error loading object from URL : subreport:testsubreport

Hi,

hm.. it might be related to this running under a LoadTest - does it work when just running the TestCase? If not, do you get the same error?

regards,

/Ole
SmartBear Software
Occasional Contributor

Re: Error loading object from URL : subreport:testsubreport

Sorry it took so long to get back, but here's what happens:

with the following testcase report code:
<jasperReport xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xs ... report.xsd" name="ReportTemplate" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<property name="ireport.encoding" value="UTF-8"/>
<template>"../../styles.jrtx"</template>
<!--FIELDS & PARAMS-->
<title>
<band height="70">
<textField>
<reportElement x="159" y="13" width="229" height="42"/>
<textElement>
<font size="26"/>
</textElement>
<textFieldExpression class="java.lang.String">$F{name} + " Report"</textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band/>
</pageHeader>
<detail>
<band height="122">
<staticText>
<reportElement style="MainHeader" x="0" y="0" width="535" height="35"/>
<textElement/>
<text>DataSink report</text>
</staticText>
<!--SUBREPORTS UNDER HERE-->
<subreport isUsingCache="true">
<reportElement positionType="Float" isPrintRepeatedValues="false" x="0" y="0" width="500" height="30"/>
<dataSourceExpression>$P{DataSinksSubReport}</dataSourceExpression>
<subreportExpression>"subreport:testCaseSubRep"</subreportExpression>
</subreport>
</band>
</detail>
</jasperReport>

using the following subreport code:

<jasperReport xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xs ... report.xsd" name="report name" language="groovy" pageWidth="535" pageHeight="842" columnWidth="535" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<template>"../../styles.jrtx"</template>
<field name="runtime" class="java.lang.String"/>
<columnHeader>
<band height="59">
<staticText>
<reportElement style="ColumnHeader" x="0" y="35" width="122" height="20"/>
<textElement textAlignment="Left" verticalAlignment="Middle"/>
<text>runtime</text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="21">
<textField>
<reportElement x="0" y="1" width="122" height="20"/>
<textElement textAlignment="Left" verticalAlignment="Top"/>
<textFieldExpression class="java.lang.String">$F{runtime}</textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>

it's empty, even though viewing the data sink itself shows it contains data

by empty I mean the report compiles fine, but shows nothing; presumably, since this one is empty, the load test contains an array of them, leading to some sort of null pointer from not checking if the list of reports for each test case are empty; so why is it empty when the datasink contains values?
Occasional Contributor

Re: Error loading object from URL : subreport:testsubreport

so based upon the way it looks right now (with an empty report in the case of a single run) clearly the problem has something to do with the DataSink, which brings up something that has been bothering me; everything seems to reference DataSinksSubReport even though the test step is called DataSink; is that expected behavior?

edit: by everything, I mean when I go in to construct the subreport, the dropdown shows DataSinksSubReport, but no DataSink
Occasional Contributor

Re: Error loading object from URL : subreport:testsubreport

Hey Ole, just wondering if you had any ideas as to what's going on? I mean clearly the reports are not pulling from the data sink, but the data sink itself shows the correct values within it, when run as part of a test case. By the way, the report code is generated directly from the wizards at this point, the only change I make is adding in groovy as the language to the report, hopefully that makes troubleshooting slightly easier
Occasional Contributor

Re: Error loading object from URL : subreport:testsubreport

Hey, just wondering if this is a known issue and no one's responded because I did something stupid in setting it up? I went back through the tutorial a few times, and this structure seems to work for other information, but the code in the guide for importing from a dataSink doesn't seem to work right. Also, since the issue is slightly different (it's not a load test report throwing a bad null pointer, it's a subreport that's empty now) is the ettiquette that I split the post or something?