Uploaded image for project: 'Red Hat build of Apache Camel for Spring Boot'
  1. Red Hat build of Apache Camel for Spring Boot
  2. CSB-5822

log4j2 cannot resolve the include file location correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Normal Normal
    • None
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Moderate
    • Very Likely
    • 0

      After I upgrade my app from 7.11 to 7.12, the log4j2 cannot resolve the include file location correctly. On 7.11 it worked well.

      <fuse.bom.version>7.11.0.fuse-sb2-7_11_0-00028-redhat-00001</fuse.bom.version> <== worked
      <fuse.bom.version>7.12.0.fuse-7_12_0-00016-redhat-00001</fuse.bom.version> <==not working
      

      The file should be :

      /mnt/secret/log4j-xinclude-appenders.xml
      

      but the log4j2 is trying to find:

      /mnt/etc/secret/log4j-xinclude-appenders.xml
      

      error:

       [Warning] log4j2-demo.xml:8:63: Include operation failed, reverting to fallback. Resource error reading file as XML (href='../secret/log4j-xinclude-appenders.xml'). Reason: /mnt/etc/secret/log4j-xinclude-appenders.xml (No such file or directory)
      [Fatal Error] log4j2-demo.xml:8:63: An include with href '../secret/log4j-xinclude-appenders.xml'failed, and no fallback element was found.
      ERROR StatusConsoleListener Error parsing /mnt/etc/..2024_05_15_09_58_57.1543482373/log4j2-demo.xml
       org.xml.sax.SAXParseException; systemId: file:///mnt/etc/..2024_05_15_09_58_57.1543482373/log4j2-demo.xml; lineNumber: 8; columnNumber: 63; An include with href '../secret/log4j-xinclude-appenders.xml'failed, and no fallback element was found.
      	at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:261)
      	at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
      	at org.apache.logging.log4j.core.config.xml.XmlConfiguration.<init>(XmlConfiguration.java:94)
      	at org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory.getConfiguration(XmlConfigurationFactory.java:46)
      	at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:554)
      	at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.load(Log4J2LoggingSystem.java:237)
      	at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.loadConfiguration(Log4J2LoggingSystem.java:221)
      	at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.loadConfiguration(Log4J2LoggingSystem.java:193)
      	at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:66)
      	at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:57)
      	at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.initialize(Log4J2LoggingSystem.java:169)
      	at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.reinitializeLoggingSystem(PropertySourceBootstrapConfiguration.java:143)
      	at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:123)
      	at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:604)
      	at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:373)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:306)
      	at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:164)
      	at org.springframework.cloud.context.refresh.LegacyContextRefresher.addConfigFilesToEnvironment(LegacyContextRefresher.java:78)
      	at org.springframework.cloud.context.refresh.LegacyContextRefresher.updateEnvironment(LegacyContextRefresher.java:56)
      	at org.springframework.cloud.context.refresh.ContextRefresher.refreshEnvironment(ContextRefresher.java:101)
      	at org.springframework.cloud.context.refresh.ContextRefresher.refresh(ContextRefresher.java:94)
      	at org.springframework.cloud.kubernetes.commons.config.reload.ConfigurationUpdateStrategy.reload(ConfigurationUpdateStrategy.java:43)
      	at org.springframework.cloud.kubernetes.commons.config.reload.ConfigurationChangeDetector.reloadProperties(ConfigurationChangeDetector.java:62)
      	at org.springframework.cloud.kubernetes.client.config.reload.KubernetesClientEventBasedConfigMapChangeDetector.onEvent(KubernetesClientEventBasedConfigMapChangeDetector.java:148)
      	at org.springframework.cloud.kubernetes.client.config.reload.KubernetesClientEventBasedConfigMapChangeDetector.access$100(KubernetesClientEventBasedConfigMapChangeDetector.java:46)
      	at org.springframework.cloud.kubernetes.client.config.reload.KubernetesClientEventBasedConfigMapChangeDetector$1.onUpdate(KubernetesClientEventBasedConfigMapChangeDetector.java:124)
      	at org.springframework.cloud.kubernetes.client.config.reload.KubernetesClientEventBasedConfigMapChangeDetector$1.onUpdate(KubernetesClientEventBasedConfigMapChangeDetector.java:114)
      	at io.kubernetes.client.informer.cache.ProcessorListener.run(ProcessorListener.java:62)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      ERROR StatusConsoleListener No logging configuration
      WARN StatusConsoleListener No Loggers were configured, using default. Is the Loggers element missing?
      

        1. 4.4.png
          139 kB
          Luigi De Masi
        2. 7.11.png
          183 kB
          Luigi De Masi
        3. csb4-configmap.tgz
          28 kB
          Torsten Mielke
        4. image-2024-11-13-19-22-40-717.png
          164 kB
          Luigi De Masi

              ldemasi Luigi De Masi
              rhn-support-xiwu Xiaohui Wu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: