2
respostas

Erro ao tentar iniciar o tomcat

Olá, ao tentar iniciar o tomcat, está sendo apresentado diversos erros, conforme log abaixo. Fiz o passo passo para baixar o projeto, baixar o tomcat, mais não consigo visualizar a página do projeto. Abaixo o log de erros:

<nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version name:   Apache Tomcat/8.5.47
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Oct 7 2019 13:30:46 UTC
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version number: 8.5.47.0
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Windows 10
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            10.0
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home:             C:\Program Files\Java\jdk-11.0.2
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           11.0.2+9-LTS
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         C:\Users\david\Dropbox\Cursos\Servelet\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         C:\Users\david\Dropbox\Cursos\JAVA NOVO 2\apache-tomcat-8.5.47\apache-tomcat-8.5.47
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\david\Dropbox\Cursos\Servelet\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Users\david\Dropbox\Cursos\JAVA NOVO 2\apache-tomcat-8.5.47\apache-tomcat-8.5.47
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\david\Dropbox\Cursos\Servelet\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
nov 21, 2019 10:03:08 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk-11.0.2\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jdk-11.0.2/bin/server;C:/Program Files/Java/jdk-11.0.2/bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Java\jdk-11.0.2\bin;C:\ProjetosJava\apache-maven-3.6.1-bin\apache-maven-3.6.1\bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\david\Dropbox\Cursos\Servelet\eclipse-jee-2019-06-R-win32-x86_64\eclipse;;.]
nov 21, 2019 10:03:08 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
nov 21, 2019 10:03:08 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
nov 21, 2019 10:03:08 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
nov 21, 2019 10:03:08 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
nov 21, 2019 10:03:08 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 727 ms
2 respostas

Abaixo outra parte do erro.

<INFO: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$2 (file:/C:/Users/david/Dropbox/Cursos/Servelet/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/projeto-jpa-2/WEB-INF/lib/spring-core-4.1.6.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
nov 21, 2019 10:03:14 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'criadorDeProdutos': Invocation of init method failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Could not open connection
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)>

o erro de fato é:

Could not open connection

Como ficou a configuração do seu DataSource ? Seu MySQL está rodando?