JBoss EAPJakarta EEJava 21企業系統升級

JBoss EAP 03: JARs, module visibility, and Jakarta migration

··2 min read
Back to the JBoss EAP learning path

Maven builds successfully, but EAP reports ClassNotFoundException. Compilation proves what the compiler could see then. Runtime resolution depends on the loader responsible for the component. These are related questions, not identical dependency lists.

Compare three inventories

InventoryInspectDoes not establish
Maven treeVersions, scopes, transitive dependenciesSame version will load in EAP
WAR/EAR contentsActually packaged JARs and classesVisibility from every module
EAP modules and deployment dependenciesContainer providers and visibilityEvery application path was tested
Identify the layer each observation describes.
bash
# Use your project checkout and an already built artifact.
mvn dependency:tree
jar tf orders.war

Maven may resolve plugins or download dependencies; use existing build records and artifacts when offline. EAP has modular loading rules, with distinctions between EAR subdeployments and WAR isolation. Deployment structure descriptors can change dependencies, but blanket exclusion templates hide the ownership problem.

The namespace change is selective

Migrated enterprise APIs include servlet, persistence, and messaging packages. Java SE packages such as javax.sql, javax.naming, and javax.crypto remain. XML schemas, reflective class names, service registrations, and third-party libraries can also reference old types. Import changes alone do not complete the migration.

A javax.jms type is distinct from its jakarta.jms counterpart. If an application and adapter use different namespaces, identify the API across the entire path before choosing artifacts. Adding both APIs does not bridge their types.

Assign each dependency an owner

ResourceOwnership question
Servlet/Jakarta APIAre compile APIs separate from container implementations?
SpringWhich versions travel with the application?
Hibernate/JPAContainer provider or a documented application-provider setup?
JDBC driverServer-managed or application-created, and for which data source?
A decision worksheet, not a universal exclusion recipe.

Exercise: two versions of one class

Suppose a WAR packages a new library version while a server module supplies an older one. NoSuchMethodError when calling a new method calls for inspecting the loaded version and caller expectations, not adding a third JAR. For ClassNotFoundException, identify the failing loader. Gather artifact contents, effective dependency settings, and the cause chain; then adjust ownership and exercise the affected path.

Download the EAP offline kit: inventory, exercises, workbookNext: 04: JNDI, data sources, transactions

Sources