GUJ Discussões   :   últimos tópicos   |   categorias   |   GUJ Respostas

Interceptor não funciona após migrar do Glassfish 4 para o WildFly 10

java
Tags: #<Tag:0x00007f7ab0b566c0>

#1

Olá pessoal,

Estou com problemas para “migrar” minha aplicação do Glassfish 4 para o WildFly ( tentei o 8 e o 10 ).

Preferi utilizar o WildFly por conta da utilização do Cache de Segundo Nível, que é de implementação mais simples do que no Glassfish, mas ao tentar “publicar” o projeto na minha máquina, apresenta o erro abaixo:

11:22:50,381 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."manager.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."manager.war".WeldStartService: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_101]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_101]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_101]
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-000123: Error loading br.com.diebold.manager.tx.TransactionInterceptor defined in <class>br.com.diebold.manager.tx.TransactionInterceptor</class> in vfs:/C:/JAVA/Servers/wildfly-10.1.0.Final/standalone/deployments/manager.war/WEB-INF/beans.xml@9
	at org.jboss.weld.bootstrap.enablement.GlobalEnablementBuilder$ClassLoader.apply(GlobalEnablementBuilder.java:273)
	at org.jboss.weld.bootstrap.enablement.GlobalEnablementBuilder$ClassLoader.apply(GlobalEnablementBuilder.java:260)
	at com.google.common.collect.Lists$TransformingRandomAccessList$1.transform(Lists.java:617)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at java.util.AbstractCollection.toArray(AbstractCollection.java:141) [rt.jar:1.8.0_101]
	at java.util.ArrayList.<init>(ArrayList.java:177) [rt.jar:1.8.0_101]
	at org.jboss.weld.bootstrap.enablement.GlobalEnablementBuilder.createModuleEnablement(GlobalEnablementBuilder.java:196)
	at org.jboss.weld.bootstrap.BeanDeployment.createEnablement(BeanDeployment.java:213)
	at org.jboss.weld.bootstrap.WeldStartup.startInitialization(WeldStartup.java:389)
	at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:76)
	at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:94)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]
	... 3 more
Caused by: java.lang.ClassNotFoundException: br.com.diebold.manager.tx.TransactionInterceptor from [Module "deployment.manager.war:main" from Service Module Loader]
	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198) [jboss-modules.jar:1.5.2.Final]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363) [jboss-modules.jar:1.5.2.Final]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351) [jboss-modules.jar:1.5.2.Final]
	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93) [jboss-modules.jar:1.5.2.Final]
	at org.jboss.as.weld.WeldModuleResourceLoader.classForName(WeldModuleResourceLoader.java:68)
	at org.jboss.weld.bootstrap.enablement.GlobalEnablementBuilder$ClassLoader.apply(GlobalEnablementBuilder.java:271)
	... 15 more

Não consegui encontrar nada que me ajudasse a solucionar o problema, estava funcionando normalmente no Glassfish 4.

Agradeço muito pela ajuda.


#2

Essa classe tá dentro do teu war?


#3

Sim, está e funcionava no Glassfish 4.

Se eu “comento” as linhas do Interceptor no beans.xml e o lifecycle no faces-config.xml ele sobe, mas ao tentar efetuar login no sistema, ele retorna NULL porque não foi feito nada devido ao Interceptor estar desabilitado…


#4

É um war só ou são deployments separados?

Dá uma olhada aqui, talvez ajude: https://docs.jboss.org/author/display/WFLY10/Class+Loading+in+WildFly?_sscc=t


#5

O que você colocou no beans.xml? Uma possibilidade é nem ter um beans.xml, ou ter ele vazio, só para fazer o CDI provider ler teu deployment e saber as classes que podem ser injetadas. Depois disso, é só anotar o interceptor de forma apropriada.

Não sei se você está falando sobre um interceptor comum ou sobre os do JAX-RS, acho que é do primeiro. No primeiro caso, você pode anotar a classe com @Interceptor (e outras anotações específicas da tua aplicação para aplicar o interceptor apenas em partes específicas). No segundo, você anota a classe como @Provider e faz com que ela herde de WriterInterceptor/ ReaderInterceptor.


#6

É um de Transactions do JPA.

beans.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
	bean-discovery-mode="all">

	<!-- Aqui vao as configuracoes do CDI -->

	<interceptors>
		<class>br.com.diebold.manager.tx.TransactionInterceptor</class>
	</interceptors>

</beans>

faces-config.xml

    <application>
   		<action-listener>org.primefaces.application.DialogActionListener</action-listener>
	    <navigation-handler>org.primefaces.application.DialogNavigationHandler</navigation-handler>
	    <view-handler>org.primefaces.application.DialogViewHandler</view-handler>

<!-- 	    <message-bundle>br.com.diebold.manager.Messages</message-bundle> -->

	    <locale-config>
	    	<default-locale>pt_BR</default-locale>
	    </locale-config>
    </application>
    
    <lifecycle>
        <phase-listener>
            br.com.diebold.manager.listener.CicloDeVidaListener
        </phase-listener>
        <phase-listener>
            br.com.diebold.manager.listener.Autorizador
        </phase-listener>
    </lifecycle>

#7

Dá uma olhada aqui: http://docs.jboss.org/weld/reference/latest/en-US/html/interceptors.html

