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

404

Tento rodar a página xhtml e recebo um 404 do servidor. Segue a log do JBoss AS

20:56:36,696 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA
20:56:39,039 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
20:56:39,217 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
20:56:46,773 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
20:56:46,884 INFO  [org.xnio] XNIO Version 3.0.3.GA
20:56:47,066 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
20:56:47,129 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
20:56:47,160 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
20:56:47,273 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
20:56:47,501 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
20:56:47,697 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
20:56:47,706 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
20:56:50,534 INFO  [org.jboss.as.security] (MSC service thread 1-2) JBAS013100: Current PicketBox version=4.0.7.Final
20:56:51,247 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
20:56:51,615 INFO  [org.jboss.as.connector] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
20:56:51,928 INFO  [org.jboss.as.naming] (MSC service thread 1-2) JBAS011802: Starting Naming Service
20:56:53,994 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-2) JBAS015400: Bound mail session [java:jboss/mail/Default]
20:56:56,416 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Starting Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080
20:56:56,857 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-1) JBoss Web Services - Stack CXF Server 4.0.2.GA
20:56:58,789 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) JBAS015012: Started FileSystemDeploymentService for directory C:\eclipse\jboss-as-7\standalone\deployments
20:56:58,853 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found livraria.war in deployment directory. To trigger deployment create a file called livraria.war.dodeploy
20:56:59,250 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) JBAS017100: Listening on localhost/127.0.0.1:9999
20:56:59,253 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) JBAS017100: Listening on localhost/127.0.0.1:4447
20:56:59,307 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
20:57:00,309 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "livraria.war"
20:57:08,434 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016002: Processing weld deployment livraria.war
20:57:09,746 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016005: Starting Services for CDI deployment: livraria.war
20:57:09,879 INFO  [org.jboss.weld.Version] (MSC service thread 1-2) WELD-000900 1.1.5 (AS71)
20:57:10,092 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016008: Starting weld service for deployment livraria.war
20:57:11,381 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Inicializando Mojarra 2.1.7-jbossorg-1 (20120227-1401) para o contexto '/livraria'
20:57:14,007 GRAVE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Critical error during deployment: : com.sun.faces.config.ConfigurationException: 
  Source Document: jndi:/default-host/livraria/WEB-INF/faces-config.xml
  Cause: Unable to find class 'br.com.caelum.livraria.login.Autorizador'
    at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:273) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.processor.LifecycleConfigProcessor.addPhaseListeners(LifecycleConfigProcessor.java:132) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:111) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_45]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_45]
Caused by: java.lang.ClassNotFoundException: br.com.caelum.livraria.login.Autorizador from [Module "deployment.livraria.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
    at com.sun.faces.util.Util.loadClass(Util.java:345) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:311) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:240) [jsf-impl-2.1.7-jbossorg-2.jar:]
    ... 14 more

20:57:14,036 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/livraria]] (MSC service thread 1-1) Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: 
  Source Document: jndi:/default-host/livraria/WEB-INF/faces-config.xml
  Cause: Unable to find class 'br.com.caelum.livraria.login.Autorizador'
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_45]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_45]
Caused by: com.sun.faces.config.ConfigurationException: 
  Source Document: jndi:/default-host/livraria/WEB-INF/faces-config.xml
  Cause: Unable to find class 'br.com.caelum.livraria.login.Autorizador'
    at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:273) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.processor.LifecycleConfigProcessor.addPhaseListeners(LifecycleConfigProcessor.java:132) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:111) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:]
    ... 8 more
Caused by: java.lang.ClassNotFoundException: br.com.caelum.livraria.login.Autorizador from [Module "deployment.livraria.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
    at com.sun.faces.util.Util.loadClass(Util.java:345) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:311) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:240) [jsf-impl-2.1.7-jbossorg-2.jar:]
    ... 14 more

20:57:14,070 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Error listenerStart
20:57:14,071 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Context [/livraria] startup failed due to previous errors
20:57:14,075 GRAVE [javax.faces] (MSC service thread 1-1) O aplicativo não foi iniciado corretamente na inicialização. Não foi possível encontrar Fábrica: javax.faces.application.ApplicationFactory. Attempting to find backup.
20:57:14,077 GRAVE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. 
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1008) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:131) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:328) [jsf-impl-2.1.7-jbossorg-2.jar:]
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3489) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3999) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3917) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_45]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_45]

20:57:14,105 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.web.deployment.default-host./livraria: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./livraria: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_45]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_45]

20:57:14,130 INFO  [org.jboss.as] (MSC service thread 1-1) JBAS015951: Admin console listening on http://127.0.0.1:9990
20:57:14,131 ERROR [org.jboss.as] (MSC service thread 1-1) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 41855ms - Started 188 of 267 services (2 services failed or missing dependencies, 76 services are passive or on-demand)
20:57:14,390 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016009: Stopping weld service for deployment livraria.war
20:57:14,405 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment livraria.war in 33ms
20:57:14,409 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "livraria.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./livraria" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./livraria: JBAS018040: Failed to start context"}}
20:57:14,411 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.web.deployment.default-host./livraria: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./livraria: JBAS018040: Failed to start context

20:57:14,413 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./livraria" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./livraria: JBAS018040: Failed to start context"}}}}
4 respostas
solução!

Robson, posta sua classe Autorizador.java pra gente dar uma olhada, pois o JBoss não tá encontrando essa classe...

Acho que descobri. Bom, pelo menos funcionou. O JBoss AS não aceitou o Java 8 como JRE. Fiz o downgrade para o Java 7 e levantou o bicho. Além disso, o sistema Livraria estava com Java 7 e o JBoss com Java 8. Coloquei ambos sobre Java 7. Acho que isso tem problema, não? Poderia me explicar melhor? O JBoss AS não roda sobre Java 8?

Pro JBoss, acho que não faz muita diferença entre o java 7 ou 8, desde que o jboss seja recente (8 pra cá). Uso o 10 e não tenho problemas, mas com o 9 também era tranquilo.

Na verdade, você pode mudar a versão do java no projeto.

No eclipse: Botão direito no projeto -> propriedades -> Java Compile (lado esquerdo) -> Enable project specific settings (lado direito). Daí você muda o "Compiler compliance settings" pra 1.8. Isso deve fazer seu projeto compilar direitinho com o java mais atual.

Muito obrigado, por esta ajuda pois foi graças a ela que consegui resolver meu problema, estava tendo o mesmo 404 e tive que setar pra java 8 eai finalmente funcionou ! Abraços