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

Register Db2 resource bundle classes for reflection #46491

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Feb 25, 2025

Draft as it doesn't work but I thought some other people might want to play with it.

Fixes #46403

@quarkus-bot quarkus-bot bot added the area/jdbc Issues related to the JDBC extensions label Feb 25, 2025
@gsmet gsmet force-pushed the ibm-db2-resource-bundles branch from 0525f0f to d5d09ba Compare February 26, 2025 09:43
@gsmet gsmet marked this pull request as ready for review February 26, 2025 09:50

This comment has been minimized.

@gsmet
Copy link
Member Author

gsmet commented Feb 26, 2025

@zakkak thanks! Believe it or not, I had no idea resource bundle classes were handled specifically, good to know.

This comment has been minimized.

@gsmet gsmet requested a review from zakkak February 26, 2025 10:22
@gsmet
Copy link
Member Author

gsmet commented Feb 26, 2025

Ah wait before merging, I want to check if some of the stuff I added is still needed, it might not be.

@gsmet
Copy link
Member Author

gsmet commented Feb 26, 2025

They are required so it's all good and ready to get merged.


resource.produce(new NativeImageResourceBuildItem("pdq.properties"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsmet how did you come to the conclusion that this is not needed anymore?

I added this registration quite recently in #45527, without it Graal complains about a missing registration when using -H:ThrowMissingRegistrationErrors=

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, well, I had a look at the jar. But maybe they are actually checking for it as an app resource.

Will drop this commit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed it's still needed:

com.oracle.svm.core.jdk.resources.MissingResourceRegistrationError: The program tried to access the resource at path

   pdq.properties

without it being registered as reachable. Add it to the resource metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#resources-and-resource-bundles for help
  [email protected]/java.lang.ClassLoader.getResource(ClassLoader.java:1415)
  com.ibm.db2.jcc.am.ao.b(ao.java:3175)
  com.ibm.db2.jcc.DB2BaseDataSource.initializeDataSourceProxy(DB2BaseDataSource.java:14413)
  com.ibm.db2.jcc.DB2SimpleDataSource.<init>(DB2SimpleDataSource.java:178)
  com.ibm.db2.jcc.DB2Driver.getDataSource(DB2Driver.java:1049)
  com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:435)
  com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:117)
  io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:225)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, well, I had a look at the jar. But maybe they are actually checking for it as an app resource.

Yes despite it not being present, if the code tries to access it we need to register it.

@gsmet gsmet force-pushed the ibm-db2-resource-bundles branch from d5d09ba to 3624040 Compare February 26, 2025 11:53
Copy link
Contributor

@zakkak zakkak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @gsmet

@zakkak zakkak added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Feb 26, 2025
Copy link

quarkus-bot bot commented Feb 26, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 3624040.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@gsmet gsmet merged commit c9b6a0a into quarkusio:main Feb 26, 2025
27 checks passed
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Feb 26, 2025
@quarkus-bot quarkus-bot bot added this to the 3.21 - main milestone Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DB2: Missing resource bundle
2 participants