2
respostas

Dúvida DataSource

Porquê se apagar o DataSource padrão (ExampleDS) no standalone.xml, e usar apenas o que esta configurado no persistence.xml (livrariaDS), a aplicação não funciona?

2 respostas

O que acontece? Esse outro realmente é apenas um que já vem configurado para agilizar a vida.

Sim! mas estranhamente quando utilizo o DataSource assim:

 <datasources>
                <datasource jndi-name="java:/livrariaDS" pool-name="livrariaDS" enabled="true" use-java-context="true">
                    <connection-url>jdbc:mysql://localhost:3306/livraria</connection-url>
                    <driver>com.mysql</driver>
                    <pool>
                        <min-pool-size>10</min-pool-size>
                        <max-pool-size>100</max-pool-size>
                        <prefill>true</prefill>
                    </pool>
                    <security>
                        <user-name>root</user-name>
                        <password>root</password>
                    </security>
                </datasource>
                <drivers>
                    <driver name="com.mysql" module="com.mysql">
                        <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
                    </driver>
                </drivers>
            </datasources>

tenho o seguinte log:

11:37:15,367 INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 59) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
11:37:15,368 INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 59) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
11:37:17,168 INFO  [org.jboss.weld.Version] (MSC service thread 1-2) WELD-000900: 2.3.5 (Final)
11:37:18,607 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 59) WFLYCLINF0002: Started client-mappings cache from ejb container
11:37:19,392 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 59) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'livraria.war#livraria'
11:37:20,528 INFO  [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 59) HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
11:37:21,007 INFO  [org.hibernate.envers.boot.internal.EnversServiceImpl] (ServerService Thread Pool -- 59) Envers integration enabled? : true
11:37:25,014 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (ServerService Thread Pool -- 59) HHH000228: Running hbm2ddl schema update
11:37:25,744 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "livraria.war")]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.datasources.ExampleDS"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.livraria.livraria.DefaultDataSource is missing [jboss.naming.context.java.jboss.datasources.ExampleDS]"]
}
11:37:25,857 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "livraria.war" (runtime-name : "livraria.war")
11:37:25,866 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.naming.context.java.jboss.datasources.ExampleDS (missing) dependents: [service jboss.naming.context.java.module.livraria.livraria.DefaultDataSource] 

11:37:26,337 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
11:37:26,337 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
11:37:26,338 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started (with errors) in 68163ms - Started 488 of 759 services (34 services failed or missing dependencies, 404 services are lazy, passive or on-demand)
11:37:26,484 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 59) WFLYJPA0011: Stopping Persistence Unit (phase 2 of 2) Service 'livraria.war#livraria'
11:37:26,493 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 59) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'livraria.war#livraria'
11:37:26,595 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 15) WFLYCLINF0003: Stopped client-mappings cache from ejb container
11:37:26,718 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0028: Stopped deployment livraria.war (runtime-name: livraria.war) in 264ms
11:37:27,025 WARN  [org.jboss.as.controller] (DeploymentScanner-threads - 2) WFLYCTL0357: Notification of type deployment-undeployed is not described for the resource at the address []
11:37:27,028 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0009: Undeployed "livraria.war" (runtime-name: "livraria.war")
11:37:27,037 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) 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.UsuarioDao.WeldInterceptorBindingsService, service jboss.deployment.unit."livraria.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".WeldInstantiator, WFLYCTL0208: ... and 14 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."org.jboss.weld.servlet.WeldInitialListener".WeldInstantiator, service jboss.deployment.unit."livraria.war".component.UsuarioDao.WeldInterceptorBindingsService, service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService, WFLYCTL0208: ... and 13 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.JndiBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.deployment.unit."livraria.war".component.AutorDao.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.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.Banco.CREATE (missing) dependents: [service jboss.deployment.unit."livraria.war".component.Banco.START] 
      service jboss.deployment.unit."livraria.war".component.Banco.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.Banco.VIEW."br.com.caelum.livraria.dao.Banco".LOCAL (missing) dependents: [service jboss.deployment.unit."livraria.war".component.Banco.START] 
      service jboss.deployment.unit."livraria.war".component.Banco.WeldInstantiator (missing) dependents: [service jboss.deployment.unit."livraria.war".component.Banco.START] 
      service jboss.deployment.unit."livraria.war".component.Banco.WeldInterceptorBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".component.Banco.WeldInstantiator] 
      service jboss.deployment.unit."livraria.war".component.Banco.ejb3.timerService (missing) dependents: [service jboss.deployment.unit."livraria.war".component.Banco.START] 
      service jboss.deployment.unit."livraria.war".component.LivroDao.CREATE (missing) dependents: [service jboss.deployment.unit."livraria.war".component.LivroDao.START] 
      service jboss.deployment.unit."livraria.war".component.LivroDao.JndiBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      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.VIEW."br.com.caelum.livraria.dao.LivroDao".LOCAL (missing) dependents: [service jboss.deployment.unit."livraria.war".component.LivroDao.START] 
      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.LivroDao.ejb3.timerService (missing) dependents: [service jboss.deployment.unit."livraria.war".component.LivroDao.START] 
      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.JndiBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      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".JndiBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      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".JndiBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      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".JndiBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      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".JndiBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      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".JndiBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      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."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".JndiBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      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".JndiBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      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."javax.faces.webapp.FacesServlet".START, service jboss.deployment.unit."livraria.war".component.Banco.START, service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldTerminalListener".START, service jboss.deployment.unit."livraria.war".component."com.sun.faces.config.ConfigureListener".START, WFLYCTL0208: ... and 7 more ] 
      service jboss.deployment.unit."livraria.war".moduleDeploymentRuntimeInformation (missing) dependents: [service jboss.deployment.unit."livraria.war".component.Banco.START, 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, WFLYCTL0208: ... and 2 more ] 
      service jboss.naming.context.java.app.livraria.env (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.naming.context.java.module.livraria.livraria.BeanManager (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.naming.context.java.module.livraria.livraria.DefaultContextService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.naming.context.java.module.livraria.livraria.DefaultDataSource (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.naming.context.java.module.livraria.livraria.DefaultManagedExecutorService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.naming.context.java.module.livraria.livraria.DefaultManagedScheduledExecutorService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.naming.context.java.module.livraria.livraria.DefaultManagedThreadFactory (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.naming.context.java.module.livraria.livraria.EJBContext (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.naming.context.java.module.livraria.livraria.TimerService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.naming.context.java.module.livraria.livraria.TransactionSynchronizationRegistry (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.naming.context.java.module.livraria.livraria.UserTransaction (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.naming.context.java.module.livraria.livraria.env (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.naming.context.java.module.livraria.livraria.env."br.com.caelum.livraria.dao.AutorDao".manager (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService, service jboss.deployment.unit."livraria.war".component.AutorDao.START] 
      service jboss.naming.context.java.module.livraria.livraria.env."br.com.caelum.livraria.dao.LivroDao".manager (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService, service jboss.deployment.unit."livraria.war".component.LivroDao.START] 
      service jboss.naming.context.java.module.livraria.livraria.env."br.com.caelum.livraria.dao.UsuarioDao".manager (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService, 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."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START, service jboss.deployment.unit."livraria.war".component.AutorDao.START, WFLYCTL0208: ... and 10 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] 

11:37:30,954 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

e quando configuro com os dois DataSources:

 <datasources>
                <datasource jndi-name="java:/livrariaDS" pool-name="livrariaDS" enabled="true" use-java-context="true">
                    <connection-url>jdbc:mysql://localhost:3306/livraria</connection-url>
                    <driver>com.mysql</driver>
                    <pool>
                        <min-pool-size>10</min-pool-size>
                        <max-pool-size>100</max-pool-size>
                        <prefill>true</prefill>
                    </pool>
                    <security>
                        <user-name>root</user-name>
                        <password>root</password>
                    </security>
                </datasource>
                <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
                    <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
                    <driver>h2</driver>
                    <security>
                        <user-name>sa</user-name>
                        <password>sa</password>
                    </security>
                </datasource>
                <drivers>
                    <driver name="com.mysql" module="com.mysql">
                        <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
                    </driver>
                    <driver name="h2" module="com.h2database.h2">
                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                    </driver>
                </drivers>
            </datasources>

Funciona normalmente! pelo que eu entendi, ele precisa do Datasource Default para carregar (ExampleDS), mesmo utilizando outro.

conforme log:

for directory /opt/wildfly-10.1.0/standalone/deployments
11:28:52,101 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
11:28:52,205 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0027: Starting deployment of "livraria.war" (runtime-name: "livraria.war")
11:28:54,071 INFO  [stdout] (MSC service thread 1-1) 2016-10-21 11:28:54 JRebel: Directory '/home/m4rco0/workspace/livraria/build/classes' will be monitored for changes.
11:28:54,073 INFO  [stdout] (MSC service thread 1-1) 2016-10-21 11:28:54 JRebel: Directory '/home/m4rco0/workspace/livraria/WebContent' will be monitored for changes.
11:28:57,648 INFO  [org.jboss.ws.common.management] (MSC service thread 1-3) JBWS022052: Starting JBossWS 5.1.5.Final (Apache CXF 3.1.6) 
11:28:59,764 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) WFLYJPA0002: Read persistence.xml for livraria
11:29:01,154 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 65) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'livraria.war#livraria'
11:29:01,468 INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 65) HHH000204: Processing PersistenceUnitInfo [
    name: livraria
    ...]
11:29:02,703 INFO  [org.hibernate.Version] (ServerService Thread Pool -- 65) HHH000412: Hibernate Core {5.0.10.Final}
11:29:02,706 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 65) HHH000206: hibernate.properties not found
11:29:02,747 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 65) HHH000021: Bytecode provider name : javassist
11:29:03,322 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) WFLYWELD0003: Processing weld deployment livraria.war
11:29:03,332 INFO  [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 65) HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
11:29:03,707 INFO  [stdout] (MSC service thread 1-3) 2016-10-21 11:29:03 JRebel: Monitoring beans.xml: file:/home/m4rco0/workspace/livraria/WebContent/WEB-INF/beans.xml
11:29:04,577 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-3) HV000001: Hibernate Validator 5.2.4.Final
11:29:05,521 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-3) 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

11:29:05,522 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-3) WFLYEJB0473: JNDI bindings for session bean named 'Banco' in deployment unit 'deployment "livraria.war"' are as follows:

    java:global/livraria/Banco!br.com.caelum.livraria.dao.Banco
    java:app/livraria/Banco!br.com.caelum.livraria.dao.Banco
    java:module/Banco!br.com.caelum.livraria.dao.Banco
    java:global/livraria/Banco
    java:app/livraria/Banco
    java:module/Banco

