NoSuchMethodException: Unknown property ' '

2

 

Hi all,

I'm totally new with jasperReports and i'm trying to a first easy report, but i get this error and i really don't know why.


My errors:
List size: 34
org.zkoss.zk.ui.UiException: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean :
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 at org.zkoss.lang.Classes.newInstance(Classes.java:78)
 at org.zkoss.lang.Exceptions.wrap(Exceptions.java:164)
 at org.zkoss.zk.ui.UiException$Aide.wrap(UiException.java:46)
 at org.zkoss.zkex.zul.Jasperreport.doReport(Jasperreport.java:513)
 at org.zkoss.zkex.zul.Jasperreport.access$100(Jasperreport.java:76)
 at org.zkoss.zkex.zul.Jasperreport$ExtraCtrl.getMedia(Jasperreport.java:310)
 at org.zkoss.zk.au.http.AuDynaMediar.process(AuDynaMediar.java:112)
 at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:362)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Thread.java:619)
Caused by: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean :
 at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:127)
 at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getFieldValue(JRAbstractBeanDataSource.java:100)
 at net.sf.jasperreports.engine.data.JRBeanCollectionDataSource.getFieldValue(JRBeanCollectionDataSource.java:104)
 at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:787)
 at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:751)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1422)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:111)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:879)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:801)
 at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89)
 at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601)
 at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:582)
 at org.zkoss.zkex.zul.Jasperreport.doReport(Jasperreport.java:361)
 ... 20 more
Caused by: java.lang.NoSuchMethodException: Unknown property '' on class 'class bonDeTravails.BonDeTravailDTO'
 at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1313)
 at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:762)
 at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:837)
 at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:426)
 at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:115)
 ... 32 more
2009-04-06 16:18:13 org.zkoss.zk.au.http.AuDynaMediar process:130
GRAVE: Failed to load media, /view/g8dm1/z_8d_l/0/rpt/test_miniRapport.pdf
>>org.zkoss.zk.ui.UiException: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean :
>>net.sf.jasperreports.engine.JRException: Error retrieving field value from bean :
>>java.lang.NoSuchMethodException: Unknown property '' on class 'class bonDeTravails.BonDeTravailDTO'
>> at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1313)
>> at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:762)
>> at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:837)
>> at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:426)
>> at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:115)
>> at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getFieldValue(JRAbstractBeanDataSource.java:100)
>>...[/code]

 --------------------------------------------------------------------------------------------------------------------------

test_miniRapport.jrxml (only field the fields declaration part)
 <field name="noBon" class="java.lang.String">
  <fieldDescription><![CDATA[]]></fieldDescription>
 </field>
 <field name="statut" class="java.lang.String">
  <fieldDescription><![CDATA[]]></fieldDescription>
 </field>
 <field name="type" class="java.lang.String">
  <fieldDescription><![CDATA[]]></fieldDescription>
 </field>
 <field name="priorite" class="java.lang.String">
  <fieldDescription><![CDATA[]]></fieldDescription>
 </field>
 

 --------------------------------------------------------------------------------------------------------------------------

My Pojo:
package bonDeTravails;

public class BonDeTravailDTO {
 
 private String noBon;
 private String statut;
 private String priorite;
 private String type;  
 
 
 public BonDeTravailDTO() {
  
 }

 public String getNoBon() {
  return noBon;
 }

 public void setNoBon(String noBon) {
  this.noBon = noBon;
 }

 public String getStatut() {
  return statut;
 }

 public void setStatut(String statut) {
  this.statut = statut;
 }

 public String getPriorite() {
  return priorite;
 }

 public void setPriorite(String priorite) {
  this.priorite = priorite;
 }

 public String getType() {
  return type;
 }

 public void setType(String type) {
  this.type = type;
 } 
}
 

bob007's picture
28
Joined: Apr 5 2009 - 6:26pm
Last seen: 10 years 1 month ago

8 Answers:

15

You should either

  • Remove the empty field descriptions from the JRXML.
  • Set the field descriptions to match the bean property names.
  • Pass false as isUseFieldDescription when creating the bean data source, e.g. new JRBeanCollectionDataSource(data, false).

HTH,

Lucian

