diff --git a/dev/cnf/dependabot/check_this_in_if_it_changes/pom.xml b/dev/cnf/dependabot/check_this_in_if_it_changes/pom.xml
index 57ad1d65de11..43eb5c03db02 100644
--- a/dev/cnf/dependabot/check_this_in_if_it_changes/pom.xml
+++ b/dev/cnf/dependabot/check_this_in_if_it_changes/pom.xml
@@ -2601,26 +2601,6 @@
checker-compat-qual
2.5.2
-
- org.codehaus.jackson
- jackson-core-asl
- 1.6.2
-
-
- org.codehaus.jackson
- jackson-jaxrs
- 1.6.2
-
-
- org.codehaus.jackson
- jackson-mapper-asl
- 1.6.2
-
-
- org.codehaus.jackson
- jackson-xc
- 1.6.2
-
org.codehaus.plexus
plexus-utils
diff --git a/dev/com.ibm.ws.anno_fat/.classpath b/dev/com.ibm.ws.anno_fat/.classpath
index efd958a9c3bc..936330708a91 100644
--- a/dev/com.ibm.ws.anno_fat/.classpath
+++ b/dev/com.ibm.ws.anno_fat/.classpath
@@ -12,7 +12,10 @@
+
+
+
diff --git a/dev/com.ibm.ws.anno_fat/bnd.bnd b/dev/com.ibm.ws.anno_fat/bnd.bnd
index eff7bce7b9d2..d42f67c388dc 100644
--- a/dev/com.ibm.ws.anno_fat/bnd.bnd
+++ b/dev/com.ibm.ws.anno_fat/bnd.bnd
@@ -25,17 +25,26 @@ src: \
test-applications/LooseConfig/LooseWeb2.war/src, \
test-applications/LooseConfig/LooseServlet1.jar/src, \
test-applications/LooseConfig/LooseServlet2.jar/src, \
- test-applications/LooseConfig/LooseServlet3.jar/src
+ test-applications/LooseConfig/LooseServlet3.jar/src, \
+ test-applications/SpringAnnoTest/SpringAnnoTest.war/src, \
+ test-applications/SpringAnnoTest/SpringAnnoTest.jar/src
fat.project: true
+tested.features: persistencecontainer-3.1, enterprisebeanslite-4.0, cdi-4.0, servlet-6.0, servlet-6.1
+
-buildpath: \
- io.openliberty.org.apache.commons.logging;version=latest, \
- io.openliberty.org.apache.commons.codec;version=latest, \
- com.ibm.websphere.javaee.servlet.3.0;version=latest, \
- com.ibm.websphere.javaee.jsp.2.2;version=latest, \
- commons-httpclient:commons-httpclient;version=3.1, \
- httpunit:httpunit;version=1.5.4, \
- net.sf.jtidy:jtidy;version=9.3.8, \
- org.apache.httpcomponents.client5:httpclient5;version=5.0.2, \
- org.apache.httpcomponents.core5:httpcore5;version=5.0.2
+ io.openliberty.org.apache.commons.logging;version=latest,\
+ io.openliberty.org.apache.commons.codec;version=latest,\
+ com.ibm.websphere.javaee.servlet.3.0;version=latest,\
+ com.ibm.websphere.javaee.jsp.2.2;version=latest,\
+ commons-httpclient:commons-httpclient;version='3.1',\
+ httpunit:httpunit;version='1.5.4',\
+ net.sf.jtidy:jtidy;version='9.3.8',\
+ org.apache.httpcomponents.client5:httpclient5;version='5.0.2',\
+ org.apache.httpcomponents.core5:httpcore5;version='5.0.2',\
+ org.springframework:spring-beans;version='6.1.14',\
+ org.springframework:spring-context;version='6.1.14',\
+ org.springframework:spring-web;version='6.1.14',\
+ org.springframework:spring-webmvc;version='6.1.14',\
+ io.openliberty.jakarta.servlet.6.1
diff --git a/dev/com.ibm.ws.anno_fat/build.gradle b/dev/com.ibm.ws.anno_fat/build.gradle
index 069c6a6a360b..b6bef7c090f9 100644
--- a/dev/com.ibm.ws.anno_fat/build.gradle
+++ b/dev/com.ibm.ws.anno_fat/build.gradle
@@ -15,6 +15,9 @@ configurations {
requiredLibs {
transitive = false
}
+ springLibs {
+ transitive = false
+ }
}
// Define G:A:V coordinates of each dependency
@@ -23,4 +26,23 @@ dependencies {
'org.apache.httpcomponents.client5:httpclient5:5.0.2',
'org.apache.httpcomponents.core5:httpcore5:5.0.2',
project(':io.openliberty.org.apache.commons.codec')
+ springLibs 'org.springframework:spring-beans:6.1.14',
+ 'org.springframework:spring-context:6.1.14',
+ 'org.springframework:spring-core:6.1.14',
+ 'org.springframework:spring-expression:6.1.14',
+ 'org.springframework:spring-web:6.1.14',
+ 'org.springframework:spring-webmvc:6.1.14',
+ project(':io.openliberty.org.apache.commons.logging')
+}
+
+task downloadSpringLibs(type: Copy) {
+ from configurations.springLibs
+ into new File(autoFvtDir, 'publish/shared/resources/spring')
}
+
+addRequiredLibraries {
+ dependsOn downloadSpringLibs
+ dependsOn addJakartaTransformer
+}
+
+
diff --git a/dev/com.ibm.ws.anno_fat/fat/src/com/ibm/ws/tests/anno/FATSuite.java b/dev/com.ibm.ws.anno_fat/fat/src/com/ibm/ws/tests/anno/FATSuite.java
index 919ba1f154ef..c44e16480b57 100644
--- a/dev/com.ibm.ws.anno_fat/fat/src/com/ibm/ws/tests/anno/FATSuite.java
+++ b/dev/com.ibm.ws.anno_fat/fat/src/com/ibm/ws/tests/anno/FATSuite.java
@@ -18,6 +18,7 @@
import org.junit.runners.Suite.SuiteClasses;
import com.ibm.ws.fat.util.FatLogHandler;
+import com.ibm.ws.tests.anno.caching.AnnotationScanInJarTest;
import com.ibm.ws.tests.anno.caching.CacheEnablementTest;
import com.ibm.ws.tests.anno.caching.FragmentOrderTest;
import com.ibm.ws.tests.anno.caching.LooseConfigTest;
@@ -54,7 +55,7 @@
@RunWith(Suite.class)
@SuiteClasses({
// Jandex tests
- JandexAppDefaultAppMgrDefaultTest.class,
+ JandexAppDefaultAppMgrDefaultTest.class,
JandexAppDefaultAppMgrTrueTest.class,
JandexAppFalseAppMgrFalseTest.class,
JandexAppFalseAppMgrTrueTest.class,
@@ -66,7 +67,9 @@
MetadataCompleteTest.class,
MetadataIncompleteTest.class,
FragmentOrderTest.class,
- LooseConfigTest.class,
+ LooseConfigTest.class,
+
+ AnnotationScanInJarTest.class
// BigAppTest.class
})
diff --git a/dev/com.ibm.ws.anno_fat/fat/src/com/ibm/ws/tests/anno/caching/AnnotationScanInJarTest.java b/dev/com.ibm.ws.anno_fat/fat/src/com/ibm/ws/tests/anno/caching/AnnotationScanInJarTest.java
new file mode 100644
index 000000000000..05a344cc9ed7
--- /dev/null
+++ b/dev/com.ibm.ws.anno_fat/fat/src/com/ibm/ws/tests/anno/caching/AnnotationScanInJarTest.java
@@ -0,0 +1,101 @@
+package com.ibm.ws.tests.anno.caching;
+
+import static org.hamcrest.Matchers.empty;
+import static org.hamcrest.Matchers.not;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.ibm.websphere.simplicity.ShrinkHelper;
+import com.ibm.websphere.simplicity.ShrinkHelper.DeployOptions;
+
+import componenttest.annotation.Server;
+import componenttest.custom.junit.runner.FATRunner;
+import componenttest.rules.repeater.EERepeatActions;
+import componenttest.rules.repeater.RepeatTests;
+import componenttest.topology.impl.LibertyServer;
+import componenttest.topology.utils.FATServletClient;
+import spring.test.init.jar.JarInit;
+import spring.test.init.war.WebInit;
+
+@RunWith(FATRunner.class)
+public class AnnotationScanInJarTest extends FATServletClient {
+
+ public static final String APP_NAME = "springTest";
+ public static final String SERVER_NAME = "springTest_server";
+
+ @Server(SERVER_NAME)
+ public static LibertyServer server;
+
+ @ClassRule
+ public static RepeatTests r = EERepeatActions.repeat(SERVER_NAME,
+ EERepeatActions.EE10,
+ EERepeatActions.EE11);
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+
+ WebArchive war = ShrinkWrap.create(WebArchive.class, APP_NAME + ".war")
+ .addPackages(true, WebInit.class.getPackage())
+ .addAsWebInfResource(new StringAsset("logging.level.org.springframework.context.annotation=DEBUG"), "application.properties");
+
+ String userDir = System.getProperty("user.dir"); //ends with: com.ibm.ws.anno_fat/build/libs/autoFVT
+ String springDir = userDir + "/publish/shared/resources/spring/";
+
+
+
+ JavaArchive jar = ShrinkWrap.create(JavaArchive.class, APP_NAME + ".jar")
+ .addPackages(true, JarInit.class.getPackage());
+
+ EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, APP_NAME + ".ear")
+ .addAsModule(war)
+ .addAsLibraries(jar);
+
+ try (DirectoryStream stream = Files.newDirectoryStream(Paths.get(springDir), "*.jar")) {
+ for (Path path : stream) {
+ if (!Files.isDirectory(path)) {
+ ear.addAsLibraries(path.toFile());
+ }
+ }
+ }
+
+ ShrinkHelper.exportDropinAppToServer(server, ear, DeployOptions.SERVER_ONLY);
+
+ server.startServer();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ server.stopServer();
+ }
+
+
+ @Test
+ public void testSpringAnnotationFoundInwar() throws Exception {
+ List matching = server.findStringsInLogsAndTraceUsingMark("AnnotationScanInJarTest test output");
+
+ String allOutput = String.join(" : ", matching);
+
+ assertTrue("Did not find \"onStartup method in war file\" in " + allOutput, allOutput.contains("onStartup method in war file"));
+ assertTrue("Did not find \"onStartup method found via jar file\" in " + allOutput, allOutput.contains("onStartup method found via jar file"));
+ }
+
+
+}
diff --git a/dev/com.ibm.ws.anno_fat/publish/servers/springTest_server/bootstrap.properties b/dev/com.ibm.ws.anno_fat/publish/servers/springTest_server/bootstrap.properties
new file mode 100644
index 000000000000..08c7ba8bf363
--- /dev/null
+++ b/dev/com.ibm.ws.anno_fat/publish/servers/springTest_server/bootstrap.properties
@@ -0,0 +1,5 @@
+bootstrap.include=../testports.properties
+osgi.console=7777
+com.ibm.ws.anno.ScanEarLibs=true
+#com.ibm.ws.logging.trace.specification=*=info=enabled:com.ibm.ws.anno*=finer:com.ibm.ws.container.service*=finer
+
diff --git a/dev/com.ibm.ws.anno_fat/publish/servers/springTest_server/server.xml b/dev/com.ibm.ws.anno_fat/publish/servers/springTest_server/server.xml
new file mode 100644
index 000000000000..7e1d1834c223
--- /dev/null
+++ b/dev/com.ibm.ws.anno_fat/publish/servers/springTest_server/server.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+ componentTest-1.0
+ servlet-6.0
+
+
+
+
diff --git a/dev/com.ibm.ws.anno_fat/test-applications/SpringAnnoTest/SpringAnnoTest.jar/src/spring/test/init/jar/JarInit.java b/dev/com.ibm.ws.anno_fat/test-applications/SpringAnnoTest/SpringAnnoTest.jar/src/spring/test/init/jar/JarInit.java
new file mode 100644
index 000000000000..d4e829eca06f
--- /dev/null
+++ b/dev/com.ibm.ws.anno_fat/test-applications/SpringAnnoTest/SpringAnnoTest.jar/src/spring/test/init/jar/JarInit.java
@@ -0,0 +1,16 @@
+package spring.test.init.jar;
+
+
+import jakarta.servlet.ServletContext;
+import jakarta.servlet.ServletException;
+
+import org.springframework.web.WebApplicationInitializer;
+
+public class JarInit implements WebApplicationInitializer {
+
+ @Override
+ public void onStartup(ServletContext servletContext) throws ServletException {
+ System.out.println("AnnotationScanInJarTest test output: onStartup method found via jar file");
+ }
+
+}
diff --git a/dev/com.ibm.ws.anno_fat/test-applications/SpringAnnoTest/SpringAnnoTest.war/src/spring/test/init/war/WebInit.java b/dev/com.ibm.ws.anno_fat/test-applications/SpringAnnoTest/SpringAnnoTest.war/src/spring/test/init/war/WebInit.java
new file mode 100644
index 000000000000..1e917a710eba
--- /dev/null
+++ b/dev/com.ibm.ws.anno_fat/test-applications/SpringAnnoTest/SpringAnnoTest.war/src/spring/test/init/war/WebInit.java
@@ -0,0 +1,16 @@
+package spring.test.init.war;
+
+
+import jakarta.servlet.ServletContext;
+import jakarta.servlet.ServletException;
+
+import org.springframework.web.WebApplicationInitializer;
+
+public class WebInit implements WebApplicationInitializer {
+
+ @Override
+ public void onStartup(ServletContext servletContext) throws ServletException {
+ System.out.println("AnnotationScanInJarTest test output: onStartup method in war file");
+ }
+
+}
diff --git a/dev/com.ibm.ws.container.service/bnd.bnd b/dev/com.ibm.ws.container.service/bnd.bnd
index 45469b6a4edd..23ceb8e3eba4 100644
--- a/dev/com.ibm.ws.container.service/bnd.bnd
+++ b/dev/com.ibm.ws.container.service/bnd.bnd
@@ -125,6 +125,10 @@ Service-Component: \
greedy:=version;\
configuration-policy:=optional; \
properties:="service.vendor=IBM,toType=com.ibm.ws.container.service.config.WebFragmentsInfo", \
+ com.ibm.ws.container.service.config.WebFragmentInfoAdapter; \
+ implementation:=com.ibm.ws.container.service.config.internal.WebFragmentInfoAdapter; \
+ provide:=com.ibm.wsspi.adaptable.module.adapters.ContainerAdapter; \
+ properties:="service.vendor=IBM,toType=com.ibm.ws.container.service.config.WebFragmentInfo", \
com.ibm.ws.container.service.metadata.MetaDataService; \
implementation:=com.ibm.ws.container.service.metadata.internal.MetaDataServiceImpl; \
provide:='com.ibm.ws.container.service.metadata.MetaDataService,com.ibm.ws.container.service.metadata.internal.MetaDataServiceImpl,com.ibm.ws.container.service.metadata.extended.MetaDataIdentifierService'; \
diff --git a/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/annocache/internal/ModuleAnnotationsImpl.java b/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/annocache/internal/ModuleAnnotationsImpl.java
index b552a099bd19..25c582562880 100644
--- a/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/annocache/internal/ModuleAnnotationsImpl.java
+++ b/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/annocache/internal/ModuleAnnotationsImpl.java
@@ -207,7 +207,7 @@ public ModuleAnnotationsImpl(
//
- private final ModuleInfo moduleInfo;
+ protected final ModuleInfo moduleInfo;
@Override
public ModuleInfo getModuleInfo() {
diff --git a/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/annocache/internal/WebAnnotationsImpl.java b/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/annocache/internal/WebAnnotationsImpl.java
index 5284a2ee2a73..b98ee25810ef 100644
--- a/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/annocache/internal/WebAnnotationsImpl.java
+++ b/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/annocache/internal/WebAnnotationsImpl.java
@@ -12,21 +12,37 @@
*******************************************************************************/
package com.ibm.ws.container.service.annocache.internal;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
+import com.ibm.ejs.ras.TraceComponent;
+import com.ibm.websphere.ras.Tr;
+import com.ibm.ws.container.service.annocache.FragmentAnnotations;
+import com.ibm.ws.container.service.annocache.WebAnnotations;
+import com.ibm.ws.container.service.app.deploy.ApplicationInfo;
+import com.ibm.ws.container.service.app.deploy.EARApplicationInfo;
+import com.ibm.ws.container.service.app.deploy.WebModuleInfo;
+import com.ibm.ws.container.service.config.WebFragmentInfo;
+import com.ibm.ws.container.service.config.WebFragmentsInfo;
+
import com.ibm.wsspi.artifact.ArtifactContainer;
import com.ibm.wsspi.artifact.overlay.OverlayContainer;
import com.ibm.wsspi.adaptable.module.Container;
+import com.ibm.wsspi.adaptable.module.Entry;
import com.ibm.wsspi.adaptable.module.UnableToAdaptException;
import com.ibm.wsspi.annocache.classsource.ClassSource_Aggregate;
import com.ibm.wsspi.annocache.classsource.ClassSource_Aggregate.ScanPolicy;
import com.ibm.wsspi.annocache.classsource.ClassSource_Factory;
import com.ibm.wsspi.annocache.targets.AnnotationTargets_Targets;
+import com.ibm.wsspi.artifact.ArtifactContainer;
+import com.ibm.wsspi.artifact.overlay.OverlayContainer;
import com.ibm.ws.container.service.app.deploy.WebModuleInfo;
import com.ibm.ws.container.service.config.WebFragmentInfo;
@@ -82,6 +98,19 @@
*/
public class WebAnnotationsImpl extends ModuleAnnotationsImpl implements WebAnnotations {
+ //TODO discuss this, sysprop / server.xml, name, etc
+ private final static String SCAN_EAR_LIBS = "com.ibm.ws.anno.ScanEarLibs";
+
+ @SuppressWarnings("unused")
+ private static final boolean scanEarLibs = AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
+ public Boolean run() {
+ String propString = System.getProperty(SCAN_EAR_LIBS);
+ Boolean scanEarLibs = Boolean.valueOf(propString);
+ return scanEarLibs;
+ }
+ });
+
public WebAnnotationsImpl(
AnnotationsAdapterImpl annotationsAdapter,
Container rootContainer, OverlayContainer rootOverlayContainer,
@@ -180,6 +209,8 @@ protected void addInternalToClassSource() {
if ( classSourceFactory == null ) {
return;
}
+
+ List earLibs = scanEarLibs ? getEarLibs() : new ArrayList();
// The classes folder is processed as if it were a fragment item.
@@ -198,6 +229,9 @@ protected void addInternalToClassSource() {
for ( WebFragmentInfo nextFragment : getOrderedItems() ) {
String nextUri = nextFragment.getLibraryURI();
Container nextContainer = nextFragment.getFragmentContainer();
+
+ //Defensive programming to avoid duplicates
+ earLibs.remove(nextContainer);
boolean nextIsMetadataComplete;
ScanPolicy nextPolicy;
@@ -243,6 +277,21 @@ protected void addInternalToClassSource() {
return; // FFDC in 'addContainerClassSource'
}
}
+
+ //TODO property name, should it be a server.xml property instead, etc. Talk with Tom
+ if (scanEarLibs) {
+ try {
+ for (Container c : earLibs) {
+ WebFragmentInfo nextFragmentInfo = c.adapt(WebFragmentInfo.class);
+ String nextPath = putUniquePath(nextFragmentInfo, getContainerPath(c));
+ if (!addContainerClassSource(nextPath, c, ClassSource_Aggregate.ScanPolicy.SEED)) { //TODO should this be SEED?
+ return; // FFDC in 'addContainerClassSource'
+ }
+ }
+ } catch (UnableToAdaptException e) {
+ //TODO, ask Tom what he wants to happen here
+ }
+ }
for ( WebFragmentInfo nextFragment : getExcludedItems() ) {
String nextUri = nextFragment.getLibraryURI();
@@ -271,6 +320,33 @@ protected void addInternalToClassSource() {
}
}
}
+
+ private List getEarLibs() {
+ List earLibs = new ArrayList();
+
+ ApplicationInfo appInfo = this.moduleInfo.getApplicationInfo();
+ EARApplicationInfo earAppInfo = null;
+
+ if (appInfo instanceof EARApplicationInfo) {
+ earAppInfo = (EARApplicationInfo) appInfo;
+ Container libContainer = earAppInfo.getLibraryDirectoryContainer();
+
+ for (Entry entry : libContainer) {
+ if (entry.getName().endsWith(".jar")) {
+ try {
+ Container lib = entry.adapt(Container.class);
+ earLibs.add(lib);
+ } catch (UnableToAdaptException ex) {
+ // Not really a jar archive, just a poorly named file
+ if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
+ Tr.debug(tc, "processLibraryJarPersistenceXml: ignoring " + entry.getName(), ex);
+ }
+ }
+ }
+ }
+
+ return earLibs;
+ }
//
@@ -283,3 +359,4 @@ public FragmentAnnotations getFragmentAnnotations(WebFragmentInfo fragment) {
return new FragmentAnnotationsImpl( useTargets, getFragmentPath(fragment) );
}
}
+
diff --git a/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/config/internal/WebFragmentInfoAdapter.java b/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/config/internal/WebFragmentInfoAdapter.java
new file mode 100644
index 000000000000..d8b36b5ffc46
--- /dev/null
+++ b/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/config/internal/WebFragmentInfoAdapter.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2025 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package com.ibm.ws.container.service.config.internal;
+
+import org.osgi.service.component.annotations.Component;
+
+import com.ibm.ws.container.service.config.WebFragmentInfo;
+import com.ibm.ws.javaee.dd.web.WebFragment;
+import com.ibm.wsspi.adaptable.module.Container;
+import com.ibm.wsspi.adaptable.module.Entry;
+import com.ibm.wsspi.adaptable.module.UnableToAdaptException;
+import com.ibm.wsspi.adaptable.module.adapters.ContainerAdapter;
+import com.ibm.wsspi.artifact.ArtifactContainer;
+import com.ibm.wsspi.artifact.overlay.OverlayContainer;
+
+@Component
+public class WebFragmentInfoAdapter implements ContainerAdapter {
+
+ @Override
+ public WebFragmentInfo adapt(Container root, OverlayContainer rootOverlay, ArtifactContainer artifactContainer, Container containerToAdapt) throws UnableToAdaptException {
+ WebFragment fragmment = containerToAdapt.adapt(WebFragment.class);
+ String path = getPath(containerToAdapt);
+ WebFragmentsInfoImpl.WebFragmentItemImpl nextFragmentInfo = new WebFragmentsInfoImpl.WebFragmentItemImpl(containerToAdapt, fragmment, path, path, false);
+ return nextFragmentInfo;
+ }
+
+ public static String getPath(Container container) throws UnableToAdaptException {
+ // if ( tc.isDebugEnabled() ) {
+ // Tr.debug(tc, "getPath Initial [ " + container + " ]");
+ // }
+ StringBuilder pathBuilder = new StringBuilder();
+
+ Entry entry;
+ while ((entry = container.adapt(Entry.class)) != null) { // throws UnableToAdaptException
+ pathBuilder.insert(0, entry.getPath());
+ container = entry.getRoot();
+ // if ( tc.isDebugEnabled() ) {
+ // Tr.debug(tc, "getPath Next [ " + container + " ]");
+ // }
+ }
+
+ return pathBuilder.toString();
+ }
+}
diff --git a/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/config/internal/WebFragmentsInfoImpl.java b/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/config/internal/WebFragmentsInfoImpl.java
index 6cd125394115..2fb5e1df572d 100644
--- a/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/config/internal/WebFragmentsInfoImpl.java
+++ b/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/config/internal/WebFragmentsInfoImpl.java
@@ -355,7 +355,8 @@ private List absoluteOrderWebFragments(Map