运行报告时发出警告:找到命名空间的两个组件

时间:2013-07-16 07:24:52

标签: java jasper-reports

我使用 JasperReports 报告时遇到问题。我对我的程序运行报告,它可以工作,但是有像这样的错误消息

net.sf.jasperreports.engine.component.ComponentsEnvironment findComponentBundles

WARNING: Found two components for namespace http://jasperreports.sourceforge.net/jasperreports/components

当我搜索任何与我相同的推荐时,没有一个是解决方案。你知道怎么解决这个问题吗?

这个'jrxml文件

<?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="imp1_bln" 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"/>
    <parameter name="thn_proses" class="java.lang.String"/>
    <parameter name="bln_proses" class="java.lang.Integer"/>
    <queryString>
        <![CDATA[SELECT DISTINCT
     m_negara."id_negara" AS ID_Negara,
     m_negara."nama_negara" AS Nama_Negara,
     import_det."netto_hs" AS Curr_Net,
     SUM(import_det.netto_hs)AS Cumm_Net,
     import_det."cif_hs_us" AS Curr_CIF,
     SUM(import_det.cif_hs_us)AS Cumm_CIF,
     batch_hdr."bln_proses" AS batch_hdr_bln_proses,
     batch_hdr."thn_proses" AS batch_hdr_thn_proses
FROM
     m_hs10digit, m_negara, import_det, batch_hdr, import

 WHERE

    "dbo".import.negara_pemasok=dbo.m_negara.id_negara AND dbo.import_det.sk_import=dbo.import.sk_import
    AND dbo.import.sk_batch=dbo.batch_hdr.sk_batch
    AND dbo.batch_hdr.bln_proses between 01 and $P{bln_proses}

GROUP BY
    m_negara."id_negara",
    m_negara."nama_negara",
    import_det."netto_hs",
    import_det."cif_hs_us",
    batch_hdr."bln_proses",
    batch_hdr."thn_proses"]]>
    </queryString>
    <field name="ID_Negara" class="java.lang.String"/>
    <field name="Nama_Negara" class="java.lang.String"/>
    <field name="Curr_Net" class="java.lang.Double"/>
    <field name="Cumm_Net" class="java.lang.Double"/>
    <field name="Curr_CIF" class="java.lang.Double"/>
    <field name="Cumm_CIF" class="java.lang.Double"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="93" splitType="Stretch">
            <image>
                <reportElement x="1" y="2" width="146" height="91"/>
                <imageExpression class="java.lang.String"><![CDATA["coffee.jpg"]]></imageExpression>
            </image>
            <staticText>
                <reportElement x="146" y="58" width="410" height="35"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font fontName="Times New Roman" size="12" isItalic="false" pdfFontName="Times-Roman"/>
                </textElement>
                <text><![CDATA[Tabel Impor Menurut Negara Asal (Import By Country of Origin)]]></text>
            </staticText>
        </band>
    </title>
    <pageHeader>
        <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band height="79" splitType="Stretch">
            <staticText>
                <reportElement x="0" y="0" width="41" height="19"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font fontName="Times New Roman" size="12" pdfFontName="Times-Roman"/>
                </textElement>
                <text><![CDATA[Bulan :]]></text>
            </staticText>
            <staticText>
                <reportElement x="64" y="0" width="39" height="19"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font fontName="Times New Roman" size="12" pdfFontName="Times-Roman"/>
                </textElement>
                <text><![CDATA[Tahun:]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="40" width="56" height="39"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Kode Negara]]></text>
            </staticText>
            <staticText>
                <reportElement x="146" y="59" width="90" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Bulan Ini]]></text>
            </staticText>
            <staticText>
                <reportElement x="235" y="59" width="129" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Kumulatif]]></text>
            </staticText>
            <staticText>
                <reportElement x="55" y="40" width="92" height="39"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Negara Asal]]></text>
            </staticText>
            <staticText>
                <reportElement x="363" y="59" width="50" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Bulan Ini]]></text>
            </staticText>
            <staticText>
                <reportElement x="412" y="59" width="144" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Kumulatif]]></text>
            </staticText>
            <staticText>
                <reportElement x="146" y="40" width="218" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[Berat Bersih (Netto)]]></text>
            </staticText>
            <staticText>
                <reportElement x="363" y="40" width="193" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <text><![CDATA[CIF (US $)]]></text>
            </staticText>
            <textField>
                <reportElement x="102" y="0" width="35" height="19"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.String"><![CDATA[$P{thn_proses}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="40" y="0" width="25" height="19"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.Integer"><![CDATA[$P{bln_proses}]]></textFieldExpression>
            </textField>
        </band>
    </columnHeader>
    <detail>
        <band height="32" splitType="Stretch">
            <textField>
                <reportElement x="1" y="-1" width="55" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.String"><![CDATA[$F{ID_Negara}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="146" y="-1" width="90" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.Double"><![CDATA[$F{Curr_Net}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="235" y="-1" width="129" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.Double"><![CDATA[$F{Cumm_Net}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="55" y="-1" width="92" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.String"><![CDATA[$F{Nama_Negara}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="363" y="0" width="50" height="19"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.Double"><![CDATA[$F{Curr_CIF}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="412" y="-1" width="144" height="20"/>
                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                <textFieldExpression class="java.lang.Double"><![CDATA[$F{Cumm_CIF}]]></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>

5 个答案:

答案 0 :(得分:6)

这意味着您的JasperReports Library类路径中有几个 jar 文件...只需使用:

  • 公地BeanUtils的-1.8.0
  • 公地集合-2.1.1
  • 公地消化器-1.7
  • 公地javaflow-20060411
  • 共享记录-1.0.4
  • Groovy的全1.7.5
  • 的iText-2.1.7
  • jasperreports-4.5.0(任何版本)
  • PNG编码器-1.5
  • poi-3.7-20101029(或poi-3.6)

问题解决了......

答案 1 :(得分:1)

jasperreports-maven-plugin重复了jasperreports依赖。当我更改jasperreports依赖项的版本但我没有在jasperreports-maven-plugin的依赖项中更改它时,我遇到了问题。

答案 2 :(得分:0)

我将primefaces jar文件从3.5更新到4.0。它解决了这个问题。

答案 3 :(得分:0)

对于最新的可下载的jasper jar zip(Japsperreports-6.3.0.jar),它不提供所有需要的jar文件。你必须找到jar文件。 要消除问题,只需添加

jasperreports-6.3.0.jar, org.apache.commons.collections.jar, commons-logging-1.2.jar, commons-digester-2.1.jar, commons-beanutils-1.8.3.jar,

会正常工作..

答案 4 :(得分:0)


只需在报告编译期间从类路径中删除jasperreports-javaflow * .jar 错误应该消失。