Você provavelmente já sabe, mas caso ainda não, Weld é a engine de CDI da JBoss que é utilizada no Wildfly.

Essa parte da documentação trata exatamente do que você quer fazer. Talvez seja um pouquinho diferente do que no Glassfish, alguma configuração. Acredito que isso não deveria acontecer, já que ambos, Glassfish e Wildfly 10, são full Java EE 7 compatible.

As vezes o problema nem é aqui, pode ser em outra coisa também, mas vale a pena dar uma conferida. Vamos tentando diagnosticar, nesse meio tempo alguém mais experiente pode aparecer com a solução.


#8

Cara, era “mahomeno” isto, fiz o seguinte, nas propriedades do projeto, na opção “Project Facets”, retirei o JavaServer Facets e depois inclui novamente, só alterei o Faces Servlet para *.xhtml.

No momento estou migrando 2 projetos e um deles funcionou assim ( deu outro tipo de erro depois do usuário e senha já na tela do sistema ), mas neste que estou tentando subir, ele apresenta o erro abaixo e não consegue subir o projeto:

12:27:22,581 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) WFLYWELD0003: Processing weld deployment siscad.war
12:27:22,640 INFO  [org.hibernate.Version] (ServerService Thread Pool -- 59) HHH000412: Hibernate Core {5.0.10.Final}
12:27:22,641 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 59) HHH000206: hibernate.properties not found
12:27:22,643 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 59) HHH000021: Bytecode provider name : javassist
12:27:22,650 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-2) HV000001: Hibernate Validator 5.2.4.Final
12:27:22,680 INFO  [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 59) HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
12:27:22,966 INFO  [org.jboss.weld.Version] (MSC service thread 1-6) WELD-000900: 2.3.5 (Final)
12:27:23,112 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 59) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'siscad.war#siscad'
12:27:23,164 INFO  [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 59) HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
12:27:23,194 INFO  [org.hibernate.envers.boot.internal.EnversServiceImpl] (ServerService Thread Pool -- 59) Envers integration enabled? : true
12:27:23,519 INFO  [org.hibernate.search.engine.Version] (ServerService Thread Pool -- 59) HSEARCH000034: Hibernate Search 5.5.4.Final
12:27:23,645 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (ServerService Thread Pool -- 59) HHH000228: Running hbm2ddl schema update
12:27:24,972 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 59) MSC000001: Failed to start service jboss.persistenceunit."siscad.war#siscad": org.jboss.msc.service.StartException in service jboss.persistenceunit."siscad.war#siscad": javax.persistence.PersistenceException: [PersistenceUnit: siscad] Unable to build Hibernate SessionFactory
	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:179) [wildfly-jpa-10.1.0.Final.jar:10.1.0.Final]
	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:121) [wildfly-jpa-10.1.0.Final.jar:10.1.0.Final]
	at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667)
	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:193) [wildfly-jpa-10.1.0.Final.jar:10.1.0.Final]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_101]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_101]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_101]
	at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: siscad] Unable to build Hibernate SessionFactory
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:954) [hibernate-entitymanager-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:882) [hibernate-entitymanager-5.0.10.Final.jar:5.0.10.Final]
	at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:161) [wildfly-jpa-10.1.0.Final.jar:10.1.0.Final]
	... 7 more
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema management to JDBC target [alter table Colaborador add constraint FK7e90lonh40xe4qak1tc5xmk79 foreign key (cargo_id) references Cargo (id)]
	at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:59) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlString(SchemaMigratorImpl.java:431) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlStrings(SchemaMigratorImpl.java:420) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applyForeignKeys(SchemaMigratorImpl.java:386) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigrationToTargets(SchemaMigratorImpl.java:214) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:60) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:134) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:101) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:470) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879) [hibernate-entitymanager-5.0.10.Final.jar:5.0.10.Final]
	... 9 more
Caused by: java.sql.SQLException: Cannot add foreign key constraint
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2809)
	at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1811)
	at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1725)
	at org.jboss.jca.adapters.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:430)
	at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:56) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	... 19 more

tem mais linhas, mas eu peguei só este começo.

Consegue me ajudar?

Obrigado!!


#9

O erro que tá dando agora é por causa do banco de dados.

O Hibernate tá tentando modificar uma tabela (provavelmente o gerador de tabela tá configurado como update ou create-drop no persistence.xml ou no .xml do hibernate específico, que esqueci o nome)

Quando ele tenta fazer isso, o retorno do DB causa uma exception: Cannot add foreign key constraint

Essa exception é empacotada em outra do Hibernate:

Unable to execute schema management to JDBC target [alter table Colaborador add constraint FK7e90lonh40xe4qak1tc5xmk79 foreign key (cargo_id) references Cargo (id)]

Que por sua vez é empacotado em uma do JPA: Unable to build Hibernate SessionFactory

Provavelmente, se você for manualmente no banco de dados e tentar adicionar essa constraint específica (utilizando o mesmo usuário do Hibernate no DB), não vai conseguir (pelo mesmo motivo que o Hibernate não tá conseguindo). Contudo, talvez se você olhar o log do MySQL, lá vai dizer os motivos pelos quais a criação da constraint não é permitida.


#10

Barbosa, antes de mais nada, muito obrigado mesmo, sua ajuda está sendo de grande valia para mim.

