Jump to content
We've recently updated our Privacy Statement, available here ×

Error with Quarkus native and JasperReport (Java)


lfernapalacio_1

Recommended Posts

Hi all,

I'm trying to include JasperReports in a Quarkus native service (GraalVM 21.3).

However, when I try to load my jrxml in this way:

JasperCompileManager.compileReport(this.getClass().getClassLoader().getResourceAsStream("jasper/template.jrxml"));

(or load the .jasper file directly)

This is the error I get:

...023-05-10 13:26:55,789 DEBUG [net.sf.jas.eng.xml.BaseSaxParserFactory] (executor-thread-0) Instantiated SAX parser factory of type com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl2023-05-10 13:26:55,789 DEBUG [net.sf.jas.ext.DefaultExtensionsRegistry] (executor-thread-0) Loading registries for cache key jdk.internal.loader.ClassLoaders$AppClassLoader@483bf400LogManager error of type FORMAT_FAILURE: Formatting errorHandler.reportError caught:

Yes, nothing else. No trace. Just only that message.

Version of Quarkus: 2.6.0. Version of JasperReport: 6.20.1

I have no idea how to solve this problem or where I can find any clue about that error.

Thanks in advance.

Edit (more info):

No stacktrace by default but after overriding this is the trace:

Message is Formatting errorPackage Name org.jboss.logmanager.handlersClassName org.jboss.logmanager.handlers.ConsoleHandlerjava.lang.Thread.getStackTrace(Thread.java:528)java.util.logging.Handler.reportError(Handler.java:18)org.jboss.logmanager.ExtHandler.reportError(ExtHandler.java:332)org.jboss.logmanager.handlers.WriterHandler.doPublish(WriterHandler.java:45)org.jboss.logmanager.ExtHandler.publish(ExtHandler.java:66)org.jboss.logmanager.ExtHandler.publishToNestedHandlers(ExtHandler.java:97)io.quarkus.bootstrap.logging.QuarkusDelayedHandler.doPublish(QuarkusDelayedHandler.java:80)org.jboss.logmanager.ExtHandler.publish(ExtHandler.java:66)org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:334)org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:341)org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:341)org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:341)org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:341)org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:341)org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:341)org.jboss.logmanager.Logger.logRaw(Logger.java:750)org.jboss.logmanager.Logger.log(Logger.java:708)org.jboss.logging.JBossLogManagerLogger.doLogf(JBossLogManagerLogger.java:53)org.jboss.logging.Logger.errorf(Logger.java:1743)io.quarkus.vertx.http.runtime.QuarkusErrorHandler.handle(QuarkusErrorHandler.java:127)io.quarkus.vertx.http.runtime.QuarkusErrorHandler.handle(QuarkusErrorHandler.java:30)io.vertx.ext.web.impl.RouteState.handleFailure(RouteState.java:1199)io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:160)io.vertx.ext.web.impl.RoutingContextWrapper.next(RoutingContextWrapper.java:201)io.vertx.ext.web.impl.RouterImpl.handleFailure(RouterImpl.java:253)io.vertx.ext.web.impl.RouteState.handleFailure(RouteState.java:1199)io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:160)io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:141)io.vertx.ext.web.impl.RoutingContextImpl.doFail(RoutingContextImpl.java:604)io.vertx.ext.web.impl.RoutingContextImpl.fail(RoutingContextImpl.java:192)io.vertx.ext.web.impl.RoutingContextImpl.fail(RoutingContextImpl.java:181)io.vertx.ext.web.impl.RoutingContextWrapper.fail(RoutingContextWrapper.java:100)io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.dispatch(VertxRequestHandler.java:158)io.quarkus.resteasy.runtime.standalone.VertxRequestHandler$1.run(VertxRequestHandler.java:91)io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:543)org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)java.lang.Thread.run(Thread.java:829)com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:600)com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)Code is 5

Thanks.

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...
  • 2 weeks later...

Hi,

It fails with an empty JRXML too. However, discovering the JasperReports classes as GraalVM indicates, it works (with an empty JRXML). But if you use a more complex JRXML it fails because you probably need to discover fonts, images, ...

In a few days, I'll try to upload to my personal repo in Github a simple poc with Quarkus using an empty Jasper and I'll give you the link to the repo if somebody needs it.

Thanks.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...