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

JdbcTemplate is missing a resource bunde for native #5666

Closed
turing85 opened this issue Jan 23, 2024 · 6 comments · Fixed by quarkusio/quarkus#38362 or quarkusio/quarkus#38370
Closed
Labels
area/native bug Something isn't working native
Milestone

Comments

@turing85
Copy link
Contributor

Bug description

When we use JdbcTemplate.queryForRowSet(...), the application will fail in native mode with the following stack trace:

2024-01-23 22:18:22,146 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to /foo failed, error id: 06c0ccc2-ed4f-4822-b478-e00e33ba3a61-1: java.util.MissingResourceException: Can't find bundle for base name com.sun.rowset.RowSetResourceBundle, locale en_US
	at java.base@21/java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:2059)
	at java.base@21/java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1697)
	at java.base@21/java.util.ResourceBundle.getBundleFromModule(ResourceBundle.java:1617)
	at java.base@21/java.util.ResourceBundle.getBundle(ResourceBundle.java:1017)
	at java.sql.rowset@21/com.sun.rowset.JdbcRowSetResourceBundle.<init>(JdbcRowSetResourceBundle.java:105)
	at java.sql.rowset@21/com.sun.rowset.JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle(JdbcRowSetResourceBundle.java:124)
	at java.sql.rowset@21/com.sun.rowset.CachedRowSetImpl.<init>(CachedRowSetImpl.java:364)
	at java.sql.rowset@21/com.sun.rowset.RowSetFactoryImpl.createCachedRowSet(RowSetFactoryImpl.java:49)
	at org.springframework.jdbc.core.SqlRowSetResultSetExtractor.newCachedRowSet(SqlRowSetResultSetExtractor.java:90)
	at org.springframework.jdbc.core.SqlRowSetResultSetExtractor.createSqlRowSet(SqlRowSetResultSetExtractor.java:74)
	at org.springframework.jdbc.core.SqlRowSetResultSetExtractor.extractData(SqlRowSetResultSetExtractor.java:58)
	at org.springframework.jdbc.core.SqlRowSetResultSetExtractor.extractData(SqlRowSetResultSetExtractor.java:42)
	at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:454)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:383)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:466)
	at org.springframework.jdbc.core.JdbcTemplate.queryForRowSet(JdbcTemplate.java:531)
	at de.turing85.quarkus.jdbc.template.Resource.get(Resource.java:28)
	at de.turing85.quarkus.jdbc.template.Resource$quarkusrestinvoker$get_bd3a803a64f67f513762962949efcedfd340aa43.invoke(Unknown Source)
	at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
	at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141)
	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:582)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base@21/java.lang.Thread.runWith(Thread.java:1596)
	at java.base@21/java.lang.Thread.run(Thread.java:1583)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:833)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:211)

Reproducer:

  • clone https://github.com/turing85/quarkus-jdbc-template:
    git clone https://github.com/turing85/quarkus-jdbc-template.git && cd quarkus-jdbc-template
  • build & run in JVM mode:
    ./mvnw clean verify
  • observe that the integration test passes
  • build & run in native mode:
    ./mvnw -Dnative clean verify
  • observe that the integration test fails, and that the above stack trace can be found in the application logs

Affected quarkus versions: at least 3.2.8.Final to 3.6.7.


Comment: I opened the issue here since the dependency that provides JdbcTemplate (spring-jdbc) is a transitive dependency of, e.g., camel-quarkus-sql. As far as I know, the quarkus core does not import spring-jdbc anywhere.

@zhfeng
Copy link
Contributor

zhfeng commented Jan 24, 2024

It's more likely an issue of quarkus but not camel?

@turing85
Copy link
Contributor Author

It's more likely an issue of quarkus but not camel?

Right now, it is unclear. @gastaldi was able to reproduce something on the quarkus-end, but not the problem I have described here.

@ppalaga
Copy link
Contributor

ppalaga commented Jan 24, 2024

I'd expect quarkusio/quarkus#38362 to fix this. @turing85 you mean it does not?

@gastaldi
Copy link
Member

Right now, it is unclear. @gastaldi was able to reproduce something on the quarkus-end, but not the problem I have described here.

@turing85 just to be clear, I did reproduce the same error using a snippet like in https://www.baeldung.com/java-jdbc-rowset, and the linked PR fixes it.

When I tested with your reproducer project, I see the Caused by: javax.sql.rowset.spi.SyncFactoryException: Resource javax/sql/rowset/rowset.properties not found error you mentioned in Zulip. I'll submit a new PR fixing that

@gastaldi
Copy link
Member

It should be fixed in Quarkus main now, thanks for the report and the reproducer!

@turing85
Copy link
Contributor Author

turing85 commented Jan 24, 2024

Okay, this means we can close this issue then 😄

Thanks for the quick fix!

@jamesnetherton jamesnetherton modified the milestones: 3.8.0, 3.7.0 Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/native bug Something isn't working native
Projects
None yet
5 participants