Realmente, no MySQL o campo não estava como PK nem AI, eu alterei e aí a mensagem de erro mudou:

14:36:50,534 WARN  [org.hibernate.search.engine.impl.ConfigContext] (ServerService Thread Pool -- 58) HSEARCH000075: Configuration setting hibernate.search.lucene_version was not specified: using LUCENE_CURRENT.
14:36:51,116 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."siscad.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."siscad.war".WeldStartService: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_101]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_101]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_101]
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type EntityManager with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject private br.com.diebold.siscad.tx.TransactionInterceptor.manager
  at br.com.diebold.siscad.tx.TransactionInterceptor.manager(TransactionInterceptor.java:0)
  Possible dependencies: 
  - Producer Method [EntityManager] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @Produces @RequestScoped public br.com.diebold.siscad.util.EntityManagerProducer.getManager()],
  - Producer Method [EntityManager] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @Produces @RequestScoped public br.com.diebold.siscad.util.JPAUtil.getEntityManager()]

	at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:367)
	at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)
	at org.jboss.weld.bootstrap.Validator.validateInterceptor(Validator.java:556)
	at org.jboss.weld.bootstrap.ConcurrentValidator$2.doWork(ConcurrentValidator.java:85)
	at org.jboss.weld.bootstrap.ConcurrentValidator$2.doWork(ConcurrentValidator.java:83)
	at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
	at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_101]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_101]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_101]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_101]
	at org.jboss.threads.JBossThread.run(JBossThread.java:320)

14:36:51,122 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "siscad.war")]) - failure description: {
    "WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"siscad.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"siscad.war\".WeldStartService: Failed to start service
    Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type EntityManager with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject private br.com.diebold.siscad.tx.TransactionInterceptor.manager
  at br.com.diebold.siscad.tx.TransactionInterceptor.manager(TransactionInterceptor.java:0)
  Possible dependencies: 
  - Producer Method [EntityManager] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @Produces @RequestScoped public br.com.diebold.siscad.util.EntityManagerProducer.getManager()],
  - Producer Method [EntityManager] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @Produces @RequestScoped public br.com.diebold.siscad.util.JPAUtil.getEntityManager()]
"},
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"siscad.war\".WeldStartService"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}
14:36:51,151 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 33) WFLYSRV0010: Deployed "siscad.war" (runtime-name : "siscad.war")
14:36:51,154 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."siscad.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."siscad.war".WeldStartService: Failed to start service

14:36:51,259 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
14:36:51,259 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
14:36:51,259 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started (with errors) in 7917ms - Started 381 of 738 services (19 services failed or missing dependencies, 464 services are lazy, passive or on-demand)
14:36:51,291 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 2) WFLYJPA0011: Stopping Persistence Unit (phase 2 of 2) Service 'siscad.war#siscad'
14:36:51,298 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 2) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'siscad.war#siscad'
14:36:51,387 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0028: Stopped deployment siscad.war (runtime-name: siscad.war) in 104ms
14:36:51,465 WARN  [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0357: Notification of type deployment-undeployed is not described for the resource at the address []
14:36:51,466 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0009: Undeployed "siscad.war" (runtime-name: "siscad.war")
14:36:51,468 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.deployment.unit."siscad.war".WeldBootstrapService (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".WeldInstantiator, service jboss.deployment.unit."siscad.war".CdiValidatorFactoryService] 
      service jboss.deployment.unit."siscad.war".WeldStartService (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".WeldInstantiator, service jboss.deployment.unit."siscad.war".CdiValidatorFactoryService, service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./siscad] 
      service jboss.deployment.unit."siscad.war".component."com.sun.faces.config.ConfigureListener".CREATE (missing) dependents: [service jboss.deployment.unit."siscad.war".component."com.sun.faces.config.ConfigureListener".START] 
      service jboss.deployment.unit."siscad.war".component."com.sun.faces.config.ConfigureListener".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./siscad, service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.deployment.unit."siscad.war".component."com.sun.faces.config.ConfigureListener".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."siscad.war".component."com.sun.faces.config.ConfigureListener".START] 
      service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacesServlet".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./siscad, service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacesServlet".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacesServlet".START] 
      service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".CREATE (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".START] 
      service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./siscad, service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".START] 
      service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".CREATE (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START] 
      service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./siscad, service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START] 
      service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".CREATE (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START] 
      service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START] 
      service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldInitialListener".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./siscad, service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldTerminalListener".CREATE (missing) dependents: [service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldTerminalListener".START] 
      service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldTerminalListener".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./siscad, service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldTerminalListener".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldTerminalListener".START] 
      service jboss.deployment.unit."siscad.war".ee.ComponentRegistry (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService] 
      service jboss.deployment.unit."siscad.war".jndiDependencyService (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".START, service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START, service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START, service jboss.deployment.unit."siscad.war".component."com.sun.faces.config.ConfigureListener".START, WFLYCTL0208: ... and 3 more ] 
      service jboss.persistenceunit."siscad.war#siscad" (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".START, service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START, service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START, WFLYCTL0208: ... and 4 more ] 
      service jboss.undertow.deployment.default-server.default-host./siscad (missing) dependents: [service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad] 
      service jboss.undertow.deployment.default-server.default-host./siscad.codec (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService] 
      service jboss.undertow.deployment.default-server.default-host./siscad.session (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService] 
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."siscad.war".WeldStartService

14:36:56,173 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found siscad.war in deployment directory. To trigger deployment create a file called siscad.war.dodeploy

o meu beans.xml está marcando como erro "Illegal Typed Name

e o TransactionInterceptor está normal:

package br.com.diebold.siscad.tx;

import javax.inject.Inject;
import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;
import javax.persistence.EntityManager;

@Interceptor
@Transacional
public class TransactionInterceptor {

	@Inject
	private EntityManager manager;

	@AroundInvoke
	public Object intercept(InvocationContext ctx) throws Exception {
		System.out.println("Abrindo transação");
		manager.getTransaction().begin();

		Object resultado = ctx.proceed();

		manager.getTransaction().commit();
		System.out.println("Comitando a transação");

		return resultado;
	}
}

Ele menciona logo abaixo do primeiro erro as possíveis causas:

Possible dependencies: 
  - Producer Method [EntityManager] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @Produces @RequestScoped public br.com.diebold.siscad.util.EntityManagerProducer.getManager()],
  - Producer Method [EntityManager] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @Produces @RequestScoped public br.com.diebold.siscad.util.JPAUtil.getEntityManager()]

Mas não vi nada “diferente”.

package br.com.diebold.siscad.util;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceUnit;

@ApplicationScoped
public class EntityManagerProducer {

	@PersistenceUnit
	private EntityManagerFactory factory;

	@Produces
	@RequestScoped
	public EntityManager getManager() {
		return factory.createEntityManager();

	}

	public void close(@Disposes EntityManager manager) {
		manager.close();
	}

}
package br.com.diebold.siscad.util;

import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class JPAUtil {

	private static EntityManagerFactory emf = Persistence.createEntityManagerFactory("siscad");

	@Produces
	@RequestScoped
	public EntityManager getEntityManager() {
		return emf.createEntityManager();
	}

	public void close(@Disposes EntityManager manager) {
		manager.close();
	}

}

#11

Por nada cara!

Seguinte, agora o problema é assim: na variável br.com.diebold.siscad.tx.TransactionInterceptor.manager, existe um ponto de injeção (@Inject), certo? O provedor de CDI (o Weld, no caso) tá reclamando porque existem dois métodos que podem produzir um EntityManager com qualificador @Default (que é o caso da tua variável manager), esses:

- Producer Method [EntityManager] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @Produces @RequestScoped public br.com.diebold.siscad.util.EntityManagerProducer.getManager()],
- Producer Method [EntityManager] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @Produces @RequestScoped public br.com.diebold.siscad.util.JPAUtil.getEntityManager()]

