Skip to content

CAMEL-21873: camel-hibernate - document Spring Boot limitation - #28612

Merged
Croway merged 1 commit into
apache:mainfrom
Croway:camel-hibernate-spring-boot-docs-CAMEL-21873
Oct 28, 2026
Merged

Croway merged 1 commit into
apache:mainfrom
Croway:camel-hibernate-spring-boot-docs-CAMEL-21873

Conversation

@Croway

@Croway Croway commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

camel-hibernate requires Hibernate ORM 8 (8.0.0.Beta3) and Jakarta Persistence 4.0 (4.0.0-M7). Spring Boot 4.1.x manages hibernate.version=7.4.13.Final and jakarta-persistence.version=3.2.0, so in a Spring Boot application camel-hibernate-starter resolves to versions the component is not compatible with.

Compiling camel-hibernate against Hibernate 7.4.13.Final / JPA 3.2.0 fails on two Hibernate 8-only methods, so these fail at runtime with NoSuchMethodError:

  • SelectionQuery.setLockTimeout(Timeout), used by the consumer with skipLocked=true
  • MutationQuery.execute(), used by producer mutation queries

The Spring stack is adding Hibernate 8 support but is not there yet for Spring Boot 4.1: Spring Data JPA adapted to JPA 4.0 only in 4.2.0-M2 (spring-projects/spring-data-jpa#4197), and Spring Framework's Hibernate 8 BeanContainer SPI support is in 7.1 (spring-projects/spring-framework#37381).

This PR adds a warning-level "Using with Spring Boot" section to the component docs (with a short warning near the Maven dependency pointing to it) explaining:

  • the Hibernate ORM / Jakarta Persistence version override needed (spring-boot-starter-parent properties, or dependencyManagement when importing the BOM);
  • that the starter must not be combined with Spring Data JPA or the Spring Boot JPA/Hibernate auto-configuration;
  • that the override applies to the whole application (e.g. camel-jpa).

Related: apache/camel-spring-boot#2063 (adds the missing CamelHibernateIT).

Claude Code on behalf of Federico Mariani

Spring Boot manages Hibernate ORM 7.x and Jakarta Persistence 3.2, while
camel-hibernate requires Hibernate ORM 8 and Jakarta Persistence 4.0.
Document the required version overrides and that the starter cannot be
combined with Spring Data JPA or the Spring Boot JPA/Hibernate
auto-configuration yet.
@Croway
Croway requested review from davsclaus, oscerd and ramu11 October 28, 2026 09:00
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@Croway
Croway merged commit ffef175 into apache:main Oct 28, 2026
7 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-hibernate

🔁 2 tests passed only after a retry on JDK 21 (2 retried attempts)

Recovered flaky tests on JDK 21 (2)
Module Test Failed attempts First failure
dsl/camel-jbang/camel-jbang-plugin-tui LaunchManagerOutcomeTest.startedWhenTheStatusFileSaysSo 1 expected: null but was: LaunchOutcome[ok=false, log=null]
dsl/camel-jbang/camel-jbang-plugin-tui MonitorStartupTest.browserOnlyServesUntilTheServerStops 1 Connection refused (connect failed)

ℹ️ These tests did not fail the build. Surefire retried them and they passed.
Retries are enabled project-wide by surefire.rerunFailingTestsCount in parent/pom.xml.


🔬 Scalpel shadow comparison — Scalpel: 8 of 708 tested, 26 compile-only — current: 8 all tested

Maveniverse Scalpel detected 8 affected modules (current approach: 8).

Skip-tests mode would test 8 modules (2 direct + 7 downstream), skip tests for 26 (generated code, meta-modules)

Modules Scalpel would test (8)
  • camel-hibernate ← components/camel-hibernate/src/main/docs/hibernate-component.adoc
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-yaml-dsl-validator
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
  • camel-yaml-dsl-validator ← downstream of org.apache.camel:camel-catalog
  • camel-yaml-dsl-validator-maven-plugin ← downstream of org.apache.camel:camel-yaml-dsl-validator
Modules with tests skipped (26)
  • apache-camel
  • camel-allcomponents
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (35 modules, 4m 32s total)

Total reactor time: 4m 32s

Module Duration Status
Camel :: Launcher 34.5s SUCCESS
Camel :: JBang :: MCP 29.9s SUCCESS
Camel :: JBang :: Plugin :: Validate 25.1s SUCCESS
Camel :: YAML DSL :: Validator 21.9s SUCCESS
Camel :: YAML DSL 21.1s SUCCESS
Camel :: Catalog :: Camel Catalog 19.3s SUCCESS
Camel :: Component DSL 15.1s SUCCESS
Camel :: Kamelet Main 14.9s SUCCESS
Camel :: Hibernate 11.6s SUCCESS
Camel :: Docs 11.5s SUCCESS
Camel :: JBang :: Plugin :: Testing 11.1s SUCCESS
Camel :: JBang :: Plugin :: Kubernetes 10.4s SUCCESS
Camel :: YAML DSL :: Deserializers 6.5s SUCCESS
Camel :: Catalog :: Camel Route Parser 6.3s SUCCESS
Camel :: Catalog :: Camel Report Maven Plugin 5.9s SUCCESS
Camel :: All Components Sync point 4.5s SUCCESS
Camel :: YAML DSL :: Validator Maven Plugin 3.9s SUCCESS
Camel :: YAML DSL :: Maven Plugins 3.0s SUCCESS
Camel :: Catalog :: Maven 2.4s SUCCESS
Camel :: Catalog :: Suggest (deprecated) 2.3s SUCCESS
Camel :: Assembly 1.7s SUCCESS
Camel :: Catalog :: Dummy Component 1.3s SUCCESS
Camel :: JBang :: Integration tests 1.1s SUCCESS
Camel :: Coverage 1.0s SUCCESS
Camel :: JBang :: Plugin :: Edit 0.9s SUCCESS
Camel :: JBang :: Plugin :: Generate 0.9s SUCCESS
Camel :: Catalog :: Console 0.9s SUCCESS
Camel :: JBang :: Main 0.9s SUCCESS
Camel :: Launcher :: Container 0.7s SUCCESS
Camel :: JBang :: Plugin :: MCP 0.7s SUCCESS
Camel :: Endpoint DSL :: Support 0.6s SUCCESS
Camel :: Endpoint DSL n/a
Camel :: Integration Tests n/a
Camel :: JBang :: Core n/a
Camel :: JBang :: Plugin :: TUI n/a

Top 20 slowest modules:

  • Camel :: Launcher (34.5s)
  • Camel :: JBang :: MCP (29.9s)
  • Camel :: JBang :: Plugin :: Validate (25.1s)
  • Camel :: YAML DSL :: Validator (21.9s)
  • Camel :: YAML DSL (21.1s)
  • Camel :: Catalog :: Camel Catalog (19.3s)
  • Camel :: Component DSL (15.1s)
  • Camel :: Kamelet Main (14.9s)
  • Camel :: Hibernate (11.6s)
  • Camel :: Docs (11.5s)
  • Camel :: JBang :: Plugin :: Testing (11.1s)
  • Camel :: JBang :: Plugin :: Kubernetes (10.4s)
  • Camel :: YAML DSL :: Deserializers (6.5s)
  • Camel :: Catalog :: Camel Route Parser (6.3s)
  • Camel :: Catalog :: Camel Report Maven Plugin (5.9s)
  • Camel :: All Components Sync point (4.5s)
  • Camel :: YAML DSL :: Validator Maven Plugin (3.9s)
  • Camel :: YAML DSL :: Maven Plugins (3.0s)
  • Camel :: Catalog :: Maven (2.4s)
  • Camel :: Catalog :: Suggest (deprecated) (2.3s)

⚙️ View full build and test results

@oscerd oscerd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Useful and accurate addition — thanks for documenting this, it's a sharp edge new camel-hibernate users will hit.

I verified the version claims against the component itself on main (camel-hibernate was added recently under this same CAMEL-21873). The component's pom.xml sets its own hibernate8-version=8.0.0.Beta3 and jakarta-persistence4-api-version=4.0.0-M7 and depends on org.hibernate.orm:hibernate-core and jakarta.persistence:jakarta.persistence-api at exactly those versions — deliberately distinct from the project-wide hibernate-version=7.4.13.Final / jakarta-persistence-api-version=3.2.0 that the rest of the build (and Spring Boot's dependency management) align with. So everything the doc asserts checks out:

  • "requires Hibernate ORM 8 and Jakarta Persistence 4.0" and the 8.0.0.Beta3 / 4.0.0-M7 snippet match the component pom exactly;
  • "Spring Boot provides Hibernate ORM 7.x and Jakarta Persistence 3.2" matches the managed versions;
  • the NoSuchMethodError-at-runtime hazard from that skew is real and well explained, as is the single-ORM/JPA-version-per-application consequence for camel-jpa etc.

