Solucionado (ver solução)
Solucionado
(ver solução)
32
respostas

Caros, o projeto alura-shows está apresentando vários erros que não consigo contornar. Att.,

Description    Resource    Path    Location    Type
javax.servlet.jsp.JspException cannot be resolved to a type    admin.jsp    /alura-shows/WebContent/WEB-INF/views    line 9    JSP Problem
javax.servlet.jsp.JspException cannot be resolved to a type    depoimento.jsp    /alura-shows/WebContent/WEB-INF/views    line 5    JSP Problem
javax.servlet.jsp.JspException cannot be resolved to a type    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 22    JSP Problem
javax.servlet.jsp.JspException cannot be resolved to a type    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 43    JSP Problem
javax.servlet.jsp.JspException cannot be resolved to a type    usuarioLogado.jsp    /alura-shows/WebContent/WEB-INF/views    line 18    JSP Problem
javax.servlet.jsp.PageContext cannot be resolved to a type    admin.jsp    /alura-shows/WebContent/WEB-INF/views    line 10    JSP Problem
javax.servlet.jsp.PageContext cannot be resolved to a type    depoimento.jsp    /alura-shows/WebContent/WEB-INF/views    line 6    JSP Problem
javax.servlet.jsp.PageContext cannot be resolved to a type    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 23    JSP Problem
javax.servlet.jsp.PageContext cannot be resolved to a type    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 43    JSP Problem
javax.servlet.jsp.PageContext cannot be resolved to a type    usuarioLogado.jsp    /alura-shows/WebContent/WEB-INF/views    line 18    JSP Problem
The method getBuild() is undefined for the type MvcUriComponentsBuilder.MethodArgumentBuilder    admin.jsp    /alura-shows/WebContent/WEB-INF/views    line 8    JSP Problem
The method getBuild() is undefined for the type MvcUriComponentsBuilder.MethodArgumentBuilder    depoimento.jsp    /alura-shows/WebContent/WEB-INF/views    line 4    JSP Problem
The method getBuild() is undefined for the type MvcUriComponentsBuilder.MethodArgumentBuilder    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 21    JSP Problem
The method getBuild() is undefined for the type MvcUriComponentsBuilder.MethodArgumentBuilder    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 42    JSP Problem
The method getBuild() is undefined for the type MvcUriComponentsBuilder.MethodArgumentBuilder    usuarioLogado.jsp    /alura-shows/WebContent/WEB-INF/views    line 17    JSP Problem
No end tag (</a>).    cabecalho.jsp    /alura-shows/WebContent/WEB-INF/views    line 33    JSP Problem
No end tag (</a>).    cabecalho.jsp    /alura-shows/WebContent/WEB-INF/views    line 35    JSP Problem
No end tag (</a>).    cabecalho.jsp    /alura-shows/WebContent/WEB-INF/views    line 38    JSP Problem
No end tag (</a>).    cabecalho.jsp    /alura-shows/WebContent/WEB-INF/views    line 40    JSP Problem
No start tag (<a>).    cabecalho.jsp    /alura-shows/WebContent/WEB-INF/views    line 33    JSP Problem
No start tag (<a>).    cabecalho.jsp    /alura-shows/WebContent/WEB-INF/views    line 35    JSP Problem
No start tag (<a>).    cabecalho.jsp    /alura-shows/WebContent/WEB-INF/views    line 38    JSP Problem
No start tag (<a>).    cabecalho.jsp    /alura-shows/WebContent/WEB-INF/views    line 40    JSP Problem
No start tag (<div>).    rodape.jsp    /alura-shows/WebContent/WEB-INF/views    line 9    JSP Problem
The tag handler class for "<" (org.apache.taglibs.standard.tag.rt.core.UrlTag) was not found on the Java Build Path    adminLogado.jsp    /alura-shows/WebContent/WEB-INF/views    line 47    JSP Problem
The tag handler class for "c:forEach" (org.apache.taglibs.standard.tag.rt.core.ForEachTag) was not found on the Java Build Path    depoimento.jsp    /alura-shows/WebContent/WEB-INF/views    line 30    JSP Problem
The tag handler class for "c:if" (org.apache.taglibs.standard.tag.rt.core.IfTag) was not found on the Java Build Path    admin.jsp    /alura-shows/WebContent/WEB-INF/views    line 1    JSP Problem
The tag handler class for "form:form" (org.springframework.web.servlet.tags.form.FormTag) was not found on the Java Build Path    depoimento.jsp    /alura-shows/WebContent/WEB-INF/views    line 4    JSP Problem
32 respostas

