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

Upgrade to Derby 10.16.1.1 #41084

Merged
merged 2 commits into from
Jun 11, 2024
Merged

Upgrade to Derby 10.16.1.1 #41084

merged 2 commits into from
Jun 11, 2024

Conversation

yrodiere
Copy link
Member

@yrodiere yrodiere commented Jun 10, 2024

Because Hibernate ORM 6.3+ doesn't technically support Derby 10.14: https://hibernate.atlassian.net/browse/HHH-15203

Right now Quarkus and Hibernate ORM will start even if using Derby 10.14, but:

  • there will be a warning on startup
  • some Hibernate ORM features may not work correctly

Also, we're adding stricter checks in #34889, so startup will start failing if people are still on an older version of Derby.

@quarkus-bot quarkus-bot bot added the area/dependencies Pull requests that update a dependency file label Jun 10, 2024

This comment has been minimized.

@yrodiere yrodiere marked this pull request as draft June 10, 2024 09:42
@yrodiere
Copy link
Member Author

Not as simple as just bumping the version, it seems... I'll have a look.

@yrodiere
Copy link
Member Author

Not as simple as just bumping the version, it seems... I'll have a look.

Turns out Derby 10.17 requires JDK 21.
Derby 10.15 works on JDK 11+ (at least), and Derby 10.16 works on JDK 17+.

I updated my PR to have two successive commits: one to upgrade to Derby 10.15, and one just after that to upgrade to Derby 10.16. That should make things easier to backport if we so chose (not sure we will).

@yrodiere yrodiere changed the title Upgrade to Derby 10.17.1.0 Upgrade to Derby 10.16.1.1 Jun 10, 2024
@yrodiere yrodiere marked this pull request as ready for review June 10, 2024 09:55
@yrodiere
Copy link
Member Author

java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
	at io.quarkus.runtime.Application.start(Application.java:101)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
Caused by: io.quarkus.runtime.configuration.ConfigurationException: Unable to find datasource '<default>' for persistence unit '<default>': Unable to load the datasource driver org.apache.derby.jdbc.ClientDriver for datasource <default>
	at io.quarkus.hibernate.orm.runtime.PersistenceUnitUtil.unableToFindDataSource(PersistenceUnitUtil.java:112)
	at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.injectDataSource(FastBootHibernatePersistenceProvider.java:394)
	at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.buildRuntimeSettings(FastBootHibernatePersistenceProvider.java:209)
	at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(FastBootHibernatePersistenceProvider.java:180)
	at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:66)
	at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:80)
	at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
	at io.quarkus.hibernate.orm.runtime.JPAConfig$LazyPersistenceUnit.get(JPAConfig.java:154)
	at io.quarkus.hibernate.orm.runtime.JPAConfig$1.run(JPAConfig.java:61)
	at java.base@21.0.3/java.lang.Thread.runWith(Thread.java:1596)
	at java.base@21.0.3/java.lang.Thread.run(Thread.java:1583)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:896)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:872)
Caused by: java.lang.RuntimeException: Unable to load the datasource driver org.apache.derby.jdbc.ClientDriver for datasource <default>
	at io.quarkus.agroal.runtime.DataSources.doCreateDataSource(DataSources.java:200)
	at io.quarkus.agroal.runtime.DataSources$2.apply(DataSources.java:156)
	at io.quarkus.agroal.runtime.DataSources$2.apply(DataSources.java:153)
	at java.base@21.0.3/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
	at io.quarkus.agroal.runtime.DataSources.start(DataSources.java:153)
	at io.quarkus.agroal.runtime.DataSources_Bean.doCreate(Unknown Source)
	at io.quarkus.agroal.runtime.DataSources_Bean.create(Unknown Source)
	at io.quarkus.agroal.runtime.DataSources_Bean.create(Unknown Source)
	at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:119)
	at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:38)
	at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:35)
	at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:32)
	at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
	at io.quarkus.arc.impl.ComputingCacheContextInstances.computeIfAbsent(ComputingCacheContextInstances.java:19)
	at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:35)
	at io.quarkus.agroal.runtime.DataSources_Bean.get(Unknown Source)
	at io.quarkus.agroal.runtime.DataSources_Bean.get(Unknown Source)
	at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:559)
	at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:539)
	at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:572)
	at io.quarkus.arc.impl.ArcContainerImpl.instanceHandle(ArcContainerImpl.java:534)
	at io.quarkus.arc.impl.ArcContainerImpl.instance(ArcContainerImpl.java:294)
	at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.injectDataSource(FastBootHibernatePersistenceProvider.java:389)
	... 11 more
