Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting fails when there are no footers attached #163

Closed
brunoagretti opened this issue Nov 19, 2024 · 0 comments · Fixed by #164
Closed

Exporting fails when there are no footers attached #163

brunoagretti opened this issue Nov 19, 2024 · 0 comments · Fixed by #164
Assignees
Labels
bug Something isn't working

Comments

@brunoagretti
Copy link
Member

Describe the bug

When exporting as .xlsx a grid which has no footers added, the following exception is thrown, and the download fails:

Caused by: javax.servlet.ServletException: com.vaadin.flow.server.ServiceException: java.lang.NullPointerException
	at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:371)
	at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:106)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at vaadin.hibernate.CurrentServerContextFilter.doFilterInternal(CurrentServerContextFilter.java:163)
	... 48 more
Caused by: com.vaadin.flow.server.ServiceException: java.lang.NullPointerException
	at com.vaadin.flow.server.VaadinService.handleExceptionDuringRequest(VaadinService.java:1609)
	at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1572)
	at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:369)
	... 56 more
Caused by: java.lang.NullPointerException
	at java.base/java.util.Objects.requireNonNull(Objects.java:209)
	at java.base/java.util.ImmutableCollections$List12.<init>(ImmutableCollections.java:556)
	at java.base/java.util.List.of(List.java:812)
	at com.flowingcode.vaadin.addons.gridexporter.ExcelStreamResourceWriter.lambda$fillFooter$4(ExcelStreamResourceWriter.java:430)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at com.flowingcode.vaadin.addons.gridexporter.ExcelStreamResourceWriter.fillFooter(ExcelStreamResourceWriter.java:430)
	at com.flowingcode.vaadin.addons.gridexporter.ExcelStreamResourceWriter.createWorkbook(ExcelStreamResourceWriter.java:128)
	at com.flowingcode.vaadin.addons.gridexporter.ExcelStreamResourceWriter.accept(ExcelStreamResourceWriter.java:79)
	at com.flowingcode.vaadin.addons.gridexporter.ConcurrentStreamResourceWriter.accept(ConcurrentStreamResourceWriter.java:254)
	at com.vaadin.flow.server.communication.StreamResourceHandler.handleRequest(StreamResourceHandler.java:86)
	at com.vaadin.flow.server.communication.StreamRequestHandler.handleRequest(StreamRequestHandler.java:110)
	at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1560)
	... 57 more

Moreover, grids that do have a footer attached can be exported correctly.

Expected behavior

No response

Minimal reproducible example

No response

Add-on Version

1.10.0-SNAPSHOT

Vaadin Version

23.3.32

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

2 participants