assDefFoundError: Could not initialize class org.apache.log4j.Log4jLoggerFactory

2018-03-01 11:25:35来源:oschina作者:yizhichao人点击

分享

tomcat 7.0.63升级tomcat 8.0.50启动报错,解决log4j冲突问题


-bash-4.1$ ls *log4j* com.springsource.org.apache.log4j-1.2.15.jar log4j-1.2.17.jar log4j-over-slf4j-1.7.6.jar slf4j-log4j12-1.7.6.jar -bash-4.1$

-bash-4.1$ mv com.springsource.org.apache.log4j-1.2.15.jar ../ -bash-4.1$ mv log4j-1.2.17.jar ../ -bash-4.1$


-bash-4.1$ ls *log4j* log4j-over-slf4j-1.7.6.jar slf4j-log4j12-1.7.6.jar -bash-4.1$


27-Feb-2018 20:35:43.729 严重 [localhost-startStop-1] org.springframework.web.servlet.DispatcherServlet.initServletBean Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean#0': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4jLoggerFactory at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) at javax.servlet.GenericServlet.init(GenericServlet.java:158) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1188) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1132) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1021) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5046) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5356) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1126) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1868) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4jLoggerFactory at org.apache.log4j.Logger.getLogger(Logger.java:40) at org.jboss.logging.Log4jLogger.(Log4jLogger.java:35) at org.jboss.logging.Log4jLoggerProvider.getLogger(Log4jLoggerProvider.java:33) at org.jboss.logging.LoggerProviders.find(LoggerProviders.java:37) at org.jboss.logging.LoggerProviders.(LoggerProviders.java:32) at org.jboss.logging.Logger.getLogger(Logger.java:2163) at org.jboss.logging.Logger.getMessageLogger(Logger.java:2259) at org.jboss.logging.Logger.getMessageLogger(Logger.java:2214) at org.hibernate.validator.internal.util.logging.LoggerFactory.make(LoggerFactory.java:29) at org.hibernate.validator.internal.util.Version.(Version.java:27) at org.hibernate.validator.internal.engine.ConfigurationImpl.(ConfigurationImpl.java:65) at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41) at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:276) at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:223) at org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean.afterPropertiesSet(OptionalValidatorFactoryBean.java:40) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549) ... 32 more


27-Feb-2018 20:35:43.737 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/bluesky/apache-tomcat-8.0.50/webapps/BlueSky has finished in 9,330 ms 27-Feb-2018 20:35:43.741 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8000"] 27-Feb-2018 20:35:43.753 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"] 27-Feb-2018 20:35:43.760 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 23019 ms

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台