java.lang.ClassCastException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I get strange errors showing up in the Spoon console when executing a job that runs a shell script (bash). The script seems to run fine, but throws these errors into the console for some reason. Never had this on 5.x running the same bash script. {noformat} log4j:ERROR Could not create an Appender. Reported error follows. java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248) at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176) at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191) at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523) at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:436) at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1004) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:755) at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:896) at org.pentaho.di.core.logging.log4j.Log4jLogging.applyLog4jConfiguration(Log4jLogging.java:85) at org.pentaho.di.core.logging.log4j.Log4jLogging.init(Log4jLogging.java:71) at org.pentaho.di.core.KettleClientEnvironment.initLogginPlugins(KettleClientEnvironment.java:141) at org.pentaho.di.core.KettleClientEnvironment.init(KettleClientEnvironment.java:104) at org.pentaho.di.kitchen.Kitchen$1.call(Kitchen.java:89) at org.pentaho.di.kitchen.Kitchen$1.call(Kitchen.java:83) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) log4j:ERROR Could not create an Appender. Reported error follows. java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248) at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176) at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191) at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523) at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:492) at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1006) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:755) at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:896) at org.pentaho.di.core.logging.log4j.Log4jLogging.applyLog4jConfiguration(Log4jLogging.java:85) at org.pentaho.di.core.logging.log4j.Log4jLogging.init(Log4jLogging.java:71) at org.pentaho.di.core.KettleClientEnvironment.initLogginPlugins(KettleClientEnvironment.java:141) at org.pentaho.di.core.KettleClientEnvironment.init(KettleClientEnvironment.java:104) at org.pentaho.di.kitchen.Kitchen$1.call(Kitchen.java:89) at org.pentaho.di.kitchen.Kitchen$1.call(Kitchen.java:83) Kitchen - Logging is at level : Basic logging at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) {noformat}
    via by Dan Rickner,
  • I get strange errors showing up in the Spoon console when executing a job that runs a shell script (bash). The script seems to run fine, but throws these errors into the console for some reason. Never had this on 5.x running the same bash script. {noformat} log4j:ERROR Could not create an Appender. Reported error follows. java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248) at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176) at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191) at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523) at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:436) at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1004) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:755) at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:896) at org.pentaho.di.core.logging.log4j.Log4jLogging.applyLog4jConfiguration(Log4jLogging.java:85) at org.pentaho.di.core.logging.log4j.Log4jLogging.init(Log4jLogging.java:71) at org.pentaho.di.core.KettleClientEnvironment.initLogginPlugins(KettleClientEnvironment.java:141) at org.pentaho.di.core.KettleClientEnvironment.init(KettleClientEnvironment.java:104) at org.pentaho.di.kitchen.Kitchen$1.call(Kitchen.java:89) at org.pentaho.di.kitchen.Kitchen$1.call(Kitchen.java:83) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) log4j:ERROR Could not create an Appender. Reported error follows. java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248) at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176) at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191) at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523) at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:492) at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1006) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:755) at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:896) at org.pentaho.di.core.logging.log4j.Log4jLogging.applyLog4jConfiguration(Log4jLogging.java:85) at org.pentaho.di.core.logging.log4j.Log4jLogging.init(Log4jLogging.java:71) at org.pentaho.di.core.KettleClientEnvironment.initLogginPlugins(KettleClientEnvironment.java:141) at org.pentaho.di.core.KettleClientEnvironment.init(KettleClientEnvironment.java:104) at org.pentaho.di.kitchen.Kitchen$1.call(Kitchen.java:89) at org.pentaho.di.kitchen.Kitchen$1.call(Kitchen.java:83) Kitchen - Logging is at level : Basic logging at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) {noformat}
    via by Dan Rickner,
  • When start Spoon, in the begining, after karaf starts we see a FileNotFoundException looking for log4j.xml. The exception: {code} log4j:ERROR Could not parse url [file:/C:/Releases/6.0/pdi-ee-6.0.0.0-310/pdi-ee/data-integration/./system/osgi/log4j.xml]. java.io.FileNotFoundException: C:\Releases\6.0\pdi-ee-6.0.0.0-310\pdi-ee\data-integration\.\system\osgi\log4j.xml (The system cannot find the path specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:146) at java.io.FileInputStream.<init>(FileInputStream.java:101) at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90) at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188) at org.apache.log4j.xml.DOMConfigurator$2.parse(DOMConfigurator.java:765) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:871) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:778) at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526) at org.apache.log4j.LogManager.<clinit>(LogManager.java:127) at org.apache.log4j.Logger.getLogger(Logger.java:104) at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:262) at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:108) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1025) at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:844) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:541) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:292) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:269) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:657) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener.<clinit>(ContextLoaderListener.java:253) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.Class.newInstance(Class.java:383) at org.apache.felix.framework.Felix.createBundleActivator(Felix.java:4362) at org.apache.felix.framework.Felix.activateBundle(Felix.java:2149) at org.apache.felix.framework.Felix.startBundle(Felix.java:2072) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299) at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304) at java.lang.Thread.run(Thread.java:745) {code}
    via by Emanuel Teixeira,
  • Hooks throwing exception - Forums | Liferay
    via by Unknown author,
    • java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248) at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176) at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191) at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523) at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:492) at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1006) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:755) at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:896) at org.pentaho.di.core.logging.log4j.Log4jLogging.applyLog4jConfiguration(Log4jLogging.java:85) at org.pentaho.di.core.logging.log4j.Log4jLogging.init(Log4jLogging.java:71) at org.pentaho.di.core.KettleClientEnvironment.initLogginPlugins(KettleClientEnvironment.java:141) at org.pentaho.di.core.KettleClientEnvironment.init(KettleClientEnvironment.java:104) at org.pentaho.di.kitchen.Kitchen$1.call(Kitchen.java:89) at org.pentaho.di.kitchen.Kitchen$1.call(Kitchen.java:83)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,