java.lang.ClassNotFoundException: org.integrationlayer.util.logging.GenericOutputFilter

MuleSoft JIRA | Greg Slonim | 9 years ago
  1. 0

    SUMMARY: Mule boot classloader does not find a custom-written Log4j filter included in our code distribution when Mule is started. Issues java.lang.ClassNotFoundException and crashes. DETAIL: We had a need to write a custom Log4J filter to use in our logging process. We use SLF4J as a façade for Log4J We know that Mule is using a static bridge JCL->SLF4J We wrote the filter, configured it in log4j.xml, deployed the application on Mule. Here is a snippet of log4j.properties <appender name="MainSystemAppender" class="org.apache.log4j.RollingFileAppender"> <param name="File" value="system.log"/> <param name="Append" value="true"/> <param name="MaxFileSize" value="5MB"/> <param name="MaxBackupIndex" value="5"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-5p %d [%t] %c: %m\n"/> </layout> <filter class="org.integrationlayer.util.logging.GenericOutputFilter"> <param name="objectValue" value="HealthCheck"/> </filter> </appender> We absolutely verified that the filter class file is in the jar. Jar is deployed under $MULE_HOME/lib/user. Mule would not start, issues exception: log4j:ERROR Could not instantiate class [org.integrationlayer.util.logging.GenericOutputFilter]. java.lang.ClassNotFoundException: org.integrationlayer.util.logging.GenericOutputFilter at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.apache.log4j.helpers.Loader.loadClass(Loader.java:178) at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:319) at org.apache.log4j.xml.DOMConfigurator.parseFilters(DOMConfigurator.java:279) at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:200) at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:150) at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:163) at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:425) at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:394) at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:829) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:712) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:618) at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:470) at org.apache.log4j.LogManager.<clinit>(LogManager.java:122) at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:88) at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155) at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:203) at org.mule.modules.boot.LicenseHandler.<clinit>(LicenseHandler.java:34) at org.mule.modules.boot.MuleBootstrap.requestLicenseAcceptance(MuleBootstrap.java:135) at org.mule.modules.boot.MuleBootstrap.prepareBootstrapPhase(MuleBootstrap.java:99) at org.mule.modules.boot.MuleBootstrap.main(MuleBootstrap.java:62) It seems that the boot classloader cannot see our application jars sitting in the $MULE_HOME/lib/user. In fact, I attempted to move the jar with the filter into $MULE_HOME/lib/opt without any result Any and all advice is greatly appreciated. It has been very frustrating to see Classloader issues here.

    MuleSoft JIRA | 9 years ago | Greg Slonim
    java.lang.ClassNotFoundException: org.integrationlayer.util.logging.GenericOutputFilter
  2. 0

    SUMMARY: Mule boot classloader does not find a custom-written Log4j filter included in our code distribution when Mule is started. Issues java.lang.ClassNotFoundException and crashes. DETAIL: We had a need to write a custom Log4J filter to use in our logging process. We use SLF4J as a façade for Log4J We know that Mule is using a static bridge JCL->SLF4J We wrote the filter, configured it in log4j.xml, deployed the application on Mule. Here is a snippet of log4j.properties <appender name="MainSystemAppender" class="org.apache.log4j.RollingFileAppender"> <param name="File" value="system.log"/> <param name="Append" value="true"/> <param name="MaxFileSize" value="5MB"/> <param name="MaxBackupIndex" value="5"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-5p %d [%t] %c: %m\n"/> </layout> <filter class="org.integrationlayer.util.logging.GenericOutputFilter"> <param name="objectValue" value="HealthCheck"/> </filter> </appender> We absolutely verified that the filter class file is in the jar. Jar is deployed under $MULE_HOME/lib/user. Mule would not start, issues exception: log4j:ERROR Could not instantiate class [org.integrationlayer.util.logging.GenericOutputFilter]. java.lang.ClassNotFoundException: org.integrationlayer.util.logging.GenericOutputFilter at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.apache.log4j.helpers.Loader.loadClass(Loader.java:178) at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:319) at org.apache.log4j.xml.DOMConfigurator.parseFilters(DOMConfigurator.java:279) at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:200) at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:150) at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:163) at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:425) at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:394) at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:829) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:712) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:618) at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:470) at org.apache.log4j.LogManager.<clinit>(LogManager.java:122) at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:88) at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155) at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:203) at org.mule.modules.boot.LicenseHandler.<clinit>(LicenseHandler.java:34) at org.mule.modules.boot.MuleBootstrap.requestLicenseAcceptance(MuleBootstrap.java:135) at org.mule.modules.boot.MuleBootstrap.prepareBootstrapPhase(MuleBootstrap.java:99) at org.mule.modules.boot.MuleBootstrap.main(MuleBootstrap.java:62) It seems that the boot classloader cannot see our application jars sitting in the $MULE_HOME/lib/user. In fact, I attempted to move the jar with the filter into $MULE_HOME/lib/opt without any result Any and all advice is greatly appreciated. It has been very frustrating to see Classloader issues here.

    MuleSoft JIRA | 9 years ago | Greg Slonim
    java.lang.ClassNotFoundException: org.integrationlayer.util.logging.GenericOutputFilter
  3. 0

    Failed to load applicationContext to test class by Junit

    Stack Overflow | 4 years ago | ema
    java.lang.ClassNotFoundException: org.apache.log4j.EnhancedPatternLayout
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Rotate graylogs own logs log4j

    GitHub | 2 years ago | 1tft
    java.lang.ClassNotFoundException: org.apache.log4j.rolling.RollingFileAppender
  6. 0

    drake warns of log4j ClassNotFoundException

    GitHub | 1 year ago | BMayneFactual
    java.lang.ClassNotFoundException: org.apache.hadoop.log.metrics.EventCounter
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    org.integrationlayer.util.logging.GenericOutputFilter

    at java.net.URLClassLoader$1.run()
  2. Java RT
    Class.forName
    1. java.net.URLClassLoader$1.run(Unknown Source)
    2. java.security.AccessController.doPrivileged(Native Method)
    3. java.net.URLClassLoader.findClass(Unknown Source)
    4. java.lang.ClassLoader.loadClass(Unknown Source)
    5. sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    6. java.lang.ClassLoader.loadClass(Unknown Source)
    7. java.lang.ClassLoader.loadClassInternal(Unknown Source)
    8. java.lang.Class.forName0(Native Method)
    9. java.lang.Class.forName(Unknown Source)
    9 frames
  3. Apache Log4j
    LogManager.<clinit>
    1. org.apache.log4j.helpers.Loader.loadClass(Loader.java:178)
    2. org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:319)
    3. org.apache.log4j.xml.DOMConfigurator.parseFilters(DOMConfigurator.java:279)
    4. org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:200)
    5. org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:150)
    6. org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:163)
    7. org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:425)
    8. org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:394)
    9. org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:829)
    10. org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:712)
    11. org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:618)
    12. org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:470)
    13. org.apache.log4j.LogManager.<clinit>(LogManager.java:122)
    13 frames
  4. SLF4J LOG4J-12 Binding
    Log4jLoggerFactory.getLogger
    1. org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)
    1 frame
  5. SLF4J API Module
    LoggerFactory.getLogger
    1. org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:88)
    1 frame
  6. Apache Commons Logging
    LogFactory.getLog
    1. org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
    2. org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131)
    3. org.apache.commons.logging.LogFactory.getLog(LogFactory.java:203)
    3 frames
  7. org.mule.modules
    MuleBootstrap.main
    1. org.mule.modules.boot.LicenseHandler.<clinit>(LicenseHandler.java:34)
    2. org.mule.modules.boot.MuleBootstrap.requestLicenseAcceptance(MuleBootstrap.java:135)
    3. org.mule.modules.boot.MuleBootstrap.prepareBootstrapPhase(MuleBootstrap.java:99)
    4. org.mule.modules.boot.MuleBootstrap.main(MuleBootstrap.java:62)
    4 frames