-
Notifications
You must be signed in to change notification settings - Fork 14
java.lang.NoSuchMethodError: com.vaadin.ui.Grid$Column.getValueProvider() issue #30
Comments
See #29 for solution. |
The vaadin-compatibility-excel-exporter does not help for me, because I get this exception on Vaadin8 grids (Vaadin version 8.2.1). |
You can replicate this problem by changing Vaadin version in vaadin-excel-exporter-demo to 8.2.1 |
@ScottHuangZL Any chances of releasing 2.1 soon? I can see that its been resolved in your github code but its not released yet. I may have to create my own component its no releasing soon.Waiting for your reply. |
I have the same problem using Vaadin 8.3.0. Does anyone know the status of this issue? Is it being worked on or can I fix it myself locally? |
I didn't get any updates. I just built a custom component which is suitable for our requirements using poi. |
I forked the repo to https://github.com/realulim/vaadin-excel-exporter and fixed it by updating to Vaadin 8.3.0. At least with my Vaadin app it works now off that fork. |
I deleted my fork again, because now I found https://github.com/jnash67/tableexport-for-vaadin/ which works perfectly fine. |
I am able to run you sample demo smoothly in my local. It look nice, thanks.
But I encounter some issue when I try to leverage it into my own project.
== Add comment at Oct 16 , 2017==
I use Vaadin 8.1.5.
after add below into ExportExcelComponentConfiguration, I find the error change to "getValueProvider()" not find issue.
It can export to excel in case I provide empty data to that grid. So, I am sure it caused by
com.vaadin.ui.Grid$Column.getValueProvider()
Other people also report similar issue, so it should be the Vaadin 8.0 & 8.1 grid column.getValueProvider() method change issue.
Can you help to correct it to match latest Vaadin 8.1.X version? Thanks.
private ExportToExcel<Customer> customizeExportExcelUtility(ExportType exportType) { ExportExcelComponentConfiguration<Customer> componentConfig1 = new ExportExcelComponentConfigurationBuilder<Customer>() .withGrid(this.grid) .withVisibleProperties(new String[]{"id","firstName","lastName"}) .withHeaderConfigs(Arrays.asList(new ComponentHeaderConfigurationBuilder().withAutoFilter(true) .withColumnKeys(new String[]{"id_","firstName_","lastName_"}) .build())) .build();
== Original comment at Oct 15 , 2017, at that time is NPE issue==
The "Customer" is my own pojo class.
Dataprovider as below, it is spring JPA for MySQL.
grid.setDataProvider(new ListDataProvider<>(repo.findAll()));
The customizeExportExcelUtility defined as below.
` private ExportToExcel customizeExportExcelUtility(ExportType exportType) {
ExportExcelComponentConfiguration componentConfig1 = new ExportExcelComponentConfigurationBuilder()
.withGrid(this.grid)
.build();
/* Configuring Sheets */
ExportExcelSheetConfiguration sheetConfig1 = new ExportExcelSheetConfigurationBuilder()
.withReportTitle("Grid (Default)")
.withSheetName("Grid (default)")
.withComponentConfigs(Arrays.asList(componentConfig1))
.withIsHeaderSectionRequired(Boolean.TRUE)
.withDateFormat("yyyy-mm-dd")
.build();
Everything is smooth, grid can show/filter as usual.
However, I encounter NPE issue as below when I try to click to export to excel.
Can you help shed a light on it? Thanks.
`java.lang.NullPointerException: null
at org.vaadin.addons.excelexporter.ExportToExcel.addGridDataRow(ExportToExcel.java:395) [vaadin-excel-exporter-2.0.jar:2.0]
at org.vaadin.addons.excelexporter.ExportToExcel.addGridContent(ExportToExcel.java:248) [vaadin-excel-exporter-2.0.jar:2.0]
at org.vaadin.addons.excelexporter.ExportToExcel.addGridToExcelSheet(ExportToExcel.java:231) [vaadin-excel-exporter-2.0.jar:2.0]
at org.vaadin.addons.excelexporter.ExportToExcel.addGridToExcelSheet(ExportToExcel.java:197) [vaadin-excel-exporter-2.0.jar:2.0]
at org.vaadin.addons.excelexporter.ExportToExcel.addComponents(ExportToExcel.java:124) [vaadin-excel-exporter-2.0.jar:2.0]
at org.vaadin.addons.excelexporter.ExportToExcel.process(ExportToExcel.java:115) [vaadin-excel-exporter-2.0.jar:2.0]
at org.vaadin.addons.excelexporter.ExportToExcel.(ExportToExcel.java:91) [vaadin-excel-exporter-2.0.jar:2.0]
at com.example.demo.view.UIScopedView.customizeExportExcelUtility(UIScopedView.java:155) [classes/:na]
at com.example.demo.view.UIScopedView.lambda$init$61446b05$2(UIScopedView.java:96) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
......
java.lang.NullPointerException: null
at org.vaadin.addons.excelexporter.ExportToExcel.addGridToExcelSheet(ExportToExcel.java:235) ~[vaadin-excel-exporter-2.0.jar:2.0]
at org.vaadin.addons.excelexporter.ExportToExcel.addGridToExcelSheet(ExportToExcel.java:197) ~[vaadin-excel-exporter-2.0.jar:2.0]
at org.vaadin.addons.excelexporter.ExportToExcel.addComponents(ExportToExcel.java:124) ~[vaadin-excel-exporter-2.0.jar:2.0]
at org.vaadin.addons.excelexporter.ExportToExcel.process(ExportToExcel.java:115) ~[vaadin-excel-exporter-2.0.jar:2.0]
at org.vaadin.addons.excelexporter.ExportToExcel.(ExportToExcel.java:91) ~[vaadin-excel-exporter-2.0.jar:2.0]
at com.example.demo.view.UIScopedView.customizeExportExcelUtility(UIScopedView.java:155) ~[classes/:na]
at com.example.demo.view.UIScopedView.lambda$init$61446b05$2(UIScopedView.java:96) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
`
The text was updated successfully, but these errors were encountered: