我应该将我的项目log4j升级到log4j2。所以我删除了log4j依赖项并添加了log4j2。一些项目工作良好,但有一个项目出现错误,如下所示:
]] Root cause of ServletException.
java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
at jsp_servlet.__view._jspService(__view.java:86)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:35)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1029)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:104)
at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543)
Truncated. see log file for complete stacktrace
我使用了mvn dependency:tree命令,试图找到依赖项之间的冲突,并且试图排除可能相关的每个子库,但仍然得到相同的错误。
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
private static final Logger log = LogManager.getLogger(View.class);
依赖项:
Maven: commons-io:commons-io:2.8.0
Maven: javax.servlet:servlet-api:2.5
Maven: oracle:ojdbc6:11.2.0.3
Maven: org.apache.logging.log4j:log4j-api:2.14.0
Maven: org.apache.logging.log4j:log4j-core:2.14.0
Maven: org.apache.pdfbox:fontbox:2.0.23
Maven: org.apache.pdfbox:pdfbox:2.0.23
Maven: org.springframework:spring-beans:5.2.12.RELEASE
Maven: org.springframework:spring-core:5.2.12.RELEASE
Maven: org.springframework:spring-web:5.2.12.RELEASE
log4j2.properties:
status = error
name = PropertiesConfig
#Make sure to change log file path as per your need
property.filename = path/to/filename
filters = threshold
filter.threshold.type = ThresholdFilter
filter.threshold.level = debug
appenders = console,rolling
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %5p - %d{yyyy-MM-dd HH:mm:ss.SSS} - %F:%L - %m%n
appender.rolling.type = RollingFile
appender.rolling.name = RollingFile
appender.rolling.fileName = ${filename}
appender.rolling.filePattern = '-'yyyy-MM-dd'.log'
appender.rolling.layout.type = PatternLayout
appender.rolling.layout.pattern = %5p - %d{yyyy-MM-dd HH:mm:ss.SSS} - %F:%L - %m%n
appender.rolling.policies.type = Policies
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.rolling.policies.time.interval = 1
appender.rolling.policies.time.modulate = true
appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
appender.rolling.policies.size.size=10MB
appender.rolling.strategy.type = DefaultRolloverStrategy
appender.rolling.strategy.max = 20
loggers = rolling
#Make sure to change the package structure as per your application
logger.rolling.name = com.thy.dvs
logger.rolling.level = debug
logger.rolling.additivity = false
logger.rolling.appenderRef.rolling.ref = RollingFile
rootLogger.level = debug
rootLogger.appenderRefs = stdout
rootLogger.appenderRef.stdout.ref = STDOUT
我发现的问题至少如下图所示。当我向pom.xml添加新的依赖项时,我还必须向EAR/WAR包添加依赖项“可用元素”。
我正在尝试将log4j升级到log4j2。我试图升级的特定代码行是: 静态字段在新的中不再可用。相反,似乎使用了静态方法来访问优先级int值,可以将指定为。 但是,此方法还需要指定。在调用时,如何知道要指定哪个? 旧优先级:https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/priority.html 新优先级:https:/
你好,我想在Elasticsearch中升级log4j,当前版本显示在下面使用定位命令,所以我必须替换哪些文件,也必须在替换文件后执行某些操作 root@la-prod7-client1:/#找到log4j /etc/elasticsearch/log4j2。性质 /usr/share/elasticsearch/lib/log4j-api-2.11.1.jar /usr/share/elasti
问题内容: 我正在尝试将Eclipse环境更新为Java8。我安装了jdk和jre版本8。我也这样做: https://wiki.eclipse.org/JDT/Eclipse_Java_8_Support_For_Kepler 然后在项目中->属性-> Java构建路径-> JRE系统库->编辑->执行环境-> JavaSE-1.8(unbound),这是名称中唯一带有Java 8的选项。但是,
我需要将spring boot从2.3.7升级到2.4.1。释放。当我更新pom文件时,在spring-security-oauth2依赖项(版本2.4.1.RELEASE)中出现错误。在升级spring版本spring-security-oauth2 2.4.1之前。版本,与springboot 2.3.7配合良好。释放 我的pom文件依赖项: 当我尝试运行我的应用程序时,这是我的例外- 如何更
鉴于最近的Log4J漏洞,升级gradle项目中传递依赖的最安全方法是什么?我的项目没有显式使用log4j(它使用logback),但它有许多依赖关系,这些依赖关系会带来易受攻击的版本(
问题内容: 我正在从码头8升级到码头9,并且遇到了一些API中编译失败的问题。 SslSelectChannelConnector已被删除,从我看到的带有secureRequestCustomizer的httpConfiguration替换了它。 但是我在这两种方法上找不到很多方法。例如 setRequestBufferSize setResponseBufferSize setAcceptors