2
respostas

Error ao usar ao usar o datasource no wildfly-10

15:46:47,501 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit."livraria.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."livraria.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "livraria.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0041: Component class br.com.caelum.livraria.dao.AutorDao for component AutorDao has errors: 
WFLYJPA0021: Cannot inject RESOURCE_LOCAL container managed EntityManagers using @PersistenceContext
    at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor$1.handle(ModuleJndiBindingProcessor.java:157)
    at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:54)
    at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.processClassConfigurations(ModuleJndiBindingProcessor.java:186)
    at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:143)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
    ... 5 more

15:46:47,516 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "livraria.war")]) - failure description: {
    "WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"livraria.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"livraria.war\".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment \"livraria.war\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0041: Component class br.com.caelum.livraria.dao.AutorDao for component AutorDao has errors: 
WFLYJPA0021: Cannot inject RESOURCE_LOCAL container managed EntityManagers using @PersistenceContext"},
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "jboss.deployment.unit.\"livraria.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"livraria.war\".beanmanager]",
        "jboss.deployment.unit.\"livraria.war\".batch.environment is missing [jboss.deployment.unit.\"livraria.war\".beanmanager]"
    ]
}
15:46:47,568 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "livraria.war" (runtime-name : "livraria.war")
15:46:47,577 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.deployment.unit."livraria.war".beanmanager (missing) dependents: [service jboss.deployment.unit."livraria.war".batch.environment, service jboss.deployment.unit."livraria.war".weld.weldClassIntrospector] 
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."livraria.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."livraria.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "livraria.war"

15:46:47,798 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
15:46:47,799 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
15:46:47,800 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started (with errors) in 9760ms - Started 304 of 593 services (3 services failed or missing dependencies, 374 services are lazy, passive or on-demand)
15:46:47,851 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 58) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'livraria.war#livraria'
15:46:47,868 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0028: Stopped deployment livraria.war (runtime-name: livraria.war) in 24ms
15:46:47,933 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0009: Undeployed "livraria.war" (runtime-name: "livraria.war")
15:46:47,934 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."livraria.war".INSTALL
2 respostas

opa, o meu chute é que seu persistence.xml não está configurado para usar o modo transactional do container. pode colocar ele aqui?

<?xml version="1.0" encoding="UTF-8"?>

org.hibernate.jpa.HibernatePersistenceProvider java:/livrariaDS br.com.caelum.livraria.modelo.Usuario br.com.caelum.livraria.modelo.Livro br.com.caelum.livraria.modelo.Autor