Na hora que ele vai procurar o objeto para injetar na variável, existem essas duas alternativas. Como ele não sabe qual escolher, ele simplesmente decide não escolher e atirar uma exception.

Você pode:

  1. Apagar um desses dois métodos
  2. Especificar qual deles você quer que seja utilizado, através de anotações qualificadoras. Esse artigo diz exatamente o que você deve fazer para implementar essa opção.

#12

Rapaz, esta migração está uma verdadeira “cagada”…

Veja só, eu removi o EntityManagerProducer e ele continua dando o mesmo erro…

Fechei, abri, removi, coloquei novamente o projeto e nada…

Não sei aonde está esta ‘sujeira’ no projeto…


#13

Estranho… ele ainda mostra essa linha no stack trace?

 Ambiguous dependencies for type EntityManager with qualifiers @Default

Experimenta tirar do servidor (undeploy), fazer um clean (se estiver usando Maven ou Gradle) ou apaga manualmente a pasta build, ou out, ou qualquer que seja a pasta onde é gerado o .war, e constroi o .war de novo do zero.


#14

Realmente, fui na pasta build e estava lá o danado…

Tive a seguinte situação:

1 - Se excluo a pasta build, apresenta o erro abaixo:

13:00:24,637 WARN  [org.hibernate.search.engine.impl.ConfigContext] (ServerService Thread Pool -- 58) HSEARCH000075: Configuration setting hibernate.search.lucene_version was not specified: using LUCENE_CURRENT.
13:00:24,787 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit."siscad.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."siscad.war".WeldStartService: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_101]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_101]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_101]
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-000123: Error loading br.com.diebold.siscad.tx.TransactionInterceptor defined in <class>br.com.diebold.siscad.tx.TransactionInterceptor</class> in vfs:/C:/JAVA/Servers/wildfly-10.1.0.Final/standalone/deployments/siscad.war/WEB-INF/beans.xml@10
	at org.jboss.weld.bootstrap.enablement.GlobalEnablementBuilder$ClassLoader.apply(GlobalEnablementBuilder.java:273)
	at org.jboss.weld.bootstrap.enablement.GlobalEnablementBuilder$ClassLoader.apply(GlobalEnablementBuilder.java:260)
	at com.google.common.collect.Lists$TransformingRandomAccessList$1.transform(Lists.java:617)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at java.util.AbstractCollection.toArray(AbstractCollection.java:141) [rt.jar:1.8.0_101]
	at java.util.ArrayList.<init>(ArrayList.java:177) [rt.jar:1.8.0_101]
	at org.jboss.weld.bootstrap.enablement.GlobalEnablementBuilder.createModuleEnablement(GlobalEnablementBuilder.java:196)
	at org.jboss.weld.bootstrap.BeanDeployment.createEnablement(BeanDeployment.java:213)
	at org.jboss.weld.bootstrap.WeldStartup.startInitialization(WeldStartup.java:389)
	at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:76)
	at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:94)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.6.Final.jar:1.2.6.Final]
	... 3 more