lucianc's picture
7055
Joined: Jul 17 2006 - 1:10am
Last seen: 5 hours 38 min ago

How the hell would you know that a empty field description would be causing this problem? Is this a bug?

geison.machado - 4 years 2 months ago

It really works for me.
Even without following step: Set the field descriptions to match the property names bean.

leonamleite - 4 years 1 month ago

Thanks a lot Lucian!
You saved my day.
Best regards.

ntsetso - 3 years 8 months ago
show 3 more...

Thanks,

You save my life!!!

lcs.d.rocha - 3 years 6 months ago

Thank you
worked for me just removing 1 filed description

ciro_1 - 2 years 9 months ago

The problem was the description was empty. Now it is working fabulous. Thank You!

pawel_6 - 2 years 8 months ago
0

Thanks a lot !!!!

I did like you said  and its working very well now !

Phil

bob007's picture
28
Joined: Apr 5 2009 - 6:26pm
Last seen: 10 years 1 month ago
0
I\'m new with JasperReports and after read this solution finally I get to do my report. Thank you very much too, regards.
davidrogerman's picture
Joined: Jun 22 2009 - 6:38am
Last seen: 9 years 11 months ago
0

It works for us too. Thanks!!



Post Edited by substic at 09/09/2009 07:17
substic's picture
Joined: Sep 1 2009 - 7:32am
Last seen: 9 years 8 months ago
0

It didnot work for me

pandabodoh's picture
Joined: Jul 14 2011 - 6:19am
Last seen: 7 years 10 months ago
0

Hi all,

I'm totally new with jasperReports and i'm trying to a first easy report, but i get this error and i really don't know why. Can any one please help me i strucked up here from 3 days.Its urgent to me.

MyErrors:

java.lang.NoSuchMethodException: Unknown property 'activePackage'
    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)
    at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getFieldValue(JRAbstractBeanDataSource.java:96)
    at net.sf.jasperreports.engine.data.JRBeanCollectionDataSource.getFieldValue(JRBeanCollectionDataSource.java:100)
    at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:895)
    at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:860)
    at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:837)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1434)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:126)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:836)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:765)
    at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:84)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624)
    at org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView.fillReport(AbstractJasperReportsView.java:669)
    at org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView.renderMergedOutputModel(AbstractJasperReportsView.java:559)
    at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

 

 

Code:
Here is my Jrxml code:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports <a target="_blank" href="http://jasperreports.sourceforge.net/xsd/jasperreport.xsd""><a href="http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"" target="_blank">http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"</a></a> name="AP" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<field name="activePackage" class="java.lang.String"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="79" splitType="Stretch"/>
	</title>
	<pageHeader>
		<band height="35" splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band height="23" splitType="Stretch">
			<staticText>
				<reportElement x="0" y="0" width="100" height="20"/>
				<textElement/>
				<text><![CDATA[activePackage]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="23" splitType="Stretch">
			<textField>
				<reportElement x="0" y="3" width="100" height="20"/>
				<textElement/>
				<textFieldExpression><![CDATA[$F{activePackage}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band height="45" splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="54" splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band height="42" splitType="Stretch"/>
	</summary>
</jasperReport>
 
---------------------------------------------------------
 
Here is my Entity Class;
 
@Entity
@JsonAutoDetect
@Table(name = "ra_bdr_rating")
public class RaBdrRating extends BaseModel {
@Column(name="active_package")
private String activePackage;
public String getActivePackage() {
return activePackage;
}
public void setActivePackage(String activePackage) {
this.activePackage = activePackage;
}


Post Edited by saru_1 at 04/21/2012 12:38
saru_1's picture
9
Joined: Apr 21 2012 - 5:22am
Last seen: 7 years 1 month ago
1

Hi,

I am also getting the same exception.Can you please tell me how to resolve that issue.

Request processing failed; nested exception is net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : activePackage] with root cause
java.lang.NoSuchMethodException: Unknown property 'activePackage'

The below attachment is my jrxml file.

swarupap's picture
Joined: Feb 17 2012 - 4:50am
Last seen: 5 years 11 months ago
0

That fixed it, Thanks!

billn's picture
10
Joined: Feb 24 2017 - 4:58am
Last seen: 1 year 4 months ago
Feedback