Olá Mario,

Estive analisando o log e parece que por algum motivo, algumas dependências não estão listadas no build path do projeto. No lado esquerdo do Eclipse, logo abaixo do projeto, em Maven Dependencies, você conseguiria por favor confirmar se tais classes e pacotes estão presentes? Estou colocando abaixo o printscreen de onde elas estão localizados

Uma sugestão, na sequência, tente fazer um clean no projeto, indo na aba superior e clicando em Project clean

Abs

As classes citadas não estão presentes. Att.,

Olá Mario,

Estranho mesmo, essas dependências estão presentes no pom.xml, você chegou a fazer o project clean e depois o rebuild (Seria o botão abaixo do clean, o Build Automatically deve estar checado)? Em último caso, você conseguiria fazer um teste e adicionar no Build Path do projeto essas dependências:

JSTL: http://central.maven.org/maven2/javax/servlet/jstl/1.2/jstl-1.2.jar

Spring FormTag: http://central.maven.org/maven2/org/springframework/spring-webmvc/4.2.6.RELEASE/spring-webmvc-4.2.6.RELEASE.jar

Para adicionar essas dependências ao projeto de forma manual, clique com o botão direito do mouse no projeto e posteriormente seleciona a opção Properties (deverá ser a última opção presente). Feito isso, deverá abrir uma caixa de configurações, digite Java Build Path, no canto direito deverá aparecer as telas de configuração, a terceira aba deverá ser Libraries, clique no botão Add External JARs e procure por essas dependências, depois clique no botão Apply e em Ok. Essas dependências deverão estar presentes no projeto logo abaixo do Maven Dependencies, deverá estar escrito Referenced Libraries

Abs

Adicionei as dependências de forma manual, elas aparecem em Referenced Libraries, mas o problema continua. Att.,

Olá Mario,

A mensagem de erro seriam as mesmas que apareceram anteriormente?

The tag handler class for "<" (org.apache.taglibs.standard.tag.rt.core.UrlTag) was not found on the Java Build Path    adminLogado.jsp    /alura-shows/WebContent/WEB-INF/views    line 47    JSP Problem
The tag handler class for "c:forEach" (org.apache.taglibs.standard.tag.rt.core.ForEachTag) was not found on the Java Build Path    depoimento.jsp    /alura-shows/WebContent/WEB-INF/views    line 30    JSP Problem
The tag handler class for "c:if" (org.apache.taglibs.standard.tag.rt.core.IfTag) was not found on the Java Build Path    admin.jsp    /alura-shows/WebContent/WEB-INF/views    line 1    JSP Problem
The tag handler class for "form:form" (org.springframework.web.servlet.tags.form.FormTag) was not found on the Java Build Path    depoimento.jsp    /alura-shows/WebContent/WEB-INF/views    line 4    JSP Problem

Uma dúvida, você conseguiu acessar a aplicação em algum momento? O motivo da pergunta, seria porque o Eclipse não reconhece algumas tags que aparecem na JSP e o Eclipse acaba acusando erros que na verdade não teriam.

Olá Mario,

Acho que encontrei as mensagens em questão, me parece ser isso mesmo, a IDE do Eclipse não reconhece algumas tags e acusa como se fosse erro, mas na verdade tais erros não existem. Seria essa a parte não reconhecida pelo Eclipse:

${s:mvcUrl('').build()}

Description Resource Path Location Type Classpath entry /media/mario/tempnew/Workspace-Eclipse/eclipse-jee-oxygen-1a-x86_64/alura-shows/jstl-1.2.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. alura-shows P/alura-shows Classpath Dependency Validator Message Classpath entry /media/mario/tempnew/Workspace-Eclipse/eclipse-jee-oxygen-1a-x86_64/alura-shows/spring-webmvc-4.2.6.RELEASE.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. alura-shows P/alura-shows Classpath Dependency Validator Message

Description    Resource    Path    Location    Type
javax.servlet.jsp.JspException cannot be resolved to a type    admin.jsp    /alura-shows/WebContent/WEB-INF/views    line 9    JSP Problem
javax.servlet.jsp.JspException cannot be resolved to a type    depoimento.jsp    /alura-shows/WebContent/WEB-INF/views    line 5    JSP Problem
javax.servlet.jsp.JspException cannot be resolved to a type    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 22    JSP Problem
javax.servlet.jsp.JspException cannot be resolved to a type    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 22    JSP Problem
javax.servlet.jsp.JspException cannot be resolved to a type    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 43    JSP Problem
javax.servlet.jsp.JspException cannot be resolved to a type    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 43    JSP Problem
javax.servlet.jsp.JspException cannot be resolved to a type    usuarioLogado.jsp    /alura-shows/WebContent/WEB-INF/views    line 18    JSP Problem
javax.servlet.jsp.JspException cannot be resolved to a type    usuarioLogado.jsp    /alura-shows/WebContent/WEB-INF/views    line 18    JSP Problem
javax.servlet.jsp.PageContext cannot be resolved to a type    admin.jsp    /alura-shows/WebContent/WEB-INF/views    line 10    JSP Problem
javax.servlet.jsp.PageContext cannot be resolved to a type    depoimento.jsp    /alura-shows/WebContent/WEB-INF/views    line 6    JSP Problem
javax.servlet.jsp.PageContext cannot be resolved to a type    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 23    JSP Problem
javax.servlet.jsp.PageContext cannot be resolved to a type    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 23    JSP Problem
javax.servlet.jsp.PageContext cannot be resolved to a type    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 43    JSP Problem
javax.servlet.jsp.PageContext cannot be resolved to a type    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 43    JSP Problem
javax.servlet.jsp.PageContext cannot be resolved to a type    usuarioLogado.jsp    /alura-shows/WebContent/WEB-INF/views    line 18    JSP Problem
javax.servlet.jsp.PageContext cannot be resolved to a type    usuarioLogado.jsp    /alura-shows/WebContent/WEB-INF/views    line 18    JSP Problem
The method getBuild() is undefined for the type MvcUriComponentsBuilder.MethodArgumentBuilder    admin.jsp    /alura-shows/WebContent/WEB-INF/views    line 8    JSP Problem
The method getBuild() is undefined for the type MvcUriComponentsBuilder.MethodArgumentBuilder    depoimento.jsp    /alura-shows/WebContent/WEB-INF/views    line 4    JSP Problem
The method getBuild() is undefined for the type MvcUriComponentsBuilder.MethodArgumentBuilder    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 21    JSP Problem
The method getBuild() is undefined for the type MvcUriComponentsBuilder.MethodArgumentBuilder    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 21    JSP Problem
The method getBuild() is undefined for the type MvcUriComponentsBuilder.MethodArgumentBuilder    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 42    JSP Problem
The method getBuild() is undefined for the type MvcUriComponentsBuilder.MethodArgumentBuilder    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 42    JSP Problem
The method getBuild() is undefined for the type MvcUriComponentsBuilder.MethodArgumentBuilder    usuarioLogado.jsp    /alura-shows/WebContent/WEB-INF/views    line 17    JSP Problem
The method getBuild() is undefined for the type MvcUriComponentsBuilder.MethodArgumentBuilder    usuarioLogado.jsp    /alura-shows/WebContent/WEB-INF/views    line 17    JSP Problem
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path    cabecalho.jsp    /alura-shows/WebContent/WEB-INF/views    line 1    JSP Problem
No start tag (<div>).    rodape.jsp    /alura-shows/WebContent/WEB-INF/views    line 9    JSP Problem
The tag handler class for "c:if" (org.apache.taglibs.standard.tag.rt.core.IfTag) was not found on the Java Build Path    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 34    JSP Problem
The tag handler class for "c:if" (org.apache.taglibs.standard.tag.rt.core.IfTag) was not found on the Java Build Path    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 34    JSP Problem
The tag handler class for "form:form" (org.springframework.web.servlet.tags.form.FormTag) was not found on the Java Build Path    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 41    JSP Problem
The tag handler class for "form:form" (org.springframework.web.servlet.tags.form.FormTag) was not found on the Java Build Path    usuario.jsp    /alura-shows/WebContent/WEB-INF/views    line 41    JSP Problem
Description    Resource    Path    Location    Type
The import javax.persistence.Table is never used    Depoimento.java    /alura-shows/src/br/com/alura/owasp/model    line 8    Java Problem

Description    Resource    Path    Location    Type
TODO Auto-generated method stub    CasaDeShowInitializer.java    /alura-shows/src/br/com/alura/owasp/infra    line 14    Java Task
Olá Rafael, esses são os erros. Att.,

Olá Mário,

Pelas mensagens me parece que seria o caso da IDE do Eclipse que não reconhece o trecho ${s:mvcUrl('').build()}, o Eclipse acaba acusando como se fosse um erro, mas na verdade o projeto estaria ok, seria uma questão da IDE mesmo. Quando você arrasta o projeto para o Tomcat e inicializa o mesmo, você consegue acessar a aplicação colocando localhost:8080/alura-shows?

O tomcat não inicializa desta forma pelo eclipse. Diretamente via startup.sh inicializa normal. Testei com duas versões 8.4.6 e 8.5.4.

Olá Mario,

Ao inicializar o tomcat pelo Eclipse aparece alguma Exception no campo de console?

Com o tomcat 8.0.46: dez 03, 2017 12:39:24 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:alura-shows' did not find a matching property. dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Server version: Apache Tomcat/8.0.46 dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Server built: Aug 10 2017 10:10:31 UTC dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Server number: 8.0.46.0 dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: OS Name: Linux dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: OS Version: 4.4.0-101-generic dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Architecture: amd64 dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Java Home: /usr/lib/jvm/java-8-oracle/jre dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: JVM Version: 1.8.0_151-b12 dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: JVM Vendor: Oracle Corporation dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: CATALINA_BASE: /media/mario/tempnew/Workspace-Eclipse/eclipse-jee-oxygen-1a-x86_64/.metadata/.plugins/org.eclipse.wst.server.core/tmp0 dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: CATALINA_HOME: /opt/apache-foundation/apache-tomcat-8.0.46 dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dcatalina.base=/media/mario/tempnew/Workspace-Eclipse/eclipse-jee-oxygen-1a-x86_64/.metadata/.plugins/org.eclipse.wst.server.core/tmp0

Continuação: dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dcatalina.home=/opt/apache-foundation/apache-tomcat-8.0.46 dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dwtp.deploy=/media/mario/tempnew/Workspace-Eclipse/eclipse-jee-oxygen-1a-x86_64/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Djava.endorsed.dirs=/opt/apache-foundation/apache-tomcat-8.0.46/endorsed dez 03, 2017 12:39:24 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dfile.encoding=UTF-8 dez 03, 2017 12:39:24 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: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib dez 03, 2017 12:39:24 PM org.apache.coyote.AbstractProtocol init INFORMAÇÕES: Initializing ProtocolHandler ["http-nio-8080"] dez 03, 2017 12:39:24 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector INFORMAÇÕES: Using a shared selector for servlet write/read dez 03, 2017 12:39:24 PM org.apache.coyote.AbstractProtocol init INFORMAÇÕES: Initializing ProtocolHandler ["ajp-nio-8009"] dez 03, 2017 12:39:24 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector INFORMAÇÕES: Using a shared selector for servlet write/read dez 03, 2017 12:39:24 PM org.apache.catalina.startup.Catalina load INFORMAÇÕES: Initialization processed in 1778 ms dez 03, 2017 12:39:24 PM org.apache.catalina.core.StandardService startInternal INFORMAÇÕES: Starting service Catalina dez 03, 2017 12:39:24 PM org.apache.catalina.core.StandardEngine startInternal INFORMAÇÕES: Starting Servlet Engine: Apache Tomcat/8.0.46 dez 03, 2017 12:39:41 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. dez 03, 2017 12:40:01 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. dez 03, 2017 12:40:01 PM org.apache.catalina.core.ApplicationContext log INFORMAÇÕES: 1 Spring WebApplicationInitializers detected on classpath dez 03, 2017 12:40:02 PM org.apache.catalina.core.ContainerBase startInternal

Continuação: GRAVE: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/alura-shows]] at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) at java.util.concurrent.FutureTask.run(FutureTask.java:266) 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) Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/alura-shows]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162) ... 6 more Caused by: java.lang.NoSuchMethodError: org.springframework.web.servlet.DispatcherServlet.(Lorg/springframework/web/context/WebApplicationContext;)V at org.springframework.web.servlet.support.AbstractDispatcherServletInitializer.createDispatcherServlet(AbstractDispatcherServletInitializer.java:142) at org.springframework.web.servlet.support.AbstractDispatcherServletInitializer.registerDispatcherServlet(AbstractDispatcherServletInitializer.java:94) at org.springframework.web.servlet.support.AbstractDispatcherServletInitializer.onStartup(AbstractDispatcherServletInitializer.java:71) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 6 more

dez 03, 2017 12:40:02 PM org.apache.catalina.core.ContainerBase startInternal

Cont.: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]] at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:789) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.startup.Catalina.start(Catalina.java:630) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485) Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) at java.util.concurrent.FutureTask.run(FutureTask.java:266) 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) Caused by: org.apache.catalina.LifecycleException: A child container failed during start at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 6 more

dez 03, 2017 12:40:02 PM org.apache.catalina.startup.Catalina start

Cont.: GRAVE: A child container failed during start

GRAVE: The required Server component failed to start so Tomcat is unable to start. org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162) at org.apache.catalina.startup.Catalina.start(Catalina.java:630) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485) Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:789) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 7 more Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 9 more Caused by: org.apache.catalina.LifecycleException: A child container failed during start at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 11 more

dez 03, 2017 12:40:02 PM org.apache.coyote.AbstractProtocol pause INFORMAÇÕES: Pausing ProtocolHandler ["http-nio-8080"] dez 03, 2017 12:40:02 PM org.apache.coyote.AbstractProtocol pause INFORMAÇÕES: Pausing ProtocolHandler ["ajp-nio-8009"] dez 03, 2017 12:40:02 PM org.apache.catalina.core.StandardService stopInternal INFORMAÇÕES: Stopping service Catalina dez 03, 2017 12:40:02 PM org.apache.coyote.AbstractProtocol destroy INFORMAÇÕES: Destroying ProtocolHandler ["http-nio-8080"] dez 03, 2017 12:40:02 PM org.apache.coyote.AbstractProtocol destroy GRAVE: Failed to destroy end point associated with ProtocolHandler ["http-nio-8080"] java.lang.NullPointerException at org.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:315) at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:491) at org.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:896) at org.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:551) at org.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292) at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:589) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292) at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:879) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292) at org.apache.catalina.startup.Catalina.start(Catalina.java:634) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

dez 03, 2017 12:40:02 PM org.apache.coyote.AbstractProtocol destroy INFORMAÇÕES: Destroying ProtocolHandler ["ajp-nio-8009"] dez 03, 2017 12:40:02 PM org.apache.coyote.AbstractProtocol destroy

Cont.: GRAVE: Failed to destroy end point associated with ProtocolHandler ["ajp-nio-8009"] java.lang.NullPointerException at org.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:315) at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:491) at org.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:896) at org.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:551) at org.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292) at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:589) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292) at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:879) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292) at org.apache.catalina.startup.Catalina.start(Catalina.java:634) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

dez 03, 2017 12:40:02 PM org.apache.catalina.core.ApplicationContext log INFORMAÇÕES: Closing Spring root WebApplicationContext

solução!

Olá Mario,

Vamos tentar o seguinte, vou pedir para você remover esse projeto e fazer o download novamente nesse link: https://s3.amazonaws.com/caelum-online-public/owasp-java/alura-shows.zip, seguindo os passos que estão nesse link: https://cursos.alura.com.br/course/seguranca-web-em-java-parte-1/task/31472

Feito isso, clique com o botão direito no Tomcat e posteriormente em clean, posteriormente arraste o projeto para o Tomcat. Na sequência, só confirme que não houve nenhuma Exception no console, no console deverá aparecer que quatro tabelas foram criadas (depoimento, usuario, usario_role, role). Depois tente ir no browser e colocar: localhost:8080/alura-shows

Agora o tomcat sobe, porém se tentar acessar localhost:8080/alura-shows HTTP Status 404 - /alura-shows type Status report message /alura-shows description The requested resource is not available. Apache Tomcat/8.0.46

Ou

localhost:8080 HTTP Status 404 - / type Status report message / description The requested resource is not available. Apache Tomcat/8.0.46

Se inicializar o tomcat via startup.sh acesso normalmente localhost:8080

Ao subir o Tomcat no Eclipse apareceu alguma Excpetion? Se você for no MySQL foi criado um banco chamdo owasp com as tabelas (depoimento, usuario, usuario_role e role)?

desconsiderar

desconsiderar

desconsiderar

desconsiderar

Olá Rafael, favor desconsiderar os últimos logs, não havia informado a senha de root do mysql. Ainda assim, banco owasp não foi criado. Console do tomcat:

dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Server version: Apache Tomcat/8.5.4 dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Server built: Jul 6 2016 08:43:30 UTC dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Server number: 8.5.4.0 dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: OS Name: Linux dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: OS Version: 4.4.0-101-generic dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Architecture: amd64 dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Java Home: /usr/lib/jvm/java-8-oracle/jre dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: JVM Version: 1.8.0_151-b12 dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: JVM Vendor: Oracle Corporation dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: CATALINA_BASE: /media/mario/tempnew/Workspace-Eclipse/eclipse-jee-oxygen-1a-x86_64/.metadata/.plugins/org.eclipse.wst.server.core/tmp1 dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: CATALINA_HOME: /opt/apache-foundation/apache-tomcat-8.5.4 dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dcatalina.base=/media/mario/tempnew/Workspace-Eclipse/eclipse-jee-oxygen-1a-x86_64/.metadata/.plugins/org.eclipse.wst.server.core/tmp1 dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dcatalina.home=/opt/apache-foundation/apache-tomcat-8.5.4 dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dwtp.deploy=/media/mario/tempnew/Workspace-Eclipse/eclipse-jee-oxygen-1a-x86_64/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Djava.endorsed.dirs=/opt/apache-foundation/apache-tomcat-8.5.4/endorsed dez 03, 2017 2:05:11 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dfile.encoding=UTF-8 dez 03, 2017 2:05:11 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: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

cont:

dez 03, 2017 2:05:11 PM org.apache.coyote.AbstractProtocol init INFORMAÇÕES: Initializing ProtocolHandler ["http-nio-8080"] dez 03, 2017 2:05:11 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector INFORMAÇÕES: Using a shared selector for servlet write/read dez 03, 2017 2:05:11 PM org.apache.coyote.AbstractProtocol init INFORMAÇÕES: Initializing ProtocolHandler ["ajp-nio-8009"] dez 03, 2017 2:05:11 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector INFORMAÇÕES: Using a shared selector for servlet write/read dez 03, 2017 2:05:11 PM org.apache.catalina.startup.Catalina load INFORMAÇÕES: Initialization processed in 760 ms dez 03, 2017 2:05:11 PM org.apache.catalina.core.StandardService startInternal INFORMAÇÕES: Starting service Catalina dez 03, 2017 2:05:11 PM org.apache.catalina.core.StandardEngine startInternal INFORMAÇÕES: Starting Servlet Engine: Apache Tomcat/8.5.4 dez 03, 2017 2:05:23 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. dez 03, 2017 2:05:23 PM org.apache.coyote.AbstractProtocol start INFORMAÇÕES: Starting ProtocolHandler [http-nio-8080] dez 03, 2017 2:05:23 PM org.apache.coyote.AbstractProtocol start INFORMAÇÕES: Starting ProtocolHandler [ajp-nio-8009] dez 03, 2017 2:05:23 PM org.apache.catalina.startup.Catalina start INFORMAÇÕES: Server startup in 11607 ms

Olá, Rafael exportei para .war e fiz o deploy diretamente em "webapps". A aplicação subiu. Vou testar se está com as funcionalidades ok. Depois te falo. Obrigado pela ajuda.

Olá Rafael, tudo ok. Obrigado.

Oi Mário,

Legal, obrigado pelo retorno, qualquer dúvida, estamos à disposição.

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