1
resposta

Erro log4j e validation xml

Estou com erros no validation.xml e no log4j. Não fiz nenhuma alteração neles , os erros simplesmente apareceram.

Description Resource Path Location Type Cannot find DTD 'file:///D:/desenvolvimento-web-com-vraptor-4-master/src/main/resources/log4j.dtd'. Create the DTD file or configure an XML catalog for this DTD. log4j.xml /vraptor-produtos/src/main/resources line 2 Language Servers The markup in the document following the root element must be well-formed. log4j.xml /vraptor-produtos/src/main/resources line 3 Language Servers cvc-elt.1.a: Cannot find the declaration of element 'validation-config'. validation.xml /vraptor-produtos/src/main/resources/META-INF line 3 Language Servers

Os arquivos estão assim: validation.xml:

<?xml version="1.0" encoding="UTF-8"?>

<validation-config xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.1.xsd"
        version="1.1">
    <executable-validation enabled="false"/>
</validation-config>

log4j.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

        <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
                <layout class="org.apache.log4j.PatternLayout">
                        <param name="ConversionPattern" 
                                value="%d{HH:mm:ss,SSS} %5p [%-20c{1}] %m%n"/>
                </layout>
        </appender>

        <category name="br.com.caelum.vraptor">
            <priority value="DEBUG" />
            <appender-ref ref="stdout" />
        </category>

</log4j:configuration>
1 resposta

Fala Eduardo.

Parece que ele não está encontrando o arquivo: log4j.dtd no diretório: D:/desenvolvimento-web-com-vraptor-4-master/src/main/resources

Acredito que se colocar ele lá o problema seja resolvido. Você pode pegar o arquivo aqui: https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/test/resources/log4j.dtd

Espero ter ajudado.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software