Caused by: java.lang.ClassNotFoundException: br.com.diebold.siscad.tx.TransactionInterceptor from [Module "deployment.siscad.war:main" from Service Module Loader]
	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198) [jboss-modules.jar:1.5.2.Final]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363) [jboss-modules.jar:1.5.2.Final]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351) [jboss-modules.jar:1.5.2.Final]
	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93) [jboss-modules.jar:1.5.2.Final]
	at org.jboss.as.weld.WeldModuleResourceLoader.classForName(WeldModuleResourceLoader.java:68)
	at org.jboss.weld.bootstrap.enablement.GlobalEnablementBuilder$ClassLoader.apply(GlobalEnablementBuilder.java:271)
	... 15 more

13:00:24,797 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "siscad.war")]) - failure description: {
    "WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"siscad.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"siscad.war\".WeldStartService: Failed to start service
    Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-000123: Error loading br.com.diebold.siscad.tx.TransactionInterceptor defined in <class>br.com.diebold.siscad.tx.TransactionInterceptor</class> in vfs:/C:/JAVA/Servers/wildfly-10.1.0.Final/standalone/deployments/siscad.war/WEB-INF/beans.xml@10
    Caused by: java.lang.ClassNotFoundException: br.com.diebold.siscad.tx.TransactionInterceptor from [Module \"deployment.siscad.war:main\" from Service Module Loader]"},
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"siscad.war\".WeldStartService"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}
13:00:24,817 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 33) WFLYSRV0010: Deployed "siscad.war" (runtime-name : "siscad.war")
13:00:24,827 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."siscad.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."siscad.war".WeldStartService: Failed to start service

13:00:24,898 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
13:00:24,899 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
13:00:24,899 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started (with errors) in 6673ms - Started 381 of 738 services (19 services failed or missing dependencies, 464 services are lazy, passive or on-demand)
13:00:24,949 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 5) WFLYJPA0011: Stopping Persistence Unit (phase 2 of 2) Service 'siscad.war#siscad'
13:00:24,949 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 5) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'siscad.war#siscad'
13:00:25,028 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0028: Stopped deployment siscad.war (runtime-name: siscad.war) in 100ms
13:00:25,101 WARN  [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0357: Notification of type deployment-undeployed is not described for the resource at the address []
13:00:25,101 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0009: Undeployed "siscad.war" (runtime-name: "siscad.war")
13:00:25,101 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.deployment.unit."siscad.war".WeldBootstrapService (missing) dependents: [service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldInitialListener".WeldInstantiator, service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".WeldInstantiator, service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".WeldInstantiator, service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".WeldInstantiator, WFLYCTL0208: ... and 5 more ] 
      service jboss.deployment.unit."siscad.war".WeldStartService (missing) dependents: [service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldInitialListener".WeldInstantiator, service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".WeldInstantiator, service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".WeldInstantiator, service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".WeldInstantiator, WFLYCTL0208: ... and 7 more ] 
      service jboss.deployment.unit."siscad.war".component."com.sun.faces.config.ConfigureListener".CREATE (missing) dependents: [service jboss.deployment.unit."siscad.war".component."com.sun.faces.config.ConfigureListener".START] 
      service jboss.deployment.unit."siscad.war".component."com.sun.faces.config.ConfigureListener".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./siscad, service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacesServlet".CREATE (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacesServlet".START] 
      service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacesServlet".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./siscad, service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".CREATE (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".START] 
      service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./siscad, service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".START] 
      service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".CREATE (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START] 
      service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./siscad, service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START] 
      service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".CREATE (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START] 
      service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START] 
      service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldInitialListener".CREATE (missing) dependents: [service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldInitialListener".START] 
      service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldInitialListener".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./siscad, service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldInitialListener".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldInitialListener".START] 
      service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldTerminalListener".CREATE (missing) dependents: [service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldTerminalListener".START] 
      service jboss.deployment.unit."siscad.war".component."org.jboss.weld.servlet.WeldTerminalListener".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.undertow.deployment.default-server.default-host./siscad, service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.deployment.unit."siscad.war".ee.ComponentRegistry (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService] 
      service jboss.deployment.unit."siscad.war".jndiDependencyService (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".START, service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START, service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START, service jboss.deployment.unit."siscad.war".component."com.sun.faces.config.ConfigureListener".START, WFLYCTL0208: ... and 4 more ] 
      service jboss.persistenceunit."siscad.war#siscad" (missing) dependents: [service jboss.deployment.unit."siscad.war".component."javax.faces.webapp.FacetTag".START, service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START, service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService, service jboss.deployment.unit."siscad.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START, WFLYCTL0208: ... and 4 more ] 
      service jboss.undertow.deployment.default-server.default-host./siscad (missing) dependents: [service jboss.deployment.unit."siscad.war".deploymentCompleteService] 
      service jboss.undertow.deployment.default-server.default-host./siscad.codec (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService] 
      service jboss.undertow.deployment.default-server.default-host./siscad.session (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./siscad.UndertowDeploymentInfoService] 
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."siscad.war".WeldStartService

13:00:29,855 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found siscad.war in deployment directory. To trigger deployment create a file called siscad.war.dodeploy

2 - Se excluo somente uma classe que está dando duplicidade, ele sobe o sistema,só que, quando eu coloco o usuário e senha e tento autenticar, ele apresenta o erro abaixo:

11:31:40,404 INFO  [org.hibernate.dialect.Dialect] (default task-5) HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
11:31:40,410 INFO  [org.hibernate.envers.boot.internal.EnversServiceImpl] (default task-5) Envers integration enabled? : true
11:31:40,478 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (default task-5) HHH000228: Running hbm2ddl schema update
11:31:41,473 WARN  [org.hibernate.search.engine.impl.ConfigContext] (default task-5) HSEARCH000075: Configuration setting hibernate.search.lucene_version was not specified: using LUCENE_CURRENT.
11:31:41,515 WARNING [javax.enterprise.resource.webcontainer.jsf.lifecycle] (default task-5) #{loginBean.efetuaLogin}: org.hibernate.resource.transaction.backend.jta.internal.JtaPlatformInaccessibleException: Unable to access TransactionManager or UserTransaction to make physical transaction delegate: javax.faces.FacesException: #{loginBean.efetuaLogin}: org.hibernate.resource.transaction.backend.jta.internal.JtaPlatformInaccessibleException: Unable to access TransactionManager or UserTransaction to make physical transaction delegate
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118) [jsf-impl-2.2.13.SP1.jar:2.2.13.SP1]
	at org.primefaces.application.DialogActionListener.processAction(DialogActionListener.java:45) [primefaces-6.0.jar:6.0]
	at javax.faces.component.UICommand.broadcast(UICommand.java:315) [jboss-jsf-api_2.2_spec-2.2.13.jar:2.2.13]
	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) [jboss-jsf-api_2.2_spec-2.2.13.jar:2.2.13]
	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) [jboss-jsf-api_2.2_spec-2.2.13.jar:2.2.13]
	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.2.13.SP1.jar:2.2.13.SP1]
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.13.SP1.jar:2.2.13.SP1]
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) [jsf-impl-2.2.13.SP1.jar:2.2.13.SP1]
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658) [jboss-jsf-api_2.2_spec-2.2.13.jar:2.2.13]
	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [undertow-core-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) [undertow-core-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) [undertow-core-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) [undertow-core-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.0.Final.jar:1.4.0.Final]
	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104) [undertow-servlet-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202) [undertow-core-1.4.0.Final.jar:1.4.0.Final]
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805) [undertow-core-1.4.0.Final.jar:1.4.0.Final]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_101]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_101]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_101]
Caused by: javax.faces.el.EvaluationException: org.hibernate.resource.transaction.backend.jta.internal.JtaPlatformInaccessibleException: Unable to access TransactionManager or UserTransaction to make physical transaction delegate
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101) [jboss-jsf-api_2.2_spec-2.2.13.jar:2.2.13]
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) [jsf-impl-2.2.13.SP1.jar:2.2.13.SP1]
	... 46 more
