JBoss EAP 03: JARs, module visibility, and Jakarta migration
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
| Inventory | Inspect | Does not establish |
|---|---|---|
| Maven tree | Versions, scopes, transitive dependencies | Same version will load in EAP |
| WAR/EAR contents | Actually packaged JARs and classes | Visibility from every module |
| EAP modules and deployment dependencies | Container providers and visibility | Every application path was tested |
# Use your project checkout and an already built artifact.
mvn dependency:tree
jar tf orders.warMaven 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
| Resource | Ownership question |
|---|---|
| Servlet/Jakarta API | Are compile APIs separate from container implementations? |
| Spring | Which versions travel with the application? |
| Hibernate/JPA | Container provider or a documented application-provider setup? |
| JDBC driver | Server-managed or application-created, and for which data source? |
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