Boa noite pessoal, estou tendo problemas ao criar conexão com meu banco, já defini o datasource e apontei no meu persistence.xml, mas quando vou debugar percebo que meu EntityManager fica nulo, não encontrei a solução desde já agradeço.
Você está vendo a versão anterior da nova experiência da Alura que estamos preparando para você. Em breve, ela ganha uma identidade visual novinha totalmente pensada em potencializar seus estudos!
Boa noite pessoal, estou tendo problemas ao criar conexão com meu banco, já defini o datasource e apontei no meu persistence.xml, mas quando vou debugar percebo que meu EntityManager fica nulo, não encontrei a solução desde já agradeço.
Oi Roger,
na hora de subir o servidor aparece algum problema? O JBoss/Wildfly mostra a datasource cadastrado no JNDI?
Coloque aqui tbm o seu código para podermos avaliar melhor.
abs
Segue abaixo o log do Wildfly, quando tento subir o projeto...
Log Wildfly
2016-04-27 22:26:21 JRebel:
2016-04-27 22:26:21 JRebel: A newer version '6.4.3' is available for download
2016-04-27 22:26:21 JRebel: from http://zeroturnaround.com/software/jrebel/download/
2016-04-27 22:26:21 JRebel:
2016-04-27 22:26:22 JRebel: Contacting myJRebel server ..
22:26:25,785 INFO [org.jboss.modules] (main) JBoss Modules version 1.5.0.Final
2016-04-27 22:26:27 JRebel:
2016-04-27 22:26:27 JRebel: #############################################################
2016-04-27 22:26:27 JRebel:
2016-04-27 22:26:27 JRebel: JRebel Legacy Agent 6.4.2a (201604061405)
2016-04-27 22:26:27 JRebel: (c) Copyright ZeroTurnaround AS, Estonia, Tartu.
2016-04-27 22:26:27 JRebel:
2016-04-27 22:26:27 JRebel: Over the last 1 days JRebel prevented
2016-04-27 22:26:27 JRebel: at least 0 redeploys/restarts saving you about 0 hours.
2016-04-27 22:26:27 JRebel:
2016-04-27 22:26:27 JRebel: Licensed to Roger Willian (using myJRebel).
2016-04-27 22:26:27 JRebel:
2016-04-27 22:26:27 JRebel:
2016-04-27 22:26:27 JRebel: #############################################################
2016-04-27 22:26:27 JRebel:
22:26:54,896 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
22:26:57,478 INFO [org.jboss.as] (MSC service thread 1-7) WFLYSRV0049: WildFly Full 10.0.0.CR5 (WildFly Core 2.0.5.Final) starting
22:27:40,264 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found livraria.war in deployment directory. To trigger deployment create a file called livraria.war.dodeploy
22:27:40,405 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
22:27:40,819 INFO [org.xnio] (MSC service thread 1-8) XNIO version 3.3.4.Final
22:27:40,952 INFO [org.xnio.nio] (MSC service thread 1-8) XNIO NIO Implementation Version 3.3.4.Final
22:27:41,411 WARN [org.jboss.as.txn] (ServerService Thread Pool -- 79) WFLYTX0013: Node identifier property is set to the default value. Please make sure it is unique.
22:27:41,468 INFO [org.wildfly.extension.io] (ServerService Thread Pool -- 62) WFLYIO001: Worker 'default' has auto-configured to 8 core threads with 64 task threads based on your 4 available processors
22:27:41,527 INFO [org.jboss.as.security] (ServerService Thread Pool -- 78) WFLYSEC0002: Activating Security Subsystem
22:27:41,553 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 69) WFLYJSF0007: Activated the following JSF Implementations: [main]
22:27:41,698 INFO [org.jboss.as.security] (MSC service thread 1-1) WFLYSEC0001: Current PicketBox version=4.9.4.Final
22:27:41,781 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 81) WFLYWS0002: Activating WebServices Extension
22:27:41,823 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 63) WFLYCLINF0001: Activating Infinispan subsystem.
22:27:41,824 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 71) WFLYNAM0001: Activating Naming Subsystem
22:27:42,090 INFO [org.jboss.as.connector] (MSC service thread 1-6) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.3.1.Final)
22:27:44,041 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 58) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
22:27:44,066 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = h2
22:27:44,437 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 58) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
22:27:44,440 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0018: Started Driver service with driver-name = mysql
22:27:44,824 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0003: Undertow 1.3.11.Final starting
22:27:44,824 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 80) WFLYUT0003: Undertow 1.3.11.Final starting
22:27:45,589 INFO [org.jboss.remoting] (MSC service thread 1-8) JBoss Remoting version 4.0.17.Final-wildfly-1
22:27:48,238 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 80) WFLYUT0014: Creating file handler for path 'D:\Desenvolvimento\WidFly\wildfly-10.0.0.CR5/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
22:27:48,813 INFO [org.jboss.as.ejb3] (MSC service thread 1-7) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 16 (per class), which is derived from the number of CPUs on this host.
22:27:48,884 INFO [org.jboss.as.ejb3] (MSC service thread 1-3) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 64 (per class), which is derived from thread worker pool sizing.
22:27:48,899 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0012: Started server default-server.
22:27:48,902 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0018: Host default-host starting
22:27:50,381 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8081
22:27:50,467 INFO [org.jboss.as.mail.extension] (MSC service thread 1-1) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
22:27:50,464 INFO [org.jboss.as.naming] (MSC service thread 1-2) WFLYNAM0003: Starting Naming Service
22:27:55,357 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) WFLYDS0013: Started FileSystemDeploymentService for directory D:\Desenvolvimento\WidFly\wildfly-10.0.0.CR5\standalone\deployments
22:27:56,002 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
22:27:56,003 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:/livrariaDS]
22:27:57,401 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0027: Starting deployment of "livraria.war" (runtime-name: "livraria.war")
22:28:00,720 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-1) ISPN000128: Infinispan version: Infinispan 'Mahou' 8.1.0.Final
22:28:02,967 INFO [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBossWS 5.1.2.Final (Apache CXF 3.1.4)
22:28:07,115 INFO [org.jboss.as.jpa] (MSC service thread 1-7) WFLYJPA0002: Read persistence.xml for livraria
22:28:10,226 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 86) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'livraria.war#livraria'
22:28:10,334 INFO [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 86) HHH000204: Processing PersistenceUnitInfo [
name: livraria
...]
22:28:12,762 INFO [org.hibernate.Version] (ServerService Thread Pool -- 86) HHH000412: Hibernate Core {5.0.6.Final}
22:28:12,765 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 86) HHH000206: hibernate.properties not found
22:28:12,768 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 86) HHH000021: Bytecode provider name : javassist
22:28:13,024 INFO [org.hibernate.orm.deprecation] (ServerService Thread Pool -- 86) HHH90000001: Found usage of deprecated setting for specifying Scanner [hibernate.ejb.resource_scanner]; use [hibernate.archive.scanner] instead
22:28:13,060 INFO [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 86) HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
22:28:15,129 INFO [org.jboss.weld.deployer] (MSC service thread 1-5) WFLYWELD0003: Processing weld deployment livraria.war
22:28:17,467 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-5) HV000001: Hibernate Validator 5.2.2.Final
22:28:18,233 INFO [org.jboss.as.ejb3.deployment] (MSC service thread 1-5) WFLYEJB0473: JNDI bindings for session bean named 'LivroDao' in deployment unit 'deployment "livraria.war"' are as follows:
java:global/livraria/LivroDao!br.com.caelum.livraria.dao.LivroDao
java:app/livraria/LivroDao!br.com.caelum.livraria.dao.LivroDao
java:module/LivroDao!br.com.caelum.livraria.dao.LivroDao
java:global/livraria/LivroDao
java:app/livraria/LivroDao
java:module/LivroDao
22:28:18,234 INFO [org.jboss.as.ejb3.deployment] (MSC service thread 1-5) WFLYEJB0473: JNDI bindings for session bean named 'AutorDao' in deployment unit 'deployment "livraria.war"' are as follows:
java:global/livraria/AutorDao!br.com.caelum.livraria.dao.AutorDao
java:app/livraria/AutorDao!br.com.caelum.livraria.dao.AutorDao
java:module/AutorDao!br.com.caelum.livraria.dao.AutorDao
java:global/livraria/AutorDao
java:app/livraria/AutorDao
java:module/AutorDao
22:28:18,239 INFO [org.jboss.as.ejb3.deployment] (MSC service thread 1-5) WFLYEJB0473: JNDI bindings for session bean named 'UsuarioDao' in deployment unit 'deployment "livraria.war"' are as follows:
java:global/livraria/UsuarioDao!br.com.caelum.livraria.dao.UsuarioDao
java:app/livraria/UsuarioDao!br.com.caelum.livraria.dao.UsuarioDao
java:module/UsuarioDao!br.com.caelum.livraria.dao.UsuarioDao
java:global/livraria/UsuarioDao
java:app/livraria/UsuarioDao
java:module/UsuarioDao
22:28:25,403 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 86) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
22:28:25,406 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 86) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
22:28:25,408 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 86) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
22:28:25,410 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 86) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
22:28:28,115 INFO [org.jboss.weld.deployer] (MSC service thread 1-5) WFLYWELD0006: Starting Services for CDI deployment: livraria.war
22:28:33,220 INFO [org.jboss.weld.Version] (MSC service thread 1-5) WELD-000900: 2.3.2 (Final)
22:28:35,392 INFO [org.jboss.weld.deployer] (MSC service thread 1-8) WFLYWELD0009: Starting weld service for deployment livraria.war
22:28:40,366 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 86) WFLYCLINF0002: Started client-mappings cache from ejb container
22:28:40,665 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 87) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'livraria.war#livraria'
22:28:41,218 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 87) HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
22:28:41,504 INFO [org.hibernate.envers.boot.internal.EnversServiceImpl] (ServerService Thread Pool -- 87) Envers integration enabled? : true
22:28:42,795 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 87) MSC000001: Failed to start service jboss.persistenceunit."livraria.war#livraria": org.jboss.msc.service.StartException in service jboss.persistenceunit."livraria.war#livraria": java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182)
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)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97)
at org.hibernate.internal.util.xml.XMLHelper$1.doWork(XMLHelper.java:33)
at org.hibernate.internal.util.xml.XMLHelper$1.doWork(XMLHelper.java:27)
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.workWithClassLoader(ClassLoaderServiceImpl.java:342)
at org.hibernate.internal.util.xml.XMLHelper.<init>(XMLHelper.java:26)
at org.hibernate.envers.boot.internal.EnversServiceImpl.initialize(EnversServiceImpl.java:115)
at org.hibernate.envers.boot.internal.AdditionalJaxbMappingProducerImpl.produceAdditionalMappings(AdditionalJaxbMappingProducerImpl.java:99)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:288)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:847)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:874)
at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.__build(TwoPhaseBootstrapImpl.java:44)
at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154)
... 7 more
22:28:42,805 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "livraria.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"livraria.war#livraria\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"livraria.war#livraria\": java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory"}}
22:28:43,330 INFO [org.jboss.as.server] (ServerService Thread Pool -- 59) WFLYSRV0010: Deployed "livraria.war" (runtime-name : "livraria.war")
22:28:43,332 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.persistenceunit."livraria.war#livraria": org.jboss.msc.service.StartException in service jboss.persistenceunit."livraria.war#livraria": java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
22:28:43,897 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9991/management
22:28:43,898 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9991
22:28:43,898 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.0.0.CR5 (WildFly Core 2.0.5.Final) started (with errors) in 140896ms - Started 421 of 739 services (33 services failed or missing dependencies, 398 services are lazy, passive or on-demand)
22:28:44,136 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 32) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'livraria.war#livraria'
22:28:44,161 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 28) WFLYCLINF0003: Stopped client-mappings cache from ejb container
22:28:44,203 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0028: Stopped deployment livraria.war (runtime-name: livraria.war) in 191ms
22:28:44,529 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0009: Undeployed "livraria.war" (runtime-name: "livraria.war")
22:28:44,536 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.deployment.unit."livraria.war".WeldBootstrapService (missing) dependents: [service jboss.deployment.unit."livraria.war".component.UsuarioDao.WeldInstantiator, service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldInitialListener".WeldInstantiator, service jboss.deployment.unit."livraria.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".WeldInstantiator, service jboss.deployment.unit."livraria.war".component.UsuarioDao.WeldInterceptorBindingsService, WFLYCTL0208: ... and 11 more ]
service jboss.deployment.unit."livraria.war".WeldStartService (missing) dependents: [service jboss.deployment.unit."livraria.war".component.UsuarioDao.WeldInstantiator, service jboss.deployment.unit."livraria.war".component."javax.faces.webapp.FacetTag".WeldInstantiator, service jboss.deployment.unit."livraria.war".CdiValidatorFactoryService, service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldInitialListener".WeldInstantiator, WFLYCTL0208: ... and 9 more ]
service jboss.deployment.unit."livraria.war".component.AutorDao.CREATE (missing) dependents: [service jboss.deployment.unit."livraria.war".component.AutorDao.START]
service jboss.deployment.unit."livraria.war".component.AutorDao.VIEW."br.com.caelum.livraria.dao.AutorDao".LOCAL (missing) dependents: [service jboss.deployment.unit."livraria.war".component.AutorDao.START]
service jboss.deployment.unit."livraria.war".component.AutorDao.WeldInstantiator (missing) dependents: [service jboss.deployment.unit."livraria.war".component.AutorDao.START]
service jboss.deployment.unit."livraria.war".component.AutorDao.WeldInterceptorBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".component.AutorDao.WeldInstantiator]
service jboss.deployment.unit."livraria.war".component.AutorDao.ejb3.timerService (missing) dependents: [service jboss.deployment.unit."livraria.war".component.AutorDao.START]
service jboss.deployment.unit."livraria.war".component.LivroDao.START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./livraria, service jboss.deployment.unit."livraria.war".deploymentCompleteService, service jboss.deployment.unit."livraria.war".moduleDeploymentRuntimeInformationStart]
service jboss.deployment.unit."livraria.war".component.LivroDao.WeldInstantiator (missing) dependents: [service jboss.deployment.unit."livraria.war".component.LivroDao.START]
service jboss.deployment.unit."livraria.war".component.LivroDao.WeldInterceptorBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".component.LivroDao.WeldInstantiator]
service jboss.deployment.unit."livraria.war".component.UsuarioDao.CREATE (missing) dependents: [service jboss.deployment.unit."livraria.war".component.UsuarioDao.START]
service jboss.deployment.unit."livraria.war".component.UsuarioDao.START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./livraria, service jboss.deployment.unit."livraria.war".deploymentCompleteService, service jboss.deployment.unit."livraria.war".moduleDeploymentRuntimeInformationStart]
service jboss.deployment.unit."livraria.war".component.UsuarioDao.VIEW."br.com.caelum.livraria.dao.UsuarioDao".LOCAL (missing) dependents: [service jboss.deployment.unit."livraria.war".component.UsuarioDao.START]
service jboss.deployment.unit."livraria.war".component.UsuarioDao.WeldInstantiator (missing) dependents: [service jboss.deployment.unit."livraria.war".component.UsuarioDao.START]
service jboss.deployment.unit."livraria.war".component.UsuarioDao.WeldInterceptorBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".component.UsuarioDao.WeldInstantiator]
service jboss.deployment.unit."livraria.war".component.UsuarioDao.ejb3.timerService (missing) dependents: [service jboss.deployment.unit."livraria.war".component.UsuarioDao.START]
service jboss.deployment.unit."livraria.war".component."com.sun.faces.config.ConfigureListener".CREATE (missing) dependents: [service jboss.deployment.unit."livraria.war".component."com.sun.faces.config.ConfigureListener".START]
service jboss.deployment.unit."livraria.war".component."com.sun.faces.config.ConfigureListener".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./livraria, service jboss.deployment.unit."livraria.war".deploymentCompleteService]
service jboss.deployment.unit."livraria.war".component."com.sun.faces.config.ConfigureListener".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."livraria.war".component."com.sun.faces.config.ConfigureListener".START]
service jboss.deployment.unit."livraria.war".component."javax.faces.webapp.FacesServlet".CREATE (missing) dependents: [service jboss.deployment.unit."livraria.war".component."javax.faces.webapp.FacesServlet".START]
service jboss.deployment.unit."livraria.war".component."javax.faces.webapp.FacesServlet".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./livraria, service jboss.deployment.unit."livraria.war".deploymentCompleteService]
service jboss.deployment.unit."livraria.war".component."javax.faces.webapp.FacesServlet".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."livraria.war".component."javax.faces.webapp.FacesServlet".START]
service jboss.deployment.unit."livraria.war".component."javax.faces.webapp.FacetTag".CREATE (missing) dependents: [service jboss.deployment.unit."livraria.war".component."javax.faces.webapp.FacetTag".START]
service jboss.deployment.unit."livraria.war".component."javax.faces.webapp.FacetTag".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./livraria, service jboss.deployment.unit."livraria.war".deploymentCompleteService]
service jboss.deployment.unit."livraria.war".component."javax.faces.webapp.FacetTag".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."livraria.war".component."javax.faces.webapp.FacetTag".START]
service jboss.deployment.unit."livraria.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".CREATE (missing) dependents: [service jboss.deployment.unit."livraria.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START]
service jboss.deployment.unit."livraria.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./livraria, service jboss.deployment.unit."livraria.war".deploymentCompleteService]
service jboss.deployment.unit."livraria.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."livraria.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START]
service jboss.deployment.unit."livraria.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".CREATE (missing) dependents: [service jboss.deployment.unit."livraria.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START]
service jboss.deployment.unit."livraria.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./livraria, service jboss.deployment.unit."livraria.war".deploymentCompleteService]
service jboss.deployment.unit."livraria.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."livraria.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START]
service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldInitialListener".CREATE (missing) dependents: [service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldInitialListener".START]
service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldInitialListener".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./livraria, service jboss.deployment.unit."livraria.war".deploymentCompleteService]
service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldInitialListener".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldInitialListener".START]
service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldTerminalListener".CREATE (missing) dependents: [service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldTerminalListener".START]
service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldTerminalListener".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./livraria, service jboss.deployment.unit."livraria.war".deploymentCompleteService]
service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldTerminalListener".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldTerminalListener".START]
service jboss.deployment.unit."livraria.war".ee.ComponentRegistry (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService]
service jboss.deployment.unit."livraria.war".jndiDependencyService (missing) dependents: [service jboss.deployment.unit."livraria.war".component.AutorDao.START]
service jboss.deployment.unit."livraria.war".moduleDeploymentRuntimeInformation (missing) dependents: [service jboss.deployment.unit."livraria.war".component.AutorDao.START, service jboss.deployment.unit."livraria.war".component.UsuarioDao.START, service jboss.deployment.unit."livraria.war".moduleDeploymentRuntimeInformationStart]
service jboss.naming.context.java.module.livraria.livraria.env."br.com.caelum.livraria.dao.AutorDao".banco (missing) dependents: [service jboss.deployment.unit."livraria.war".component.AutorDao.START]
service jboss.naming.context.java.module.livraria.livraria.env."br.com.caelum.livraria.dao.UsuarioDao".banco (missing) dependents: [service jboss.deployment.unit."livraria.war".component.UsuarioDao.START]
service jboss.persistenceunit."livraria.war#livraria" (missing) dependents: [service jboss.deployment.unit."livraria.war".component."com.sun.faces.config.ConfigureListener".START, service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService, service jboss.deployment.unit."livraria.war".component.AutorDao.START, service jboss.deployment.unit."livraria.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START, WFLYCTL0208: ... and 11 more ]
service jboss.undertow.deployment.default-server.default-host./livraria (missing) dependents: [service jboss.deployment.unit."livraria.war".deploymentCompleteService]
service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria]
service jboss.undertow.deployment.default-server.default-host./livraria.codec (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService]
service jboss.undertow.deployment.default-server.default-host./livraria.session (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService]
service org.wildfly.request-controller.control-point."livraria.war".undertow (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService]
WFLYCTL0186: Services which failed to start: service jboss.persistenceunit."livraria.war#livraria"
22:28:48,496 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found livraria.war in deployment directory. To trigger deployment create a file called livraria.war.dodeploypersistence.xml
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="livraria">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/livrariaDS</jta-data-source>
<class>br.com.caelum.livraria.modelo.Autor</class>
<class>br.com.caelum.livraria.modelo.Livro</class>
<class>br.com.caelum.livraria.modelo.Usuario</class>
<properties>
<!-- Configuracoes especificas do Hibernate -->
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
</persistence>AutorDAO.java
package br.com.caelum.livraria.dao;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import br.com.caelum.livraria.modelo.Autor;
@Stateless
public class AutorDao {
@PersistenceContext
private EntityManager banco;
public void salva(Autor autor) {
banco.persist(autor);
}
public List<Autor> todosAutores() {
return banco.createQuery("from Autor",Autor.class).getResultList();
}
public Autor buscaPelaId(Integer autorId) {
Autor autor =
this.banco.find(Autor.class,autorId);
return autor;
}
}Realmente não estou conseguindo subir por nada pessoal,desde já agradeço.
Oi Roger,
vc está com alguns JARs do Hibernate ou outro framework que vem o Wildfly no classpath?
Pergunto pois vc está recebendo uma ClassCastException:
Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
abs
Se vc estiver usando a versão 5 do Hibernate, troque o seu provedor de acesso dentro do persistence.xml:
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
resolvi meu problema indo na pasta .m2 e apagando a pasta dom4j, depois limpando o projeto com maven clean e o wildifly com clean