Java net.sf.jasperreports.engine.JRException:从bean检索字段值时出错:

Java net.sf.jasperreports.engine.JRException:从bean检索字段值时出错:,java,spring,jasper-reports,Java,Spring,Jasper Reports,**嗨!承诺;你可以帮助我 我要打印pdf或html!但我有个问题 这是我的实体操作** @实体 @Data @NoArgsConstructor @AllArgsConstructor public class Operation implements Serializable{ @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long numeroOperation;

**嗨!承诺;你可以帮助我 我要打印pdf或html!但我有个问题

  • 这是我的实体操作**
  • @实体

    @Data @NoArgsConstructor @AllArgsConstructor
    public class Operation implements Serializable{
        @Id
            @GeneratedValue(strategy=GenerationType.IDENTITY)
            private Long numeroOperation;
            private LocalDate dateOperation;
            private double montant;
            private String designation;
            private String dtypeOp;
         @ManyToOne
                  @JoinColumn(name="codeCaisse")
                  private Caisse caisse;
             @ManyToOne
                 @JoinColumn(name="username")   
                 private Utilisateur  user;
                 @ManyToOne
                 @JoinColumn(name="iddepot")   
                 private Depositeur  depositeur;
            }
    
    2。这是我的扩展实体版本

     @Entity
        public class Versement extends Operation{
            public Versement() {
                super();
                // TODO Auto-generated constructor stub
            }
            public Versement(Long numeroOperation, LocalDate dateOperation, double montant, String designation, String dtypeOp,
                    Caisse caisse, Utilisateur user, Depositeur depositeur) {
                super(numeroOperation, dateOperation, montant, designation, dtypeOp, caisse, user, depositeur);
                // TODO Auto-generated constructor stub
            }
    
    以百里香作为遗产展示

    映射后,我得到这个数据库 当我通过thymeleaf显示数据库中的数据时,它很好

    我的报告有问题 这是我的服务打印

    <?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 http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="OperList" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="2a20e923-268e-4547-9972-7dafed8a037a">
        <property name="ireport.zoom" value="1.0"/>
        <property name="ireport.x" value="0"/>
        <property name="ireport.y" value="0"/>
        <queryString>
            <![CDATA[]]>
        </queryString>
        <field name="class.simpleName" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="numero_operation" class="java.lang.Long">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="date_operation" class="java.sql.Timestamp">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="designation" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="montant" class="java.lang.Double">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="code_caisse" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="iddepot" class="java.lang.Long">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="username" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="dtype_op" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <background>
            <band splitType="Stretch"/>
        </background>
        <title>
            <band height="79" splitType="Stretch"/>
        </title>
        <pageHeader>
            <band height="35" splitType="Stretch"/>
        </pageHeader>
        <columnHeader>
            <band height="20" splitType="Stretch">
                <staticText>
                    <reportElement x="104" y="0" width="100" height="20" uuid="dc1534db-9f64-4b9c-8a2f-e89eca2821f0"/>
                    <textElement textAlignment="Center">
                        <font size="12" isBold="true"/>
                    </textElement>
                    <text><![CDATA[dtype_op]]></text>
                </staticText>
                <staticText>
                    <reportElement x="242" y="0" width="100" height="20" uuid="97f4876b-5408-4766-b9c5-29ad16a3367b"/>
                    <textElement textAlignment="Center">
                        <font size="12" isBold="true"/>
                    </textElement>
                    <text><![CDATA[date_operation]]></text>
                </staticText>
                <staticText>
                    <reportElement x="342" y="0" width="100" height="20" uuid="176e74bb-aed0-427a-888e-f5c5e39ec7e7"/>
                    <textElement textAlignment="Center">
                        <font size="12" isBold="true"/>
                    </textElement>
                    <text><![CDATA[designation]]></text>
                </staticText>
                <staticText>
                    <reportElement x="204" y="0" width="38" height="20" uuid="5f3d16f5-9586-4ebd-a391-70c92d5fea7e"/>
                    <textElement textAlignment="Center">
                        <font size="12" isBold="true"/>
                    </textElement>
                    <text><![CDATA[numero_operation]]></text>
                </staticText>
                <staticText>
                    <reportElement x="531" y="0" width="100" height="20" uuid="6632761e-617d-4044-91aa-3c3bd9d2640c"/>
                    <textElement textAlignment="Center">
                        <font size="12" isBold="true"/>
                    </textElement>
                    <text><![CDATA[montant]]></text>
                </staticText>
                <staticText>
                    <reportElement x="442" y="0" width="100" height="20" uuid="1f148ebe-aa27-4f65-9b05-24df51ba20e2"/>
                    <textElement textAlignment="Center">
                        <font size="12" isBold="true"/>
                    </textElement>
                    <text><![CDATA[code_caisse]]></text>
                </staticText>
            </band>
        </columnHeader>
        <detail>
            <band height="21" splitType="Stretch">
                <textField>
                    <reportElement x="104" y="0" width="100" height="20" uuid="40fe391f-2387-4041-ac3e-e6ad32be26fa"/>
                    <box>
                        <topPen lineWidth="1.0"/>
                    </box>
                    <textElement textAlignment="Center"/>
                    <textFieldExpression><![CDATA[$F{class.simpleName}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="242" y="0" width="100" height="20" uuid="869a7411-4bb9-4bc9-9e64-b2908c6c846d"/>
                    <textElement textAlignment="Center"/>
                    <textFieldExpression><![CDATA[$F{date_operation}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="342" y="0" width="100" height="20" uuid="c4ebf4a2-1397-4393-86b7-7ed6a1a36fb6"/>
                    <textElement textAlignment="Center"/>
                    <textFieldExpression><![CDATA[$F{designation}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="204" y="0" width="38" height="20" uuid="0a23a2ea-87eb-418c-b5ee-ad49f19f4479"/>
                    <textElement textAlignment="Center"/>
                    <textFieldExpression><![CDATA[$F{numero_operation}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="531" y="0" width="100" height="20" uuid="674b8212-e375-4f8e-b880-a05cd9c35570"/>
                    <textElement textAlignment="Center"/>
                    <textFieldExpression><![CDATA[$F{montant}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="442" y="0" width="89" height="20" uuid="c3a362a9-14c6-46d5-8b0e-b8e21f889c55"/>
                    <textElement textAlignment="Center"/>
                    <textFieldExpression><![CDATA[$F{code_caisse}]]></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>
    
    This application has no explicit mapping for /error, so you are seeing this as a fallback.
    
    Thu Sep 10 09:35:09 CEST 2020
    There was an unexpected error (type=Internal Server Error, status=500).
    Error retrieving field value from bean: .
    net.sf.jasperreports.engine.JRException: Error retrieving field value from bean: .
        at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:205)
        at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getFieldValue(JRAbstractBeanDataSource.java:170)
        at net.sf.jasperreports.engine.data.JRBeanCollectionDataSource.getFieldValue(JRBeanCollectionDataSource.java:104)
        at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:1501)
        at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1402)
        at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1378)
        at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1194)
        at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:108)
        at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:615)
        at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:433)
        at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:162)
        at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:145)
        at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:758)
        at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:1074)
        at com.king.report.ReportService.exportReportOperation(ReportService.java:143)
        at com.king.report.ReportClass.exportReportOperation(ReportClass.java:49)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)