Both the component doc and the generated catalog mirror are updated identically, so the catalog "uncommitted changes" check is satisfied, and CI is green. The internal link uses a same-page <<...>> reference rather than an external camel.apache.org URL — correct per the doc conventions.

Two non-blocking notes:

  1. Anchor convention. The new section uses an explicit [[hibernate-spring-boot]] anchor before the == Using with Spring Boot heading. The project doc conventions (CLAUDE.md) steer away from explicit [[anchor]] blocks before headings: AsciiDoc already derives an id from the heading text (_using_with_spring_boot), and an explicit anchor sets an id without the _ prefix, diverging from what the website link checker and any cross-page xref: expect — it's rare in the tree (only a handful of component docs use it). Since the only reference here is the same-page WARNING at the top, you could drop [[hibernate-spring-boot]] and point that at <<_using_with_spring_boot,Using with Spring Boot>> instead, to stay with the house pattern. Minor, and your call — just flagging the documented convention.

  2. The user-facing <properties> snippet hardcodes 8.0.0.Beta3 / 4.0.0-M7. That's the right thing for a copy-paste Spring Boot override, but it will need keeping in sync whenever camel-hibernate bumps Hibernate ORM / Jakarta Persistence (the bullet's "the ones used by this Camel release — see the camel-hibernate dependencies" already carries the version-agnostic guidance).

No blockers.

Claude Code on behalf of oscerd

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.

3 participants