Caused by: java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSupport.java:122)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSupport.java:86)
	at java.base@21.0.3/java.lang.Class.forName(DynamicHub.java:1359)
	at java.base@21.0.3/java.lang.Class.forName(DynamicHub.java:1348)
	at io.quarkus.agroal.runtime.DataSources.doCreateDataSource(DataSources.java:198)
	... 33 more

But org.apache.derby.jdbc.ClientDriver is registered for reflection... What's going on :/

This comment has been minimized.

@yrodiere
Copy link
Member Author

Turns out a new dependency is required for JTA and to reference JDBC drivers by name.
See https://db.apache.org/derby/releases/release-10.15.1.3.cgi#Note%20for%20DERBY-6945
"the derbytools.jar library is now required [...] when using Derby DataSources, and when directly referencing the JDBC drivers"

I updated the PR accordingly.

Because Hibernate ORM 6.3+ doesn't technically support Derby 10.14:
https://hibernate.atlassian.net/browse/HHH-15203

Right now Quarkus and Hibernate ORM will start even if using Derby
10.14, but:

* there will be a warning on startup
* some Hibernate ORM features may not work correctly

Also, we're adding stricter checks in
quarkusio#34889,
so startup will start failing if people are still on an older version of
Derby.
Copy link

quarkus-bot bot commented Jun 10, 2024

Status for workflow Quarkus CI

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

✅ 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.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 17

📦 extensions/smallrye-reactive-messaging-kafka/deployment

io.quarkus.smallrye.reactivemessaging.kafka.deployment.dev.KafkaDevServicesDevModeTestCase.sseStream - History

  • Assertion condition defined as a Lambda expression in io.quarkus.smallrye.reactivemessaging.kafka.deployment.dev.KafkaDevServicesDevModeTestCase Expecting size of: [] to be greater than or equal to 2 but was 0 within 10 seconds. - org.awaitility.core.ConditionTimeoutException
org.awaitility.core.ConditionTimeoutException: 
Assertion condition defined as a Lambda expression in io.quarkus.smallrye.reactivemessaging.kafka.deployment.dev.KafkaDevServicesDevModeTestCase 
Expecting size of:
  []
to be greater than or equal to 2 but was 0 within 10 seconds.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31)

📦 integration-tests/reactive-messaging-kafka

io.quarkus.it.kafka.KafkaConnectorTest.testFruits - History

  • Assertion condition defined as a Lambda expression in io.quarkus.it.kafka.KafkaConnectorTest expected: <6> but was: <5> within 10 seconds. - org.awaitility.core.ConditionTimeoutException
org.awaitility.core.ConditionTimeoutException: Assertion condition defined as a Lambda expression in io.quarkus.it.kafka.KafkaConnectorTest expected: <6> but was: <5> within 10 seconds.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1006)
	at org.awaitility.core.ConditionFactory.untilAsserted(ConditionFactory.java:790)
	at io.quarkus.it.kafka.KafkaConnectorTest.testFruits(KafkaConnectorTest.java:63)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)

@gsmet gsmet merged commit 9701b25 into quarkusio:main Jun 11, 2024
52 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.12 - main milestone Jun 11, 2024
@yrodiere yrodiere deleted the derby-upgrade branch June 21, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependencies Pull requests that update a dependency file area/persistence OBSOLETE, DO NOT USE triage/flaky-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants