You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by me...@apache.org on 2024/10/29 17:36:01 UTC
(myfaces) branch 4.0.x updated: MYFACES-4427: 5.0 Quarkus UberJar check multiple classloaders for XML (#793)
This is an automated email from the ASF dual-hosted git repository.
melloware pushed a commit to branch 4.0.x
in repository https://gitbox.apache.org/repos/asf/myfaces.git
The following commit(s) were added to refs/heads/4.0.x by this push:
new a667fbb2a MYFACES-4427: 5.0 Quarkus UberJar check multiple classloaders for XML (#793)
a667fbb2a is described below
commit a667fbb2a4c94151b1c249a6e1a0359dd627aa97
Author: Melloware <me...@gmail.com>
AuthorDate: Tue Oct 29 13:35:56 2024 -0400
MYFACES-4427: 5.0 Quarkus UberJar check multiple classloaders for XML (#793)
---
.../quarkus/deployment/FacesUberJarProcessor.java | 26 +++++++++++++---------
.../src/main/resources/META-INF/faces-config.xml | 2 +-
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/extensions/quarkus/deployment/src/main/java/org/apache/myfaces/core/extensions/quarkus/deployment/FacesUberJarProcessor.java b/extensions/quarkus/deployment/src/main/java/org/apache/myfaces/core/extensions/quarkus/deployment/FacesUberJarProcessor.java
index 25801af3d..730e6e804 100644
--- a/extensions/quarkus/deployment/src/main/java/org/apache/myfaces/core/extensions/quarkus/deployment/FacesUberJarProcessor.java
+++ b/extensions/quarkus/deployment/src/main/java/org/apache/myfaces/core/extensions/quarkus/deployment/FacesUberJarProcessor.java
@@ -25,7 +25,9 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Collections;
+import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Set;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
@@ -63,19 +65,20 @@ public class FacesUberJarProcessor
void uberJarServiceLoaders(BuildProducer<UberJarMergedResourceBuildItem> producer)
{
List<String> serviceFiles = List.of(
- "jakarta.el.ExpressionFactory",
- "jakarta.enterprise.inject.spi.Extension",
- "jakarta.json.spi.JsonProvider",
- "jakarta.servlet.ServletContainerInitializer",
- "jakarta.websocket.ContainerProvider",
- "jakarta.websocket.server.ServerEndpointConfig$Configurator",
- "org.apache.myfaces.spi.AnnotationProvider",
- "org.apache.myfaces.spi.InjectionProvider"
+ "licenses/facelets-LICENSE.txt",
+ "services/jakarta.el.ExpressionFactory",
+ "services/jakarta.enterprise.inject.spi.Extension",
+ "services/jakarta.json.spi.JsonProvider",
+ "services/jakarta.servlet.ServletContainerInitializer",
+ "services/jakarta.websocket.ContainerProvider",
+ "services/jakarta.websocket.server.ServerEndpointConfig$Configurator",
+ "services/org.apache.myfaces.spi.AnnotationProvider",
+ "services/org.apache.myfaces.spi.InjectionProvider"
);
for (String serviceFile : serviceFiles)
{
- producer.produce(new UberJarMergedResourceBuildItem("META-INF/services/" + serviceFile));
+ producer.produce(new UberJarMergedResourceBuildItem("META-INF/" + serviceFile));
}
}
@@ -113,11 +116,14 @@ public class FacesUberJarProcessor
{
XmlCombiner combiner = new XmlCombiner();
// Retrieve all instances of the specified file in the resources
- List<URL> resources = Collections.list(getClass().getClassLoader().getResources(filename));
+ Set<URL> resources = new LinkedHashSet<>();
+ resources.addAll(Collections.list(getClass().getClassLoader().getResources(filename)));
+ resources.addAll(Collections.list(Thread.currentThread().getContextClassLoader().getResources(filename)));
// Combine each resource file found
for (URL resource : resources)
{
+ log.debugf("XML Combine: %s", resource);
try (InputStream is = resource.openStream())
{
combiner.combine(is);
diff --git a/extensions/quarkus/runtime/src/main/resources/META-INF/faces-config.xml b/extensions/quarkus/runtime/src/main/resources/META-INF/faces-config.xml
index a2a182d51..725ff978f 100644
--- a/extensions/quarkus/runtime/src/main/resources/META-INF/faces-config.xml
+++ b/extensions/quarkus/runtime/src/main/resources/META-INF/faces-config.xml
@@ -22,7 +22,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
- <factory>
+ <factory combine.children='append'>
<application-factory>org.apache.myfaces.core.extensions.quarkus.runtime.application.QuarkusApplicationFactory</application-factory>
<exception-handler-factory>org.apache.myfaces.core.extensions.quarkus.runtime.exception.QuarkusExceptionHandlerFactory</exception-handler-factory>
</factory>