【问题标题】:Export plugin broken in Grails 2.3.7导出插件在 Grails 2.3.7 中损坏
【发布时间】:2014-07-01 15:55:19
【问题描述】:

我们最近遇到了 Grails 2.3.7 的 excel-export 插件问题。 我们已经尝试了 0.1.4 和 0.1.6,并且可以在几行代码中重现该问题。

import pl.touk.excel.export.WebXlsxExporter

def headers = ['Name', 'Description']

def withProperties = ['name', 'description']

List<Integer> products = new ArrayList<Integer>()

new WebXlsxExporter().with {
    fillHeader(headers)
    add(products, withProperties)
    save()
}

这会抛出:

方法没有签名:fillHeader() 适用于参数类型:(java.util.ArrayList) 值:[[Name, Description]]

这在带有 excel-export 0.1.4 的 Grails 2.0.3 中运行良好

有什么想法吗?

【问题讨论】:

  • it.fillHeader( ... 工作吗?
  • 抛出:没有方法签名:pl.touk.excel.export.WebXlsxExporter.verifyPropertyTypeCanBeHandled() 适用于参数类型:(java.lang.String)

标签: excel grails groovy export-to-excel grails-2.3


【解决方案1】:

解决方法是将插件升级到版本 0.1.9,这似乎已经解决了这个问题。 但也必须从我们的 maven pom 中明确排除 xerces,这在以前不是必需的。

我们的 pom 现在看起来像:

     <dependency>
        <groupId>org.grails.plugins</groupId>
        <artifactId>excel-export</artifactId>
        <version>0.1.9</version>
        <scope>runtime</scope>
        <type>zip</type>
        <exclusions>
            <exclusion>
                <groupId>xerces</groupId>
                <artifactId>xerces</artifactId>
            </exclusion>
            <exclusion>
                <groupId>xml-apis</groupId>
                <artifactId>xml-apis</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

【讨论】:

    猜你喜欢
    • 2011-11-10
    • 1970-01-01
    • 2015-02-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-14
    • 1970-01-01
    相关资源
    最近更新 更多