Erro ao iniciar o servidor Tomcat - Projeto Webservice resfull com Jersey

14/07/2017

0

Olá, estou fazendo o curso de Criando um Serviço RESTful com Java, e quando fui startar o servidor apareceu a seguinte mensagem de erro no console:


jul 14, 2017 4:28:30 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
ADVERTÊNCIA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Rest-Notas' did not find a matching property.
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server version:        Apache Tomcat/9.0.0.M22
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server built:          Jun 21 2017 09:44:18 UTC
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server number:         9.0.0.0
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: OS Name:               Windows 8.1
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: OS Version:            6.3
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Architecture:          amd64
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Java Home:             C:\\Program Files\\Java\\jre1.8.0_131
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: JVM Version:           1.8.0_131-b11
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: JVM Vendor:            Oracle Corporation
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: CATALINA_BASE:         C:\\Users\\Vanessa\\eclipse-workspace\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: CATALINA_HOME:         C:\\Program Files\\Apache Software Foundation\\Tomcat 9.0
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dcatalina.base=C:\\Users\\Vanessa\\eclipse-workspace\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dcatalina.home=C:\\Program Files\\Apache Software Foundation\\Tomcat 9.0
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dwtp.deploy=C:\\Users\\Vanessa\\eclipse-workspace\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Djava.endorsed.dirs=C:\\Program Files\\Apache Software Foundation\\Tomcat 9.0\\endorsed
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dfile.encoding=Cp1252
jul 14, 2017 4:28:30 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFORMAÇÕES: 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\\jre1.8.0_131\\bin;C:\\Windows\\Sun\\Java\\bin;C:\\Windows\\system32;C:\\Windows;C:/Program Files/Java/jre1.8.0_131/bin/server;C:/Program Files/Java/jre1.8.0_131/bin;C:/Program Files/Java/jre1.8.0_131/lib/amd64;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64\\;C:\\Program Files\\MySQL\\MySQL Utilities 1.6\\;C:\\Users\\Vanessa\\Downloads\\eclipse;;.]
jul 14, 2017 4:28:30 PM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler ["http-nio-8080"]
jul 14, 2017 4:28:30 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMAÇÕES: Using a shared selector for servlet write/read
jul 14, 2017 4:28:30 PM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler ["ajp-nio-8009"]
jul 14, 2017 4:28:30 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMAÇÕES: Using a shared selector for servlet write/read
jul 14, 2017 4:28:30 PM org.apache.catalina.startup.Catalina load
INFORMAÇÕES: Initialization processed in 965 ms
jul 14, 2017 4:28:30 PM org.apache.catalina.core.StandardService startInternal
INFORMAÇÕES: Starting service [Catalina]
jul 14, 2017 4:28:30 PM org.apache.catalina.core.StandardEngine startInternal
INFORMAÇÕES: Starting Servlet Engine: Apache Tomcat/9.0.0.M22
jul 14, 2017 4:28:32 PM org.apache.jasper.servlet.TldScanner scanJars
INFORMAÇÕES: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
jul 14, 2017 4:28:34 PM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler ["http-nio-8080"]
jul 14, 2017 4:28:34 PM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler ["ajp-nio-8009"]
jul 14, 2017 4:28:34 PM org.apache.catalina.startup.Catalina start
INFORMAÇÕES: Server startup in 4230 ms
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3878)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871)
	at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1694)
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1215)
	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2255)
	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2286)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2085)
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:795)
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:327)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at br.edu.devmedia.config.BDConfig.getConnection(BDConfig.java:11)
	at br.edu.devmedia.dao.NotaDAO.listarNotas(NotaDAO.java:18)
	at br.edu.devmedia.rest.NotasService.listarNotas(NotasService.java:37)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
	at org.glassfish.jersey.ser
Responder

Posts

10/08/2017

Estevão Dias

Olá Vv, tudo bem?

Há dois problemas aí, pelo que pude notar. O primeiro está relacionado a configuração do descritor de implantação web.xml, pode conferir se ele está igual ao da aula? O segundo problema é que a senha do seu MySQL é diferente da utilizada pelo autor, então você vai precisar mudar esse trecho de código na classe BDConfig, blz?

Um abraço.
Responder

24/08/2018

Miguel Kuckoski

Olá,

o meu está com o mesmo problema, só consigo carregar até " http://localhost:8080/rest-notas/ ", após isso gera o erro

<!doctype html><html lang="en"><head><title>HTTP Status 404 – Not Found</title><style type="text/css">H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}</style></head><body><h1>HTTP Status 404 – Not Found</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Not Found</p><p><b>Description</b> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.</p><hr class="line" /><h3>Apache Tomcat/7.0.90</h3></body></html>

copiei as classes da aula e não funcionou :/
Responder

27/08/2018

Marcio Souza

Olá Miguel,
se seu problema é o mesmo siga as instruções do Estevão, mas segundo o erro que postou o seu problema não parece ser o mesmo, se fosse, deveria ter uma exceção Http Status 500 e não 404 como aparece na sua postagem.
Http Status 404 é recursos não encontrado, ou seja, a url que usou no cliente não está conseguindo encontrar o recurso no servidor que receba uma requisição por essa url. Então, você tem que verificar essa parte. Confira se sua url está certa no cliente e se no servidor tem um método que espera receber uma requisição por ela.
Responder

Assista grátis a nossa aula inaugural

Assitir aula

Saiba por que programar é uma questão de
sobrevivência e como aprender sem riscos

Assistir agora

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar