4 Replies Latest reply on Dec 17, 2013 8:15 AM by Paulo Vivacqua

    Como excluir dependências de serem carregadas pelo JBoss AS 7.1.1?

    Paulo Vivacqua Newbie

      Pesssoal,

       

      Estamos migrando um de nossos Web Services desenvolvido utilizando o framework CXF, do JBoss 4.2.3 para o JBoss AS 7.1.1. Precisamos excluir as dependências do CXF (modulos) que são carregadas pelo JBoss AS 7.1.1 para que possamos usar as bibilotecas do CXF 2.7.8 contidas no nosso projeto e configuradas a partir do nosso POM. Não temos permissão para alterar os arquivos de configuração do JBoss (standalone.xml) nem de excluir os modulos, portanto a solução deve ser feita através  da configuração do  arquivo jboss-deployment-structure.xml em nosso projeto.

       

      Até o momento o mais longe que conseguirmos chegar na configuração do jboss-deployment-structure.xml foi:

       

      <jboss-deployment-structure>
         <deployment>
            <dependencies>
               <module name="org.apache.cxf" export="true" />
            </dependencies>
            <exclusions>
            <module name="org.apache.cxf"/>
              <module name="asm.asm"/>
              <module name="javax.api" />
              <module name="javax.annotation.api"/>
              <module name="javax.jms.api"/>
              <module name="javax.jws.api"/>
              <module name="javax.mail.api" />
              <module name="javax.resource.api" />
              <module name="javax.servlet.api" />
              <module name="javax.xml.bind.api"/>
              <module name="com.sun.xml.bind"/>
              <module name="javax.wsdl4j.api" />
              <module name="javax.xml.soap.api" />
              <module name="javax.xml.stream.api" />
              <module name="javax.xml.ws.api" />
              <module name="org.apache.commons.lang" />
              <module name="org.apache.neethi" />
              <module name="org.apache.velocity" />
              <module name="org.apache.xml-resolver" />
              <module name="org.apache.ws.xmlschema" />
              <module name="org.apache.ws.security" />
              <module name="org.apache.santuario.xmlsec" />
              <module name="org.springframework.spring"/>
            </exclusions>
         </deployment>
      </jboss-deployment-structure>
      

       

      No entanto ao tentar rodar nosso projeto recebemos a seguinte exceção:

       

      14:24:14,429 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry jaxb-api.jar in "/F:/Desenvolvimento/Programas/jboss-as-7.1.1.Final_Clean/jboss-as-7.1.1.Final/standalone/deployments/Test.war/WEB-INF/lib/jaxb-impl-2.2.6.jar"  does not point to a valid jar for a Class-Path reference.
      14:24:14,618 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015893: Encountered invalid class name 'org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer' for service type 'org.xmlpull.v1.XmlPullParserFactory'
      14:24:14,791 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: Deployment "deployment.Test.war" is using a private module ("org.apache.cxf:main") which may be changed or removed in future versions without notice.
      14:24:14,793 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: Deployment "deployment.Test.war" is using a private module ("org.apache.cxf:main") which may be changed or removed in future versions without notice.
      14:24:14,840 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."Test.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."Test.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "Test.war"
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]
        at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]
      Caused by: java.lang.RuntimeException: Error getting reflective information for class org.apache.cxf.transport.servlet.CXFServlet with ClassLoader ModuleClassLoader for Module "org.apache.cxf:main" from local module loader @5e2b323e (roots: F:\Desenvolvimento\Programas\jboss-as-7.1.1.Final_Clean\jboss-as-7.1.1.Final\modules)
        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
        at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)
        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)
        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)
        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
        ... 5 more
      Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
        at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.6.0_45]
        at java.lang.Class.privateGetDeclaredFields(Class.java:2300) [rt.jar:1.6.0_45]
        at java.lang.Class.getDeclaredFields(Class.java:1745) [rt.jar:1.6.0_45]
        at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
        ... 10 more
      Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext from [Module "org.apache.cxf:main" from local module loader @5e2b323e (roots: F:\Desenvolvimento\Programas\jboss-as-7.1.1.Final_Clean\jboss-as-7.1.1.Final\modules)]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
        ... 15 more
      
      
      14:24:14,871 INFO  [org.jboss.as] (MSC service thread 1-4) JBAS015951: Admin console listening on http://127.0.0.1:9990
      14:24:14,873 ERROR [org.jboss.as] (MSC service thread 1-4) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 5959ms - Started 140 of 218 services (1 services failed or missing dependencies, 76 services are passive or on-demand)
      14:24:14,873 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "Test.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"Test.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"Test.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"Test.war\""}}
      14:24:15,243 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015877: Stopped deployment Test.war in 368ms
      14:24:15,247 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
      JBAS014777:   Services which failed to start:      service jboss.deployment.unit."Test.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."Test.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "Test.war"
      
      
      14:24:15,254 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"Test.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"Test.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"Test.war\""}}}}