Caused by: org.hibernate.resource.transaction.backend.jta.internal.JtaPlatformInaccessibleException: Unable to access TransactionManager or UserTransaction to make physical transaction delegate
	at org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.makePhysicalTransactionDelegate(JtaTransactionCoordinatorImpl.java:229) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.getTransactionDriverControl(JtaTransactionCoordinatorImpl.java:203) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.engine.transaction.internal.TransactionImpl.<init>(TransactionImpl.java:36) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.internal.AbstractSessionImpl.getTransaction(AbstractSessionImpl.java:313) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.internal.SessionImpl.<init>(SessionImpl.java:278) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.internal.SessionFactoryImpl$SessionBuilderImpl.openSession(SessionFactoryImpl.java:1327) [hibernate-core-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.jpa.internal.EntityManagerImpl.internalGetSession(EntityManagerImpl.java:133) [hibernate-entitymanager-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.jpa.spi.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:174) [hibernate-entitymanager-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.jpa.internal.EntityManagerImpl.<init>(EntityManagerImpl.java:83) [hibernate-entitymanager-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.jpa.internal.EntityManagerFactoryImpl.internalCreateEntityManager(EntityManagerFactoryImpl.java:319) [hibernate-entitymanager-5.0.10.Final.jar:5.0.10.Final]
	at org.hibernate.jpa.internal.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:286) [hibernate-entitymanager-5.0.10.Final.jar:5.0.10.Final]
	at br.com.diebold.siscad.util.JPAUtil.getEntityManager(JPAUtil.java:22) [classes:]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_101]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_101]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_101]
	at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_101]
	at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:78) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:100) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:161) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:181) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:101) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weld.bean.ContextualInstanceStrategy$CachingContextualInstanceStrategy.get(ContextualInstanceStrategy.java:178) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weldx.persistence.EntityManager$1176467791$Proxy$_$$_WeldClientProxy.createQuery(Unknown Source) [weld-core-impl-2.3.5.Final.jar:]
	at br.com.diebold.siscad.dao.UsuarioDao.existe(UsuarioDao.java:23) [classes:]
	at br.com.diebold.siscad.mb.LoginBean.efetuaLogin(LoginBean.java:34) [classes:]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_101]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_101]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_101]
	at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_101]
	at com.sun.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:181) [javax.el-impl-3.0.1-b08-jbossorg-1.jar:3.0.1-b08-jbossorg-1]
	at com.sun.el.parser.AstValue.invoke(AstValue.java:289) [javax.el-impl-3.0.1-b08-jbossorg-1.jar:3.0.1-b08-jbossorg-1]
	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304) [javax.el-impl-3.0.1-b08-jbossorg-1.jar:3.0.1-b08-jbossorg-1]
	at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-core-impl-2.3.5.Final.jar:2.3.5.Final]
	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [jsf-impl-2.2.13.SP1.jar:2.2.13.SP1]
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87) [jboss-jsf-api_2.2_spec-2.2.13.jar:2.2.13]
	... 47 more

