我们最近遇到了 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()
}
抛出:
No signature of method: fillHeader () is applicable for argument types: (java.util.ArrayList) values: [[Name, Description]]
这在带有 excel-export 0.1.4 的 Grails 2.0.3 中运行良好
有什么想法吗?
最佳答案
解决方法是将插件升级到版本 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>
关于excel - Grails 2.3.7 中损坏的导出插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24514614/