Java.Lang.Reflect.InvocationTargetException Reported On WebLogic When Log4j Application Start (Doc ID 2248212.1)

Last updated on APRIL 03, 2017

Applies to:

Oracle WebLogic Server - Version 10.3.3 to 10.3.3
Information in this document applies to any platform.

Symptoms

On WebLogic Server logs you see the application error :-

org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
Throwable occurred: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [/bea/Oracle/user_projects/domains/xxxx/servers/xxxx/stage/xxxx/xxxx/WEB-INF/classes/spring/spring.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org.apache.log4j.LogManager (initialization failure)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(AccessController.java:224)
....
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: java.lang.NoClassDefFoundError: org.apache.log4j.LogManager (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:140)
at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:249)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:261)
at org.hibernate.cfg.annotations.Version.<clinit>(Version.java:12)
...
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 59 more
Caused by: java.lang.InternalError: java.lang.reflect.InvocationTargetException
at java.lang.Class.lookupCachedMethod(Class.java:2220)
at java.lang.Class.getMethod(Class.java:829)
at org.apache.commons.logging.LogFactory.directGetContextClassLoader(LogFactory.java:825)
at org.apache.commons.logging.LogFactory$1.run(LogFactory.java:791)
at java.security.AccessController.doPrivileged(AccessController.java:202)
at org.apache.commons.logging.LogFactory.getContextClassLoader(LogFactory.java:788)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:385)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
at com.xxxxx.filters.StdoutListener.log(StdoutListener.java:23)
at com.xxxxx.filters.StdoutListener.access$0(StdoutListener.java:22)
at com.xxxxx.filters.StdoutListener$1.println(StdoutListener.java:63)
...
at org.apache.log4j.helpers.LogLog.warn(LogLog.java:170)
at org.apache.log4j.Hierarchy.emitNoAppenderWarning(Hierarchy.java:133)
at org.apache.log4j.Category.callAppenders(Category.java:212)
at org.apache.log4j.Category.forcedLog(Category.java:388)
at org.apache.log4j.Category.log(Category.java:853)
at org.apache.commons.logging.impl.Log4JLogger.info(Log4JLogger.java:193)
at com.xxxxx.filters.StdoutListener.log(StdoutListener.java:23)
at com.xxxxx.filters.StdoutListener.access$0(StdoutListener.java:22)
at com.xxxxx.filters.StdoutListener$1.println(StdoutListener.java:63)
at org.apache.log4j.helpers.LogLog.error(LogLog.java:142)
at org.apache.log4j.helpers.OnlyOnceErrorHandler.error(OnlyOnceErrorHandler.java:77)
at org.apache.log4j.helpers.OnlyOnceErrorHandler.error(OnlyOnceErrorHandler.java:67)
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:166)                            <-------------------------- log4j was trying to activate some options, and got error here
at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:215)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:132)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:96)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:654)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:612)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:441)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:470)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:122)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at org.apache.log4j.Logger.getLogger(Logger.java:104)
at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:283)
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:56)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39)
at java.lang.reflect.Constructor.newInstance(Constructor.java:527)
at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(LogFactoryImpl.java:1040)
at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:838)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
at com.xxxxx.filters.StdoutListener.log(StdoutListener.java:23)
at com.xxxxx.filters.StdoutListener.access$0(StdoutListener.java:22)
at com.xxxxx.filters.StdoutListener$1.println(StdoutListener.java:63)
at com.xxxxx.bank.sap.task.PaymentContextListener.contextInitialized(PaymentContextListener.java:72)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1863)
... 33 more



Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms