0

Quando tento iniciar o TomCat 7 no meu projeto chamado ribeiraoreefshop, dispara o erro de start o principal seria o seguinte:

Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ribeiraoreefshop]

Abaixo o console de erro de start do TomCat que dispara.

mai 21, 2018 6:26:41 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:ribeiraoreefshop' did not find a matching property. mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Server version: Apache Tomcat/7.0.85 mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Server built: Feb 7 2018 18:52:33 UTC mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Server number: 7.0.85.0 mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: OS Name: Windows 8.1 mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: OS Version: 6.3 mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Architecture: amd64 mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Java Home: C:\Program Files\Java\jre1.8.0_172 mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: JVM Version: 1.8.0_172-b11 mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: JVM Vendor: Oracle Corporation mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: CATALINA_BASE: C:\Users\Tiago\workspaceTiago.metadata.plugins\org.eclipse.wst.server.core\tmp0 mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 7.0 mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dcatalina.base=C:\Users\Tiago\workspaceTiago.metadata.plugins\org.eclipse.wst.server.core\tmp0 mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 7.0 mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dwtp.deploy=C:\Users\Tiago\workspaceTiago.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 7.0\endorsed mai 21, 2018 6:26:42 PM org.apache.catalina.startup.VersionLoggerListener log INFORMAÇÕES: Command line argument: -Dfile.encoding=Cp1252 mai 21, 2018 6:26:42 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_172\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_172/bin/server;C:/Program Files/Java/jre1.8.0_172/bin;C:/Program Files/Java/jre1.8.0_172/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 (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Java\jdk1.8.0_152\bin;C:\Program Files\Git\cmd;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Users\Tiago\AppData\Local\GitHubDesktop\bin;C:\Users\Tiago\Desktop\eclipse;;. mai 21, 2018 6:26:45 PM org.apache.coyote.AbstractProtocol init INFORMAÇÕES: Initializing ProtocolHandler ["http-bio-8080"] mai 21, 2018 6:26:46 PM org.apache.coyote.AbstractProtocol init INFORMAÇÕES: Initializing ProtocolHandler ["ajp-bio-8009"] mai 21, 2018 6:26:46 PM org.apache.catalina.startup.Catalina load INFORMAÇÕES: Initialization processed in 6246 ms mai 21, 2018 6:26:46 PM org.apache.catalina.core.StandardService startInternal INFORMAÇÕES: Starting service Catalina mai 21, 2018 6:26:46 PM org.apache.catalina.core.StandardEngine startInternal INFORMAÇÕES: Starting Servlet Engine: Apache Tomcat/7.0.85 mai 21, 2018 6:26:50 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom ADVERTÊNCIA: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [2,961] milliseconds. mai 21, 2018 6:26:54 PM org.apache.catalina.loader.WebappClassLoaderBase validateJarFile INFORMAÇÕES: validateJarFile(C:\Users\Tiago\workspaceTiago.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ribeiraoreefshop\WEB-INF\lib\jboss-el-api_3.0_spec-1.0.0.Alpha1.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/el/Expression.class mai 21, 2018 6:27:05 PM org.apache.catalina.core.ContainerBase startInternal GRAVE: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ribeiraoreefshop]] at java.util.concurrent.FutureTask.report(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown Source) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1239) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:819) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1700) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1690) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ribeiraoreefshop]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162) ... 6 more Caused by: java.lang.NoClassDefFoundError: org/jboss/weld/util/Consumer at java.lang.Class.getDeclaredFields0(Native Method) at java.lang.Class.privateGetDeclaredFields(Unknown Source) at java.lang.Class.getDeclaredFields(Unknown Source) at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106) at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:267) at org.apache.catalina.startup.WebAnnotationSet.loadApplicationListenerAnnotations(WebAnnotationSet.java:87) at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65) at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:417) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:890) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5527) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 6 more Caused by: java.lang.ClassNotFoundException: org.jboss.weld.util.Consumer at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1907) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1750) ... 20 more

mai 21, 2018 6:27:05 PM org.apache.catalina.core.ContainerBase startInternal GRAVE: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]] at java.util.concurrent.FutureTask.report(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown Source) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1239) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:444) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:758) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.startup.Catalina.start(Catalina.java:705) 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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428) 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:1700) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1690) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.catalina.LifecycleException: A child container failed during start at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1247) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:819) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 6 more

mai 21, 2018 6:27:05 PM org.apache.catalina.startup.Catalina 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:705) 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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428) 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:758) 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:444) 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:1247) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:300) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 11 more

mai 21, 2018 6:27:05 PM org.apache.coyote.AbstractProtocol pause INFORMAÇÕES: Pausing ProtocolHandler ["http-bio-8080"] mai 21, 2018 6:27:05 PM org.apache.coyote.AbstractProtocol pause INFORMAÇÕES: Pausing ProtocolHandler ["ajp-bio-8009"] mai 21, 2018 6:27:05 PM org.apache.catalina.core.StandardService stopInternal INFORMAÇÕES: Stopping service Catalina mai 21, 2018 6:27:05 PM org.apache.coyote.AbstractProtocol destroy INFORMAÇÕES: Destroying ProtocolHandler ["http-bio-8080"] mai 21, 2018 6:27:05 PM org.apache.coyote.AbstractProtocol destroy INFORMAÇÕES: Destroying ProtocolHandler ["ajp-bio-8009"]

Já tentei as soluções implementadas na internet e nenhuma funcionou. O que pode estar ocorrendo?

1 Resposta 1

0

A solução encontrada foi: 1º - Criar a classe JPAUtil para criar a EntityManager

@ApplicationScoped
public class JPAUtil {

      private EntityManagerFactory entityManagerFactory = Persistence
        .createEntityManagerFactory("postgreSQL");


      public JPAUtil() {

      }

      @Produces
      @RequestScoped
      public EntityManager getEntityManager() {
          return entityManagerFactory.createEntityManager();
      }

      public void close(@Disposes EntityManager em) {
          em.close();
      }

}

2º - Mapear a classe JPAUtil.java no beans.xml na seguinte forma no atributo bean-discovery-mode:

<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
                        http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
version="1.1" bean-discovery-mode="all">

Porém a anotação @ApplicationScoped já faz esse mapeamento.

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .