Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 955818 - Class-Path manifest entries for WARs-in-EAR not handled properly
Class-Path manifest entries for WARs-in-EAR not handled properly
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Server (Show other bugs)
6.0.1
Unspecified Unspecified
unspecified Severity unspecified
: ER1
: EAP 6.3.0
Assigned To: Jason Greene
:
Depends On:
Blocks: 1323345
  Show dependency treegraph
 
Reported: 2013-04-23 18:57 EDT by James Livingston
Modified: 2016-04-01 20:28 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In previous versions of JBoss EAP 6, when multiple sub-deployments in an EAR referred to a single non-module jar via Class-Path manifest entries, it was added to the first sub-deployment's classloader. This caused Class loading problems as the classes in the utility jar would be located in the wrong classloader. This version of the product creates a new deployment module for the utility jar, and has all dependant deployments use it. As a result, the Classloading problems no longer occur.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-28 11:41:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-939 Major Resolved Class-Path manifest entries for WARs-in-EAR not handled properly 2017-03-17 15:55 EDT
Red Hat Knowledge Base (Solution) 357223 None None None Never

  None (edit)
Description James Livingston 2013-04-23 18:57:03 EDT
ManifestClassPathProcessor handles the processing of Class-Path entries in deployments. The handling of those entries in sub-deployments is broken.

https://github.com/doctau/examples/tree/master/war-manifest-classpath builds an EAR containing a utility JAR and two WARs, where both WARs refer to the jar via Class-Path manifest headers. The jar is not in the EAR's library directory nor in application.xml

The resulting module setup will result in the jar being added to the first WAR's module, and the remaining WAR(s) depending on a separate "jar classloader". All WARs should depend on the single shared jar classloader.

When ManifestClassPathProcessor.handlingExistingClassPathEntry() runs for the first war, it will call createAdditionalModule(), which calls createResourceRoot(). The "deploymentUnit.addToAttachmentList(Attachments.RESOURCE_ROOTS, resourceRoot)" adds it to the resource roots for that WAR.

When handlingExistingClassPathEntry() runs for the second (and subsequent) WAR, it will already be in the additionalModules list, so "target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, moduleSpecification.getModuleIdentifier())" gets run.

I believe the step of adding it to the CLASS_PATH_ENTRIES attachment needs to happen on the first WAR (so it is added as a module dependency), and it should not be added to the DU RESOURCE_ROOTS so it is not in the WAR's own classloader.
Comment 1 JBoss JIRA Server 2013-04-24 20:26:35 EDT
Stuart Douglas <stuart.w.douglas@gmail.com> updated the status of jira WFLY-939 to Resolved
Comment 4 Ivo Studensky 2013-06-13 03:40:38 EDT
This is the upstream PR:
https://github.com/wildfly/wildfly/pull/4421
Comment 6 Jan Martiska 2014-04-17 06:38:38 EDT
Reproduced and verified on EAP 6.3.0.ER1.

Note You need to log in before you can comment on or make changes to this bug.