Tentei refazer tudo novamente várias e várias vezes de maneiras diferentes, pesquisei pelos erros apresentados e até achei alguma coisa como neste post por exemplo: http://stackoverflow.com/questions/40550945/unable-to-access-transactionmanager-or-usertransaction-to-make-physical-transact

Não tenho muita experiência ainda e isto me impaca bastante.

Novamente agradeço pela ajuda, posso te garantir que aprendi muito com a sua ajuda.

Abraço!


#15

Cara, seguinte. Eu vou explicar como que funciona a distribuição da tua aplicação, pule essa parte se você já souber (pode ser útil pra alguém lendo isso no futuro), vou colocar uma linha ali embaixo mostrando onde termina.

A pasta build dentro da pasta do projeto é o local onde a tua IDE ou a Build Tool que você está utilizando (Maven, Gradle, o que quer que seja) vai empacotar os arquivos .class e os arquivos de configuração (persistence.xml, beans.xml, faces-config.xml, etc) dentro de um arquivo zip. Esse arquivo tem a terminação war, jar ou ear, por causa da estrutura de pastas/arquivos que ele tem internamente definida pela Oracle, mas não é nada alem de um arquivo zip.

Beleza, você clicou no botão de build da IDE ou usou a Build Tool para gerar o .war. Agora, você precisa copiar esse arquivo zip para dentro do teu container (Wildfly no caso). Esse processo é o chamado Deployment. O inverso, remover o teu arquivo do servidor, é chamado de Undeployment. Cada container tem uma estratégia diferente para fazer isso. No Wildfly, você pode tanto utilizar a API de deployment deles, como utilizar alguma ferramenta pronta de deployment (como o plugin Wildfly para Maven ou utilzando a própria IDE). No caso do Wildfly, também existe o jboss-cli.sh, que é um script que te permite conectar ao servidor pela linha de comando. Outra coisa que dá pra fazer também é acessar a interface web de gerência do Wildfly (porta 9990, por padrão) e fazer deploy por lá.

A partir do momento que você faz deploy, o container vai abrir teu zip (zip, não zipper hahaha) e, de acordo com a extensão utilizada (.war, .ear, .jar), ele sabe onde encontrar o que ele precisa. Mas como? Ali dentro, como te falei, vão todos os .class e arquivos de configuração que vc utiliza no teu projeto. Alguns desses arquivos de configuração são conhecidos como Deployment Descriptor. A grande maioria deles é especificada pela Oracle na espeficicação do Java EE 7. Se uma empresa quer que a Oracle certifique seu container de aplicação (Wildfly, Glassfish, WebSphere, etc), ele precisa, dentre outras coisas, compreender e utilizar corretamente esses deployment descriptors. Além disso, cada container também tem seus descriptors próprios, que podem ser utilizados para realizar uma configuração mais específica.

Aqui você encontra a lista de todos os descriptors que podem ser utilizados no Wildfly, alem de uma breve descrição da sua função: https://docs.jboss.org/author/display/WFLY10/Deployment+Descriptors+used+In+WildFly

Você vai ver que já conhece boa parte deles e os utilizava no Glassfish, como web.xml e beans.xml. Esses são os que a Oracle define. Tem um ali, logo no começo, chamado de jboss-deployment-structure.xml, que com certeza só funciona no Wildfly. Os Deployment Descriptors servem para dizer ao container onde encontrar certos recursos dentro do teu arquivo zip, ou mesmo dizer para o container como se comportar em certas situações.


Pronto, agora podemos falar sobre o teu problema.

Quando você apaga a pasta build dentro do teu projeto, você está simplesmente apagando o artefato gerado pela build tool. Não está mexendo no que está no servidor, são copias distintas.

Se você apaga a classe (ou comenta) e só compila o teu projeto, o artefato vai ser gerado ali na pasta build, mas não vai pro servidor também. Build e Deploy são operações completamente diferentes (mas não completamente independentes uma da outra).

Para atualizar a aplicação no container, você precisa ir manualmente e fazer deploy do artefato no container (ou utilizar alguma outra técnica como Hot Swap, ou ainda alguma ferramenta de entrega contínua/deploy automatizado, mas enfim).

O problema foi:

java.lang.ClassNotFoundException: br.com.diebold.siscad.tx.TransactionInterceptor

A mais provável causa desse erro é que essa classe está sendo referenciada em algum lugar do teu projeto, mas não está no .war. Como já to conversando contigo há algum tempo, acredito que essa referência é um dos deployment descriptors, porque também tem essa linha no teu log:

