TOMEE-4657 - use the modular EclipseLink JPA artifact instead of the uber-jar#2845
Merged
Conversation
…uber-jar Plume shipped org.eclipse.persistence:eclipselink, a monolithic artifact that bundles MOXy alongside the JPA runtime and registers a jakarta.xml.bind.JAXBContextFactory service. MOXy therefore won the ServiceLoader lookup over the JAXB RI that Plume also ships, and MOXy cannot unmarshal through the SAX UnmarshallerHandler chain Apache BVal uses while parsing validation.xml and constraint-mapping descriptors. Every Bean Validation XML configuration path on a stock Plume server failed with a DOMException (NAMESPACE_ERR). Plume needs a JPA provider, not a JAXB one, so depend on the modular org.eclipse.persistence.jpa artifact. It brings the JPA runtime plus persistence.core and jpa.jpql, keeps the jakarta.persistence.spi.PersistenceProvider service, and leaves MOXy, SDO, JPA-RS and the Oracle platforms out of the distribution. jaxb-runtime is now the only JAXBContextFactory provider in Plume, so no system property pin is needed. Verified on a clean build of the Plume distribution: - Jakarta Persistence TCK 3.2.1: 2134 tests, 0 failures, 0 errors, plus the signature test, unchanged from the previous baseline. - Jakarta Validation TCK 3.1.1: 1049 tests, 0 failures, signature test 0 failures, with no jakarta.xml.bind.JAXBContextFactory pin configured. Note that the change only shows up in a clean build: the plume work dir keeps previously staged jars, so an incremental build can still package the old uber-jar. boms/tomee-plume/pom.xml is regenerated by GenerateBoms during the build.
rzo1
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a stock TomEE 11 Plume server, every Bean Validation path that reads
validation.xmlor a constraint-mapping XML descriptor fails.Plume depends on
org.eclipse.persistence:eclipselink, a monolithic artifact that bundles MOXy alongside the JPA runtime and registers ajakarta.xml.bind.JAXBContextFactoryservice. MOXy therefore wins theServiceLoaderlookup over the JAXB RI that Plume also ships. MOXy cannot unmarshal through the SAXUnmarshallerHandlerchain Apache BVal uses (SchemaManager#unmarshal), so descriptor parsing fails withDOMException: NAMESPACE_ERR.Two details worth noting, since the Jira description gets them slightly wrong:
JAXBContext.newInstanceitself succeeds under MOXy. The failure happens later, when the unmarshaller receives SAX events.validation.xml, which needs no rewriting, fails identically.Fix
Plume needs a JPA provider, not a JAXB one, so depend on the modular
org.eclipse.persistence.jpaartifact instead.It brings the JPA runtime plus
persistence.coreandjpa.jpql, keeps thejakarta.persistence.spi.PersistenceProviderservice, and leaves MOXy, SDO, JPA-RS and the Oracle platforms out of the distribution.jaxb-runtimebecomes the onlyJAXBContextFactoryprovider in Plume, so no system property pin is required.Shipped Plume
lib/after the change:Verification
Both run against a clean build of the Plume distribution:
jakarta.xml.bind.JAXBContextFactorypin configuredThe validation run is the one that closes the issue: the TCK harness previously needed a
jakarta.xml.bind.JAXBContextFactorysystem property to pass, and that workaround is no longer necessary.The persistence run covers the regression risk of dropping the uber-jar. All 17 EclipseLink classes TomEE imports are present in the modular set, and nothing reaches the removed JPA-RS/SDO/Oracle classes reflectively.
Notes for reviewers
boms/tomee-plume/pom.xmlis regenerated byGenerateBomsduring the build; the only other change there isasm-analysisandasm-utildropping out, since they came in via the uber-jar.🤖 Generated with Claude Code