log4j.dtd

I use log4j in most of the projects for logging and use XML based configuration. Most of the part in log4j.xml is common and all we need to add appenders and loggers.

我在大多数项目中使用log4j进行日志记录,并使用基于XML的配置。 log4j.xml大部分部分是通用的,我们需要添加添加器和记录器。

Eclipse log4j.xml –无法将log4j.dtd验证为XML定义 (Eclipse log4j.xml – log4j.dtd cannot be validated as the XML definition)

Recently Eclipse shown a warning in my log4j.xml file as below. However it had no effect on my project build or deployment.

最近,Eclipse在我的log4j.xml文件中显示了一个警告,如下所示。 但是,这对我的项目构建或部署没有影响。

The file cannot be validated as the XML definition “/Users/pankaj/workspace/MyProject/src/main/java/log4j.dtd (No such file or directory)” that is specified as describing the syntax of the file cannot be located.
由于无法找到指定为描述文件语法的XML定义“ /Users/pankaj/workspace/MyProject/src/main/java/log4j.dtd(无此类文件或目录)”,因此无法验证该文件。

The line that was throwing the error was:

引发错误的行是:

<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

Eclipse log4j.xml的修复–无法将log4j.dtd验证为XML定义 (Fix for Eclipse log4j.xml – log4j.dtd cannot be validated as the XML definition)

Usually Eclipse looks for log4j.dtd in classpath and it doesn’t find it there and hence the error. We can resolve this issue by providing URL for log4j.dtd file like below.

通常,Eclipse在类路径中查找log4j.dtd,但在那里找不到它,因此会出现错误。 我们可以通过为log4j.dtd文件提供URL来解决此问题,如下所示。

<!DOCTYPE log4j:configuration SYSTEM "https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">

Some other valid configuration through which we can resolve the warning is:

我们可以用来解决警告的其他有效配置是:

<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">

That’s all for fixing this eclipse log4j xml error because of log4j.dtd location.

全部用于解决由于log4j.dtd位置而导致的eclipse log4j xml错误。

翻译自: https://www.journaldev.com/2244/eclipse-log4j-xml-log4j-dtd-cannot-validated-xml-definition

log4j.dtd

log4j.dtd_Eclipse log4j.xml –无法将log4j.dtd验证为XML定义相关推荐

  1. 02_MyBatis项目结构,所需jar包,ehcache.xml配置,log4j.properties,sqlMapConfig.xml配置,SqlMapGenerator.xml配置

     项目结构(所需jar包,配置文件) sqlMapConfig.xml的配置内容如下: <?xmlversion="1.0"encoding="UTF-8&qu ...

  2. 项目构建之springboot集成lomback.xml,和log4j基于properties方式的日志配置记录

    文章目录 springboot集成lomback.xml 描述 在yml中定义的一些配置信息 创建logback-spring.xml文件 logback-spring.xml配置如下: **log4 ...

  3. Log4j配置学习文档之一 log4j配置

    #Log4j配置 Log4J的配置文件(Configuration File)就是用来设置记录器的级别.存放器和布局的,它可接key=value格式的设置或xml格式的设置信息.通过配置,可以创建出L ...

  4. log4j日志文件的使用及log4j日志文件失效原因分析

    log4j的使用步骤 1.导入log4j-*.jar,例:log4j-1.2.17-jar; <dependency><groupId>log4j</groupId> ...

  5. log4j与log4j2性能对比及log4j升级至log4j2方案

    1.前言 之前某个服务在压测环境中出现了问题,分析之后得知是log4jLogger对象争用厉害,很多线程阻塞在此. 以上问题证明log4j在高并发高QPS情况下,是存在性能问题的. 之后把log4j升 ...

  6. Log4j 使用方法和输出格式控制--log4j的PatternLayout参数含义

    Log4j 由 Apache 推出的开源免费日志处理的类库 可以控制日志信息输送的目的地是控制台.文件-等 可以控制每一条日志的输出格式 使用时导入 log4j 的 jar 包,并在 src 中 配置 ...

  7. log4j:WARN Error initializing output writer. log4j:WARN Unsupported encoding?

    javaWeb在使用log.4j打印日志文件的时候提示: log4j:WARN Error initializing output writer. log4j:WARN Unsupported enc ...

  8. log4j警告:WARN Please initialize the log4j system properly 的解决方法

    出现这个问题的原因则是因为没有为log4j建立配置文件导致的.所以解决问题的方法很简单,只要在 src文件目录下建立配置文件即可: 右键点击src  -> New  ->  File 文件 ...

  9. java log4j 多个文件_为什么log4j会记录到两个单独的文件? [重复]

    这个问题在这里已有答案: 我有以下 log4j.properties 文件,默认的appender和特定类的单独的appender log4j.rootLogger=DEBUG, STDOUT, de ...

最新文章

  1. junit4X系列--Builder、Request与JUnitCore
  2. java 远程登陆windows_使用Windows身份验证,JAVA连接到远程MSSQL
  3. mysql 存在索引但不能使用索引的典型场景
  4. DHTMLX-Tabbar
  5. msyql主从同步实践
  6. git pull命令执行时,命令框不可操作的问题
  7. Slog45_项目上线之域名的购买
  8. SAP Cloud Platform上Destination属性为odata_gen的具体用途
  9. mysql没有东西的商品_MYSQL 对商品表没有主图的数据调整为下架的SQL脚本
  10. AI 线上峰会 | 人工智能技术解析与实战
  11. 10余万行C代码开源之后,我被震惊了。。。
  12. 基于ARM的嵌入式Linux移植真实体验(3)――操作系统
  13. Java程序中调用Python脚本的方法
  14. python 证件照换背景色(蓝底->白底,蓝底->红底)
  15. 心理压力的测试软件,心理压力测量量表(WYB)
  16. 分享一个神器,我们前端再也不怕UI设计图不标注了
  17. VC驿站 - WwW.CcTry.CoM
  18. 数据挖掘技术功能有哪些
  19. 为什么要选择ABBYY FineReader 14
  20. sound and complete

热门文章

  1. iOS 4中禁止程序退出后保留在后台的方法
  2. Javascript访问Cookie的四个常用方法
  3. [转载] python中的eval函数
  4. [转载] Python——函数练习(包括简单递归)
  5. [转载] python中异常处理的四个句子_Python学习笔记总结(四)异常处理
  6. mysql cmmand not found
  7. Getting Started with Processing 第五章的easing问题(2)
  8. 当网卡收到的包的目的地址是主机上另一个网卡的地址.arp总结
  9. 将公司的主要项目从eclipse迁移到android studio for mac环境(1)
  10. golang语言os.Stat()用法及功能