from [Module \"deployment.siscad.war:main\" from Service Module Loader]"

Vê ali, o “Service Module Loader”? Isso tá com cara de que é coisa do Wildfly.

A exception aqui é a seguinte:

org.hibernate.resource.transaction.backend.jta.internal.JtaPlatformInaccessibleException: 
Unable to access TransactionManager or UserTransaction to make physical transaction delegate

O hibernate não tá conseguindo obter uma transação do container, por isso não tá conseguindo fazer login. Não tenho ideia do motivo pelo qual isso tá acontecendo, mas chutaria que tem a ver com a tua classe TransactionInterceptor. O que essa classe faz? É para fazer algum tipo de log? Ou ela mexe na transação?

Um assunto que tem 100% a ver com isso é a API de transações do Java EE 7, JTA. Dá uma olhada sobre esse assunto, mas só caso você ainda não tenha lidado com ele.

Eu suspeito também que pode ter a ver com o fato de você estar instanciando manualmente os entity managers dentro daqueles producers que comentamos anteriormente. Porque você não deixa o container instancia-los na hora que você precisa?

@PersistenceContext(unitName = "NomeDaPersistenceUnitNoPersistence.xml")
private EntityManager entitymanager;

Dessa forma, quem cria o EntityManager é o container, e o associa a transação da thread atual de forma transparente para nós.

Java EE é um inferno pra aprender mesmo. A curva de aprendizado é extremamente íngreme, foi a pior experiência de aprendizado que eu tive até agora. Comecei a pouco tempo (cerca de 7 meses), e venho estudando intensivamente. Já comecei a entender o funcionamento de forma mais profunda, mas ainda assim, você vê que eu nem sempre sei te dizer exatamente a causa do problema, só possíveis maneiras de diagnostica-lo melhor. Saber debugar e ler esses logs ajuda demais, o problema é aprender a fazer isso, vem com o tempo mesmo. Você tá no caminho certo!

Agora, apesar da dificuldade no aprendizado, foi a tecnologia com a qual eu mais gostei de trabalhar até hoje. Já mexi com PHP, Python e até C++ (na empresa que eu estagiava, um dos middlewares deles era em C++ hahahahaha) para web. Inclusive, já estudei uma vez, no começo da faculdade, JSP e Servlet (viajei completamente e odiava esse assunto na época). Gosto muito de Java e to achando sensacional as ideias adotadas pela Oracle na especificação do Java EE 7.


#16

Barbosa, matou a pau, era tudo isto mesmo e mais um pouco.

Vamos por partes:

1 - Obrigado pelas explicações, como você mesmo disse, além de servirem para mim, servirá futuramente para outros com as mesmas dúvidas ( e como rendeu heim!! hahaha ).

2 - Entendi melhor agora sobre a questão do Build, mas meus projetos estão temporariamente rodando em minha máquina ( nem me fala, nem me fala… ), por pouco tempo, mas é questão de necessidade. Assim sendo, fica tudo local, mas entendi e agradeço, para resolver a questão do Build era simples, bastava clicar com o botão direito sobre o projeto e selecionar “Build Project” e pronto, mas graças às suas explicações pude “enxergar o óbvio”.
As vezes estamos tão preocupados com o problema que deixamos de enxergar coisas óbvias como esta…

3 - Como o Wildfly reclamava dos métodos ambíguos, removi um deles e fiz a anotation que você me sugeriu, ficou perfeito!

4 - O objetivo final de tudo isto ( migrar do GlassFish para o Wildfly ) é porque pelo Wildfly consigo de maneira mais fácil e produtiva utilizar o Cache de Segundo Nível.
Como tudo agora está correto, fiz também a prevenção de paginação com Lazy Loading e ficou muito bom.
Como prevejo que no sistema algumas telas serão de uso constante e com as mesmas informações, faz todo sentido utilizar este maravilhoso recurso.

5 - Cara, que epopéia a sua… quanta coisa, hahaha… Eu trabalho com Java a poucos anos ( 3 só ), mas para mim é complicado porque tenho que fazer “TUDO” sozinho ( Requisitos, Codding, Banco de Dados, Teste, etc… ), mas sei aproveitar a oportunidade, acho que assim como você encarou nas empresas que passou aprendendo todas estas tecnologias, encaro como um bom aprendizado.

Novamente, agradeço e muito a sua ajuda, no nosso “meio” ( digo desenvolvedores ) não é fácil encontrar pessoas que se disponham a falar um pouco mais, já vi muitos dizendo: “eu não dou o peixe, ensino a pescar” e se limitam a respostas curtas e secas.
Estou extremamente agradecido porque tudo o que postou para me ajudar me levou a aprender mais, não foi só copiar e colar. E olha que não foi pouca coisa que escrevemos aqui heim!!! hahahaha. Mas tenho certeza que muitos outros com a mesma dúvida irão se “encontrar” facilmente.

Obrigado! De verdade! Sucesso e PARABÉNS!


#17

Só mais uma coisa…

… como disse que estuda bastante, lembrei disto.
Fiz 2 cursos na Caelum e recomendo, mas atualmente estou vendo algumas aulas do pessoal da ALGAWORKS e recomendo, os caras são muito bons também.

Abraço!