11:29:05,522 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-3) 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

11:29:05,523 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-3) 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

11:29:07,089 INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 65) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
11:29:07,116 INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 65) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
11:29:08,338 INFO  [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900: 2.3.5 (Final)
11:29:09,443 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 65) WFLYCLINF0002: Started client-mappings cache from ejb container
11:29:10,294 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 65) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'livraria.war#livraria'
11:29:10,693 INFO  [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 65) HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
11:29:10,919 INFO  [org.hibernate.envers.boot.internal.EnversServiceImpl] (ServerService Thread Pool -- 65) Envers integration enabled? : true
11:29:14,132 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (ServerService Thread Pool -- 65) HHH000228: Running hbm2ddl schema update
11:29:17,845 INFO  [stdout] (ServerService Thread Pool -- 74) [INFO] Banco criado
11:29:20,282 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 74) Inicializando Mojarra 2.2.13.SP1 20160303-1204 para o contexto '/livraria'
11:29:25,807 INFO  [org.primefaces.webapp.PostConstructApplicationEventListener] (ServerService Thread Pool -- 74) Running on PrimeFaces 4.0
11:29:26,079 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 74) WFLYUT0021: Registered web context: /livraria
11:29:26,515 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 38) WFLYSRV0010: Deployed "livraria.war" (runtime-name : "livraria.war")
11:29:26,935 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
11:29:26,936 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
11:29:26,937 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started in 93475ms - Started 530 of 766 services (405 services are lazy, passive or on-demand)