3
respostas

Configurando JPA no Windflt 10.1

Acadei de fazer toda configuração e não sei o que pode ser que esteja estourando essa Excption.

15:23:12,127 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "livraria.war" (runtime-name : "livraria.war")
15:23:12,135 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.naming.context.java.livrariaDS (missing) dependents: [service jboss.persistenceunit."livraria.war#livraria".__FIRST_PHASE__, service jboss.persistenceunit."livraria.war#livraria"] 

15:23:12,411 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
15:23:12,412 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
15:23:12,413 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started (with errors) in 11116ms - Started 474 of 747 services (36 services failed or missing dependencies, 404 services are lazy, passive or on-demand)
15:23:12,587 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0028: Stopped deployment livraria.war (runtime-name: livraria.war) in 113ms
15:23:12,594 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 12) WFLYCLINF0003: Stopped client-mappings cache from ejb container
15:23:12,694 WARN  [org.jboss.as.controller] (DeploymentScanner-threads - 2) WFLYCTL0357: Notification of type deployment-undeployed is not described for the resource at the address []
15:23:12,695 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0009: Undeployed "livraria.war" (runtime-name: "livraria.war")
15:23:12,703 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.deployment.unit."livraria.war".WeldStartService (missing) dependents: [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.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService, service jboss.deployment.unit."livraria.war".component.UsuarioDao.WeldInterceptorBindingsService, WFLYCTL0208: ... and 12 more ] 
      service jboss.deployment.unit."livraria.war".beanmanager (missing) dependents: [service jboss.persistenceunit."livraria.war#livraria"] 
      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.deployment.unit."livraria.war".deploymentCompleteService] 
      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.ejb.non-functional-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.JndiBindingsService (missing) dependents: [service jboss.deployment.unit."livraria.war".jndiDependencyService] 
      service jboss.deployment.unit."livraria.war".component.Banco.START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./livraria.UndertowDeploymentInfoService, service jboss.deployment.unit."livraria.war".deploymentCompleteService] 
      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.ejb.non-functional-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.deployment.unit."livraria.war".deploymentCompleteService] 
      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.ejb.non-functional-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.deployment.unit."livraria.war".deploymentCompleteService] 
      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.ejb.non-functional-timerservice (missing) dependents: [service jboss.deployment.unit."livraria.war".component.UsuarioDao.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."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.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.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.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.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".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.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.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.Banco.START, service jboss.deployment.unit."livraria.war".component."org.jboss.weld.servlet.WeldTerminalListener".START, 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 5 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.persistenceunit."livraria.war#livraria" (missing) dependents: [service jboss.deployment.unit."livraria.war".component.Banco.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 5 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.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] 

15:23:17,207 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

Criei a pasta dentro de com/mysql/main com os dois arquivos

meu datasource

            <datasources>
                <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>

                <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="h2" module="com.h2database.h2">
                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                    </driver>


                    <driver name="com.mysql" module="com.mysql">
                        <xa-datasource-class>
                            com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
                        </xa-datasource-class>
                    </driver>

                </drivers>
            </datasources>

o meu persistense esté dentro de src/META-INF

meu arquivo persistence


    <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>

ahh e criei o database livraria

3 respostas

Oi Guilherme, olhando as configurações que vc passou, também não encontrou nada de errado(posso estar enganado tb)... tem como postar o arquivo xml da pasta com/mysql/main ? consegue também informar a localização dessa estrutura de pastas? Ficou lá na pasta modules e tudo mais?

diretorio

/home/guilherme/wildfly-10.1.0.Final/modules/com/mysql/main

arquivo

<module name="com.mysql"><resources><resource-root path="mysql-connector-java-5.1.24-bin.jar"/></resources><dependencies><module name="javax.api"/></dependencies></module>

Olá Guilherme, eu também estou usando a mesma versão do servidor que você.

O caminho correto do módulo é:

D:\Jboss\wildfly-10.1.0.Final\modules\system\layers\base\com\mysql\main

Repare que o Wildfly já tem uma estrutura de diretórios pré definida, e se você ir navegando pelos diretórios, vai perceber que já existe um diretório chamado \com. Caminho completo até o \com na minha máquina é: D:\Jboss\wildfly-10.1.0.Final\modules\system\layers\base\com

Aqui na minha máquina a aplicação rodou sem problemas. Espero ter ajudado. Abraços.