4 Replies Latest reply on May 21, 2015 5:50 AM by Raj Kumar

    Unable to configure applicationcontext.xml at deployment in Wildfly ?

    Raj Kumar Newbie

      Hi, Am upgrading My Application Jboss 6 to wildfly 8,

      Am unable deploy the application in Wildfly Server,

      as i configured the applicationcontext.xml as

       

       

          <?xml version="1.0" encoding="UTF-8"?>

          <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xmlns:jee="http://www.springframework.org/schema/jee"

                 xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"

                 xmlns:tx="http://www.springframework.org/schema/tx"

                  xmlns:p="http://www.springframework.org/schema/p"

                 

                 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd

                      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd

                      http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.1.xsd

                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.1.xsd

                      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd">

       

       

      I have added All the referenced Libraries

       

       

      Wildfly Spring Module is: org.springframework

      module.xml

       

       

          <?xml version="1.0" encoding="UTF-8"?>

                  <module xmlns="urn:jboss:module:1.3" name="org.springframework">

          <resources>

          <resource-root path="spring-aop-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-aspects-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-beans-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-context-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-context-support-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-core-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-expression-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-instrument-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-jdbc-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-jms-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-messaging-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-orm-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-oxm-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-test-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-tx-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-web-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-webmvc-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-webmvc-portlet-4.1.6.RELEASE.jar"/>

          <resource-root path="spring-modules-jakarta-commons-0.8.jar"/>

          <resource-root path="spring-modules-validation-0.8.jar"/>

                      </resources>

          <dependencies>

                          <module name="javax.api" services="import"/>

                          <module name="javax.transaction.api" services="import"/>

          <module name="javaee.api" services="import"/>

          <module name="org.apache.commons.logging" services="import"/>

          <module name="org.apache.commons.validator" services="import"/>

          <module name="org.jboss.vfs" services="import"/>

          <module name="org.jboss.msc" services="import"/>

          <module name="javax.el.api" services="import" export="true"/>

          <module name="com.sun.xml.bind" services="import" export="true"/>

          </dependencies>

                  </module>

       

       

       

       

      And Exception Log is Here :

       

       

          13:26:40,814 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8

          .2.0.Final "Tweek" started in 6615ms - Started 234 of 290 services (90 services

          are lazy, passive or on-demand)

          13:26:55,961 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBA

          S015876: Starting deployment of "Test_JB60_Testing.war" (runtime-name: "T

          est_JB60_Testing.war")

          13:27:01,733 INFO  [io.undertow.servlet] (MSC service thread 1-3) Initializing S

          pring root WebApplicationContext

          13:27:01,733 INFO  [org.springframework.web.context.ContextLoader] (MSC service

          thread 1-3) Root WebApplicationContext: initialization started

          13:27:03,059 INFO  [org.springframework.web.context.support.XmlWebApplicationCon

          text] (MSC service thread 1-3) Refreshing Root WebApplicationContext: startup da

          te [Mon May 18 13:27:03 IST 2015]; root of context hierarchy

          13:27:03,343 INFO  [org.springframework.beans.factory.xml.XmlBeanDefinitionReade

          r] (MSC service thread 1-3) Loading XML bean definitions from ServletContext res

          ource [/WEB-INF/appctx/applicationContext-jdbc.xml]

          13:27:05,134 INFO  [org.springframework.beans.factory.xml.XmlBeanDefinitionReade

          r] (MSC service thread 1-3) Loading XML bean definitions from ServletContext res

          ource [/WEB-INF/appctx/applicationContext.xml]

          13:27:08,747 SEVERE [org.springframework.web.context.ContextLoader] (MSC service

           thread 1-3) Context initialization failed: org.springframework.beans.factory.pa

          rsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Sp

          ring NamespaceHandler for XML schema namespace [http://www.springframework.org/s

          chema/context]

          Offending resource: ServletContext resource [/WEB-INF/appctx/applicationContext.

          xml]

         

                  at org.springframework.beans.factory.parsing.FailFastProblemReporter.err

          or(FailFastProblemReporter.java:70) [spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEAS

          E]

                  at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC

          ontext.java:85) [spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]

                  at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC

          ontext.java:80) [spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]

                  at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.er

          ror(BeanDefinitionParserDelegate.java:316) [spring-beans-4.1.6.RELEASE.jar:4.1.6

          .RELEASE]

                  at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa

          rseCustomElement(BeanDefinitionParserDelegate.java:1424) [spring-beans-4.1.6.REL

          EASE.jar:4.1.6.RELEASE]

                  at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa

          rseCustomElement(BeanDefinitionParserDelegate.java:1417) [spring-beans-4.1.6.REL

          EASE.jar:4.1.6.RELEASE]

                  at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe

          ader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:174) [spring-

          beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]

                  at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe

          ader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:144) [sp

          ring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]

                  at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe

          ader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:100) [spri

          ng-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]

                  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registe

          rBeanDefinitions(XmlBeanDefinitionReader.java:510) [spring-beans-4.1.6.RELEASE.j

          ar:4.1.6.RELEASE]

                  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB

          eanDefinitions(XmlBeanDefinitionReader.java:392) [spring-beans-4.1.6.RELEASE.jar

          :4.1.6.RELEASE]

                  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea

          nDefinitions(XmlBeanDefinitionReader.java:336) [spring-beans-4.1.6.RELEASE.jar:4

          .1.6.RELEASE]

                  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea

          nDefinitions(XmlBeanDefinitionReader.java:304) [spring-beans-4.1.6.RELEASE.jar:4

          .1.6.RELEASE]

                  at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

          r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181) [spring-beans-4.1.6

          .RELEASE.jar:4.1.6.RELEASE]

                  at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

          r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217) [spring-beans-4.1.6

          .RELEASE.jar:4.1.6.RELEASE]

                  at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

          r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188) [spring-beans-4.1.6

          .RELEASE.jar:4.1.6.RELEASE]

                  at org.springframework.web.context.support.XmlWebApplicationContext.load

          BeanDefinitions(XmlWebApplicationContext.java:125) [spring-web-4.1.6.RELEASE.jar

          :4.1.6.RELEASE]

                  at org.springframework.web.context.support.XmlWebApplicationContext.load

          BeanDefinitions(XmlWebApplicationContext.java:94) [spring-web-4.1.6.RELEASE.jar:

          4.1.6.RELEASE]

                  at org.springframework.context.support.AbstractRefreshableApplicationCon

          text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129) [spring-

          context-4.1.6.RELEASE.jar:4.1.6.RELEASE]

                  at org.springframework.context.support.AbstractApplicationContext.obtain

          FreshBeanFactory(AbstractApplicationContext.java:537) [spring-context-4.1.6.RELE

          ASE.jar:4.1.6.RELEASE]

                  at org.springframework.context.support.AbstractApplicationContext.refres

          h(AbstractApplicationContext.java:452) [spring-context-4.1.6.RELEASE.jar:4.1.6.R

          ELEASE]

                  at org.springframework.web.context.ContextLoader.configureAndRefreshWebA

          pplicationContext(ContextLoader.java:403) [spring-web-4.1.6.RELEASE.jar:4.1.6.RE

          LEASE]

                  at org.springframework.web.context.ContextLoader.initWebApplicationConte

          xt(ContextLoader.java:306) [spring-web-4.1.6.RELEASE.jar:4.1.6.RELEASE]

                  at org.springframework.web.context.ContextLoaderListener.contextInitiali

          zed(ContextLoaderListener.java:106) [spring-web-4.1.6.RELEASE.jar:4.1.6.RELEASE]

         

                  at io.undertow.servlet.core.ApplicationListeners.contextInitialized(Appl

          icationListeners.java:173) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

                  at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManag

          erImpl.java:193) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

                  at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.s

          tartContext(UndertowDeploymentService.java:87)

                  at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.s

          tart(UndertowDeploymentService.java:72)

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(Se

          rviceControllerImpl.java:1948)

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceCont

          rollerImpl.java:1881)

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.

          java:1142) [rt.jar:1.8.0_40]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor

          .java:617) [rt.jar:1.8.0_40]

                  at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]

         

          13:27:08,800 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC0000

          01: Failed to start service jboss.undertow.deployment.default-server.default-hos

          t./: org.jboss.msc.service.StartException in service jboss.undertow.deployment.d

          efault-server.default-host./: Failed to start service

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceCont

          rollerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.

          java:1142) [rt.jar:1.8.0_40]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor

          .java:617) [rt.jar:1.8.0_40]

                  at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]

          Caused by: java.lang.RuntimeException: org.springframework.beans.factory.parsing

          .BeanDefinitionParsingException: Configuration problem: Unable to locate Spring

          NamespaceHandler for XML schema namespace [http://www.springframework.org/schema

          /context]

          Offending resource: ServletContext resource [/WEB-INF/appctx/applicationContext.

          xml]

         

                  at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManag

          erImpl.java:222)

                  at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.s

          tartContext(UndertowDeploymentService.java:87)

                  at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.s

          tart(UndertowDeploymentService.java:72)

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(Se

          rviceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

                  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceCont

          rollerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

                  ... 3 more

          Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingExcept

          ion: Configuration problem: Unable to locate Spring NamespaceHandler for XML sch

          ema namespace [http://www.springframework.org/schema/context]

          Offending resource: ServletContext resource [/WEB-INF/appctx/applicationContext.

          xml]

         

                  at org.springframework.beans.factory.parsing.FailFastProblemReporter.err

          or(FailFastProblemReporter.java:70)

                  at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC

          ontext.java:85)

                  at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC

          ontext.java:80)

                  at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.er

          ror(BeanDefinitionParserDelegate.java:316)

                  at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa

          rseCustomElement(BeanDefinitionParserDelegate.java:1424)

                  at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa

          rseCustomElement(BeanDefinitionParserDelegate.java:1417)

                  at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe

          ader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:174)

                  at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe

          ader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:144)

                  at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe

          ader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:100)

                  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registe

          rBeanDefinitions(XmlBeanDefinitionReader.java:510)

                  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB

          eanDefinitions(XmlBeanDefinitionReader.java:392)

                  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea

          nDefinitions(XmlBeanDefinitionReader.java:336)

                  at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea

          nDefinitions(XmlBeanDefinitionReader.java:304)

                  at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

          r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)

                  at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

          r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)

                  at org.springframework.beans.factory.support.AbstractBeanDefinitionReade

          r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)

                  at org.springframework.web.context.support.XmlWebApplicationContext.load

          BeanDefinitions(XmlWebApplicationContext.java:125)

                  at org.springframework.web.context.support.XmlWebApplicationContext.load

          BeanDefinitions(XmlWebApplicationContext.java:94)

                  at org.springframework.context.support.AbstractRefreshableApplicationCon

          text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)

                  at org.springframework.context.support.AbstractApplicationContext.obtain

          FreshBeanFactory(AbstractApplicationContext.java:537)

                  at org.springframework.context.support.AbstractApplicationContext.refres

          h(AbstractApplicationContext.java:452)

                  at org.springframework.web.context.ContextLoader.configureAndRefreshWebA

          pplicationContext(ContextLoader.java:403)

                  at org.springframework.web.context.ContextLoader.initWebApplicationConte

          xt(ContextLoader.java:306)

                  at org.springframework.web.context.ContextLoaderListener.contextInitiali

          zed(ContextLoaderListener.java:106)

                  at io.undertow.servlet.core.ApplicationListeners.contextInitialized(Appl

          icationListeners.java:173)

                  at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManag

          erImpl.java:193)

                  ... 7 more

         

          13:27:08,831 ERROR [org.jboss.as.controller.management-operation] (DeploymentSca

          nner-threads - 2) JBAS014613: Operation ("deploy") failed - address: ([("deploym

          ent" => "Test_JB60_Testing.war")]) - failure description: {"JBAS014671: F

          ailed services" => {"jboss.undertow.deployment.default-server.default-host./" =>

           "org.jboss.msc.service.StartException in service jboss.undertow.deployment.defa

          ult-server.default-host./: Failed to start service

              Caused by: java.lang.RuntimeException: org.springframework.beans.factory.par

          sing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spr

          ing NamespaceHandler for XML schema namespace [http://www.springframework.org/sc

          hema/context]

          Offending resource: ServletContext resource [/WEB-INF/appctx/applicationContext.

          xml]

         

              Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingEx

          ception: Configuration problem: Unable to locate Spring NamespaceHandler for XML

           schema namespace [http://www.springframework.org/schema/context]

          Offending resource: ServletContext resource [/WEB-INF/appctx/applicationContext.

          xml]

          "}}

          13:27:08,912 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018

          559: Deployed "Test_JB60_Testing.war" (runtime-name : "Test_JB60_T

          esting.war")

          13:27:08,912 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBA

          S014774: Service status report

          JBAS014777:   Services which failed to start:      service jboss.undertow.deploy

          ment.default-server.default-host./: org.jboss.msc.service.StartException in serv

          ice jboss.undertow.deployment.default-server.default-host./: Failed to start ser

          vice

        • 1. Re: Unable to configure applicationcontext.xml at deployment in Wildfly ?
          James Netherton Newbie

          The Spring namespace handlers are defined in META-INF/spring.handlers. In your jboss-deployment-structure.xml you probably need something like:

           

          <dependencies>

            <module name="org.springframework" services="import" meta-inf="import"/>

          </dependencies>

          • 2. Re: Unable to configure applicationcontext.xml at deployment in Wildfly ?
            Raj Kumar Newbie

            Hi James,

            Thanks for Reply,

             

            i have Added spring dependencies

            Here is my jboss-deployment-structure.xml

             

            <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">

              <deployment>

              <dependencies>

                      <module name="org.springframework" export="true" meta-inf="import" services="import" slot="main" />

                      <module name="com.mysql" export="true"  services="import"/>

                     <module name="org.apache.commons.dbcp" export="true"  services="import" slot="main" />

                     <module name="org.apache.commons.digester" export="true"  services="import" slot="main" />

                     <module name="org.apache.commons.discovery" export="true"  services="import" slot="main" />

                     <module name="org.apache.commons.fileupload" export="true"  services="import" slot="main" />

                     <module name="org.apache.commons.httpclient" export="true"  services="import" slot="main" />

                     <module name="org.apache.commons.validator" export="true"  services="import" slot="main" />

                     <module name="org.apache.commons.lang" export="true"  services="import" slot="main" />

                     <module name="org.aopalliance" export="true"  services="import" slot="main" />

                     <module name="org.aspectj" export="true"  services="import" slot="main" />

                     <module name="org.apache.axis" export="true"  services="import" slot="main" />

                     <module name="org.xmlsoap.schemas" export="true"  services="import" slot="main" />

                     <module name="org.displaytag" export="true"  services="import" slot="main" />

                     <module name="net.sf.ehcache" export="true"  services="import" slot="main" />

                     <module name="org.codehaus.jackson.jackson-core-asl" export="true"  services="import" slot="main" />

                     <module name="org.codehaus.jackson.jackson-mapper-asl" export="true"  services="import" slot="main" />

                     <module name="org.jboss.spring.vfs" export="true"  services="import" slot="main" />

                     <module name="org.jdom" export="true"  services="import" slot="main" />

                     <module name="org.jdom2" export="true"  services="import" slot="main" />

                     <module name="com.sun.jersey" export="true"  services="import" slot="main" />

                     <module name="net.sourceforge.jtds" export="true"  services="import" slot="main" />

                     <module name="com.paypal" export="true"  services="import" slot="main" />

                     <module name="org.apache.shiro" export="true"  services="import" slot="main" />

                     <!-- <module name="com.opensymphony" export="true"  services="import" slot="main" /> -->

                     <module name="org.apache.ws.commons" export="true"  services="import" slot="main" />

                     <module name="com.ibm.wsdl" export="true"  services="import" slot="main" />

                     <module name="org.codehaus.xfire" export="true"  services="import" slot="main" />

                     <module name="org.xmlpull.v1" export="true"  services="import" slot="main" />

                     <module name="org.apache.xmlrpc" export="true"  services="import" slot="main" />

                     <module name="com.thoughtworks.xstream" export="true"  services="import" slot="main" />

                     <module name="edu.emory.mathcs" export="true"  services="import" slot="main" />

                     <module name="org.jboss.spring" export="true"  services="import" slot="main" />

                     <module name="com.sun" export="true"  services="import" slot="main" />

                     <module name="javax.servlet.jsp.tagext" export="true"  services="import" slot="main" />

                     <module name="org.apache.log4j" export="true"  services="import" slot="main" />

                    </dependencies>

              </deployment>

            </jboss-deployment-structure>

             

            As per your suggestion i have added meta-inf in <module name="org.springframework">

             

            am getting below syntax error :

            cvc-complex-type.3.2.2: Attribute 'meta-inf' is not allowed to appear in element 'module'.

             

            what can be the cause of this ?

            • 3. Re: Unable to configure applicationcontext.xml at deployment in Wildfly ?
              James Netherton Newbie

              Try switching to urn:jboss:deployment-structure:1.2 as the meta-inf attribute is not present in the 1.0 schema.