FlowingCode / GridExporterAddon

Apache License 2.0
10 stars 9 forks source link

PDF exporting returns 0KB file #158

Open paodb opened 3 weeks ago

paodb commented 3 weeks ago

Describe the bug

Go to https://addonsv24-staging.flowingcode.com/gridexporter/basic (or any demo with pdf exporting) and try to export as pdf. See download happening but file is empty.

Expected behavior

Pdf file should contain exported grid data.

Minimal reproducible example

Explained above.

Add-on Version

2.5.0-SNAPSHOT

Vaadin Version

24.5.0

Additional information

Haven't tested locally. Found issue while playing with demo on staging site.

mlopezFC commented 3 weeks ago

This is the problem:

java.lang.ClassNotFoundException: jakarta.xml.bind.ValidationEventHandler
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445) ~[na:na]
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[na:na]
    at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.loadClass(JarUrlClassLoader.java:103) ~[app.jar:1.0.0-SNAPSHOT]
    at org.springframework.boot.loader.launch.LaunchedClassLoader.loadClass(LaunchedClassLoader.java:91) ~[app.jar:1.0.0-SNAPSHOT]
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[na:na]
    at com.flowingcode.vaadin.addons.gridexporter.PdfStreamResourceWriter.accept(PdfStreamResourceWriter.java:54) ~[grid-exporter-addon-2.5.0-SNAPSHOT.jar!/:2.5.0-SNAPSHOT]
    at com.flowingcode.vaadin.addons.gridexporter.ConcurrentStreamResourceWriter.accept(ConcurrentStreamResourceWriter.java:272) ~[grid-exporter-addon-2.5.0-SNAPSHOT.jar!/:2.5.0-SNAPSHOT]
    at com.vaadin.flow.server.communication.StreamResourceHandler.handleRequest(StreamResourceHandler.java:86) ~[flow-server-24.5.0.jar!/:24.5.0]
    at com.vaadin.flow.server.communication.StreamRequestHandler.handleRequest(StreamRequestHandler.java:111) ~[flow-server-24.5.0.jar!/:24.5.0]
    at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1647) ~[flow-server-24.5.0.jar!/:24.5.0]
    at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:398) ~[flow-server-24.5.0.jar!/:24.5.0]
    at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:106) ~[vaadin-spring-24.5.0.jar!/:na]
yuktgsl commented 3 weeks ago

@mlopezFC I think you might need to add javax.xml.bind : jaxb-api : 2.3.1 and org.glassfish.jaxb : jaxb-runtime as dependencies. It would be good if someone could confirm this please.