Resolvi fazer um upgrade no sistema e estou migrando do java7+maven+springboot 1.3.1+wilffly9 para java8+gradle+springboot 1.5.3+wildfly10, e estou quase me arrependendo, pois ja fazem 3 dias e não consigo colocar pra rodar nada, estava dando problema no datasource e acho q resolvi e agora esta dando o erro org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory quando estou levantando o wildfly!! Já vi uns post com a solução mas não esta resolvendo ou não estou fazendo corretamente. Alguem teria alguma idea?
Post todo o stack por favor
segue:
13:39:11,874 INFO [org.jboss.modules] (main) JBoss Modules version 1.5.1.Final
13:39:12,086 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
13:39:12,153 INFO [org.jboss.as] (MSC service thread 1-6) WFLYSRV0049: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) starting
13:39:13,611 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0015: Re-attempting failed deployment WS-Authentication.war
13:39:13,617 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found WS-Authentication.war in deployment directory. To trigger deployment create a file called WS-Authentication.war.dodeploy
13:39:13,618 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found WS-Authentication-1.0.war in deployment directory. To trigger deployment create a file called WS-Authentication-1.0.war.dodeploy
13:39:13,649 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
13:39:13,671 INFO [org.xnio] (MSC service thread 1-5) XNIO version 3.3.4.Final
13:39:13,679 INFO [org.xnio.nio] (MSC service thread 1-5) XNIO NIO Implementation Version 3.3.4.Final
13:39:13,774 INFO [org.wildfly.extension.io] (ServerService Thread Pool – 37) WFLYIO001: Worker ‘default’ has auto-configured to 8 core threads with 64 task threads based on your 4 available processors
13:39:13,796 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 38) WFLYCLINF0001: Activating Infinispan subsystem.
13:39:13,848 INFO [org.jboss.as.connector] (MSC service thread 1-7) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.3.2.Final)
13:39:13,862 INFO [org.jboss.as.jsf] (ServerService Thread Pool – 44) WFLYJSF0007: Activated the following JSF Implementations: [main]
13:39:13,894 INFO [org.jboss.as.naming] (ServerService Thread Pool – 46) WFLYNAM0001: Activating Naming Subsystem
13:39:13,958 INFO [org.jboss.as.security] (ServerService Thread Pool – 53) WFLYSEC0002: Activating Security Subsystem
13:39:14,098 WARN [org.jboss.as.txn] (ServerService Thread Pool – 54) WFLYTX0013: Node identifier property is set to the default value. Please make sure it is unique.
13:39:14,115 INFO [org.jboss.as.security] (MSC service thread 1-6) WFLYSEC0001: Current PicketBox version=4.9.4.Final
13:39:14,118 INFO [org.jboss.as.webservices] (ServerService Thread Pool – 56) WFLYWS0002: Activating WebServices Extension
13:39:14,125 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0003: Undertow 1.3.15.Final starting
13:39:14,126 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 55) WFLYUT0003: Undertow 1.3.15.Final starting
13:39:14,128 INFO [org.jboss.remoting] (MSC service thread 1-5) JBoss Remoting version 4.0.18.Final
13:39:14,150 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool – 33) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
13:39:14,164 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0018: Started Driver service with driver-name = h2
13:39:14,181 INFO [org.jboss.as.mail.extension] (MSC service thread 1-6) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
13:39:14,186 INFO [org.jboss.as.naming] (MSC service thread 1-3) WFLYNAM0003: Starting Naming Service
13:39:14,314 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 55) WFLYUT0014: Creating file handler for path ‘C:\Desenvolvimento\java\wildfly-10.0.0.Final/welcome-content’ with options [directory-listing: ‘false’, follow-symlink: ‘false’, case-sensitive: ‘true’, safe-symlink-paths: ‘[]’]
13:39:14,333 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0012: Started server default-server.
13:39:14,334 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0018: Host default-host starting
13:39:14,360 INFO [org.jboss.as.ejb3] (MSC service thread 1-3) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 16 (per class), which is derived from the number of CPUs on this host.
13:39:14,362 INFO [org.jboss.as.ejb3] (MSC service thread 1-8) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 64 (per class), which is derived from thread worker pool sizing.
13:39:14,824 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
13:39:15,040 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of “WS-Authentication-1.0.war” (runtime-name: “WS-Authentication-1.0.war”)
13:39:15,055 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of “WS-Authentication.war” (runtime-name: “WS-Authentication.war”)
13:39:15,111 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Desenvolvimento\java\wildfly-10.0.0.Final\standalone\deployments
13:39:15,645 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-7) ISPN000128: Infinispan version: Infinispan ‘Mahou’ 8.1.0.Final
13:39:15,719 INFO [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBossWS 5.1.3.Final (Apache CXF 3.1.4)
13:39:15,813 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
13:39:16,059 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit.“WS-Authentication.war”.POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit.“WS-Authentication.war”.POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "WS-Authentication.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class br.com.minha_empresa.webservice.authentication.secutiry.JwtFilter with ClassLoader ModuleClassLoader for Module “deployment.WS-Authentication.war:main” from Service Module Loader
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
… 5 more
Caused by: java.lang.NoClassDefFoundError: Lbr/com/minha_empresa/auth/services/JwtService;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.(ClassReflectionIndex.java:72)
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)
… 10 more
Caused by: java.lang.ClassNotFoundException: br.com.minha_empresa.auth.services.JwtService from [Module “deployment.WS-Authentication.war:main” from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
… 15 more
13:39:18,241 INFO [org.jboss.as.jpa] (MSC service thread 1-7) WFLYJPA0002: Read persistence.xml for FCCommons
13:39:18,441 INFO [org.jboss.as.jpa] (ServerService Thread Pool – 59) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'WS-Authentication-1.0.war#FCCommons’
13:39:18,476 INFO [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool – 59) HHH000204: Processing PersistenceUnitInfo [
name: FCCommons
…]
13:39:18,593 INFO [org.hibernate.Version] (ServerService Thread Pool – 59) HHH000412: Hibernate Core {5.0.7.Final}
13:39:18,596 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool – 59) HHH000206: hibernate.properties not found
13:39:18,599 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool – 59) HHH000021: Bytecode provider name : javassist
13:39:18,653 INFO [org.hibernate.orm.deprecation] (ServerService Thread Pool – 59) HHH90000001: Found usage of deprecated setting for specifying Scanner [hibernate.ejb.resource_scanner]; use [hibernate.archive.scanner] instead
13:39:18,663 INFO [org.hibernate.annotations.common.Version] (ServerService Thread Pool – 59) HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
13:39:18,716 WARN [org.jboss.as.ee] (MSC service thread 1-2) WFLYEE0007: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause)
13:39:18,717 WARN [org.jboss.as.ee] (MSC service thread 1-2) WFLYEE0007: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause)
13:39:18,864 WARN [org.jboss.weld.deployer] (MSC service thread 1-2) WFLYWELD0013: Deployment deployment “WS-Authentication-1.0.war” contains CDI annotations but no bean archive was not found. (No beans.xml nor class with bean defining annotations)
13:39:18,901 INFO [org.jboss.as.jpa] (ServerService Thread Pool – 59) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'WS-Authentication-1.0.war#FCCommons’
13:39:19,105 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool – 59) HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
13:39:19,109 WARN [org.hibernate.dialect.H2Dialect] (ServerService Thread Pool – 59) HHH000431: Unable to determine H2 database version, certain features may not work
13:39:19,139 INFO [org.hibernate.envers.boot.internal.EnversServiceImpl] (ServerService Thread Pool – 59) Envers integration enabled? : true
13:39:19,322 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool – 59) MSC000001: Failed to start service jboss.persistenceunit.“WS-Authentication-1.0.war#FCCommons”: org.jboss.msc.service.StartException in service jboss.persistenceunit.“WS-Authentication-1.0.war#FCCommons”: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97)
at org.hibernate.internal.util.xml.XMLHelper$1.doWork(XMLHelper.java:33)
at org.hibernate.internal.util.xml.XMLHelper$1.doWork(XMLHelper.java:27)
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.workWithClassLoader(ClassLoaderServiceImpl.java:342)
at org.hibernate.internal.util.xml.XMLHelper.(XMLHelper.java:26)
at org.hibernate.envers.boot.internal.EnversServiceImpl.initialize(EnversServiceImpl.java:115)
at org.hibernate.envers.boot.internal.AdditionalJaxbMappingProducerImpl.produceAdditionalMappings(AdditionalJaxbMappingProducerImpl.java:99)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:288)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:847)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:874)
at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154)
… 7 more
13:39:19,326 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation (“deploy”) failed - address: ([(“deployment” => “WS-Authentication-1.0.war”)]) - failure description: {“WFLYCTL0080: Failed services” => {“jboss.persistenceunit.“WS-Authentication-1.0.war#FCCommons”” => “org.jboss.msc.service.StartException in service jboss.persistenceunit.“WS-Authentication-1.0.war#FCCommons”: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory”}}
13:39:19,327 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation (“deploy”) failed - address: ([(“deployment” => “WS-Authentication.war”)]) - failure description: {“WFLYCTL0080: Failed services” => {“jboss.deployment.unit.“WS-Authentication.war”.POST_MODULE” => "org.jboss.msc.service.StartException in service jboss.deployment.unit.“WS-Authentication.war”.POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment “WS-Authentication.war"
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class br.com.minha_empresa.webservice.authentication.secutiry.JwtFilter with ClassLoader ModuleClassLoader for Module “deployment.WS-Authentication.war:main” from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: Lbr/com/minha_empresa/auth/services/JwtService;
Caused by: java.lang.ClassNotFoundException: br.com.minha_empresa.auth.services.JwtService from [Module “deployment.WS-Authentication.war:main” from Service Module Loader]”}}
13:39:19,355 INFO [org.jboss.as.server] (ServerService Thread Pool – 34) WFLYSRV0010: Deployed “WS-Authentication.war” (runtime-name : “WS-Authentication.war”)
13:39:19,355 INFO [org.jboss.as.server] (ServerService Thread Pool – 34) WFLYSRV0010: Deployed “WS-Authentication-1.0.war” (runtime-name : “WS-Authentication-1.0.war”)
13:39:19,364 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
Veja se esta classe esta .war, creio que o problema seja um cash.
Limpe tudo e coloque para gerar a build novamente
Rapaz ja fiz tudo, coloquei no pom o jar, adicionei o projeto como dependencia e ele insiste que a classe não existe, eu bestava rodando pelo eclipse neon, como você falou ai, eu gerei o war e verifiquei o jar que consta esta classe esta la. Eu ja to quase desistindo, não consigo entender o motivo, sem falar quando eu coloco no wildfly 9 ele fica dando erro de jdbc. Estou realmente cansado e pensando seriamente em continuar no java 7+maven+eclipse kleper+wildfly 9 que estava funcionando.
Vlw
O problema esta justamente na hora de gerar a build, o eclipse cria tipo um cash que nao faz a substuição do war publicado. Veja que é algo diferente, a build com o war publicado.
Baixe outro wildfly, coloque o war la dentro e suba pelo command line e veja no que da.
Obrigado pela ajuda campelo!
Consegui resolver adicionando no build.gradle as linhas abaixo:
configurations.all {
exclude(group: “dom4j”, module:“dom4j”)
}
Meu problema agora é que não ta reconhecendo o driver do oracle.
Começa outra briga.
Vou dar uma pesquisada se não conseguir abro um topico.
Vlw mesmo pela ajuda.