严重:异常org.springframework.web.util.Log4jConfigListener

肖恩·基恩

在Spring Tool Suite中尝试运行tomcat时遇到以下严重异常:

SEVERE: Exception sending context initialized event to listener instance of class    org.springframework.web.util.Log4jConfigListener
java.lang.IllegalStateException: Cannot set web app root system property when WAR file is not expanded
at    org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:143)
at    org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:117)
at    org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
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)
阿特姆·比兰(Artem Bilan)

不要Log4jConfigListener在没有扩展的WAR中使用; 我们可能需要更清楚地说明这一点。

只有两个好处Log4jWebConfigurer:-在Log4J配置文件更改时刷新Log4J配置;-允许使用相对于Web应用程序根目录的日志文件路径。

当未扩展WAR时,两者都不适用,因此Log4jWebConfigurer在这种情况下使用毫无意义只需依靠log4j.properties类路径根目录中的文件中Log4J的默认初始化即可

顺便说一句,您可能已经注意到Log4jConfigListenerPetclinic和Countrys中已将其注释掉web.xml,原因是相关的:为了能够部署未扩展的WAR,并且可以在JBoss中轻松地工作(它具有Log4J的特殊用法) 。

于尔根

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

IntelliJ 13 Tomcat配置类org.springframework.web.util.Log4jConfigListener的应用程序侦听器时出错

如何解决嵌套异常是java.lang.NoClassDefFoundError:org / springframework / security / web / util / AntPathRequestMatcher

java.lang.NoClassDefFoundError:org / springframework / web / util / UriTemplateHandler

java.lang.NoClassDefFoundError:org / springframework / web / util / UriTemplateHandler

弹簧数据 Neo4j java.lang.NoSuchMethodError 错误:org.springframework.web.util.ServletRequestPathUtils.setParsedRequestPath

org.springframework.web.util.NestedServletException:处理程序派发失败;嵌套的异常是java.lang.StackOverflowError

Spring Boot org.springframework.web.util.NestedServletException:请求处理失败

Spring-java.lang.NoSuchMethodError:org.springframework.web.accept.ContentNegotiationManager.getStrategies()Ljava / util / List ;?

HTTP-500 org.springframework.web.util.NestedServletException:处理程序处理失败;

严重:错误配置类 [org.springframework.web.context.ContextLoaderListener] NoClassDefFoundError: javax/servlet/ServletContextListener

严重:为servlet [dispatcher] org.springframework.beans.factory.NoSuchBeanDefinitionException分配异常:

Spring MVC 初学者。noClassDefDefinition org/springframework/util/MimeType

这是http://www.springframework.org/schema/util的Spring JAR

java.lang.NoSuchMethodError:org.springframework.util.Assert.noNullElements

java.lang.NoSuchMethodError:org.springframework.util.ReflectionUtils.clearCache()

如何创建org.springframework.util.concurrent.ListenableFuture的完整实例

Tomcat和Spring Web-找不到类异常org.springframework.web.context.ContextLoaderListener

错误[org.springframework.web.servlet.DispatcherServlet]

org.springframework.web.servlet.DispatcherServlet noHandlerFound

找不到 org.springframework.web.WebApplicationInitializer

ClassNotFoundException :: org.springframework.web.context.ContextLoaderListener

错误org.springframework.web.HttpMediaTypeNotSupportedException

log4j:WARN找不到记录器的附加程序(org.springframework.web.context.support.StandardServletEnvironment)

异常:org.springframework.web.HttpRequestMethodNotSupportedException使用Spring post方法时

org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration的Bean创建异常

异常:org.springframework.web.bind.MissingServletRequestParameterException:所需的字符串参数“ params”不存在

org.springframework.web.multipart.commons.CommonsMultipartFile无法转换为org.springframework.web.multipart.MultipartFile

org.springframework.web.multipart.MultipartFile和org.springframework.core.io.Resource之间的转换

为什么org.springframework.boot不能导入,而org.springframework.web可以导入?