1
resposta

IllegalStateException após adicionar as linhas do log4j

Na Aula 4 após "descomentar" as linhas referentes ao log4j um novo erro acontece. Em outro post do fórum um instrutor disse que o projeto está com problemas e que deveríamos listar outra versão no Spring no arquivo pom.xml

    <properties>
        <spring.version>4.1.0.RELEASE</spring.version>
    </properties>

Segue erro no console.

ADVERTÊNCIA: The web application [projeto-jpa-2] registered the JDBC driver [com.mysql.cj.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
jun 24, 2020 3:17:46 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
ADVERTÊNCIA: The web application [projeto-jpa-2] appears to have started a thread named [mysql-cj-abandoned-connection-cleanup] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144)
 com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:85)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 java.lang.Thread.run(Thread.java:748)
jun 24, 2020 3:17:46 PM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler ["http-nio-8080"]
jun 24, 2020 3:17:46 PM org.apache.catalina.startup.Catalina start
INFORMAÇÕES: Server startup in [19.510] milliseconds
jun 24, 2020 3:17:51 PM org.apache.catalina.loader.WebappClassLoaderBase checkStateForResourceLoading
INFORMAÇÕES: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load []. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1385)
    at org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1038)
    at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.checkThreadContextClassLoader(AbandonedConnectionCleanupThread.java:117)
    at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:84)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

Encontrei um erro no arquivo "log4j.xml" na linha abaixo, mas não sei como resolve-lo.

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

É a versão correta?

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