1 Reply Latest reply on Jan 11, 2015 9:46 AM by Saravanan Thangavel

    Not able to load Spring Transaction XSD for Spring DB object(s) initialise used under Switcyard project

    Saravanan Thangavel Newbie

      Did anyone tried to initializing db facade with transaction using spring context files from switcyard project/cotext?

       

      We face below exception, mostly looking up of xsd file from classpath related.

       

      14:48:16,834 INFO  [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (http-/135.254.229.83:8443-1) Loading XML bean definitions from URL [file:/opt/aor/conf//aa/db/spring-task-manager.xml]

       

      14:49:19,862 WARN  [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (http-/135.254.229.83:8443-1) Ignored XML validation warning: org.xml.sax.SAXParseException; systemId: classpath:org/springframework/transaction/config/spring-tx-2.0.xsd; lineNumber: 12; columnNumber: 150; schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/tool/spring-tool-2.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

       

              at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) [xercesImpl-2.9.1-redhat-4.jar:]

       

              at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown Source) [xercesImpl-2.9.1-redhat-4.jar:]

       

              at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [xercesImpl-2.9.1-redhat-4.jar:]

       

              at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [xercesImpl-2.9.1-redhat-4.jar:]

       

      The http reference defined in spring namespace are not loadable first as we don't enable internet and so we tried using classpath references as second option. Still when enabling spring transaction for DB, we are not able to load tx xsd which internally refers tools xsd. Is there a way to initialise spring without this xsd lookup/read complexity. Below is our sample namespace pointing details on spring context file

       

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

       

      CLASSPATH

       

      <beans default-init-method="beanInit" default-destroy-method="beanDestroy"

       

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

       

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

       

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

       

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

       

          xsi:schemaLocation="http://www.springframework.org/schema/beans classpath:org/springframework/beans/factory/xml/spring-beans-4.0.xsd

       

          http://www.springframework.org/schema/context classpath:org/springframework/context/config/spring-context-4.0.xsd

       

          http://www.springframework.org/schema/tx classpath:org/springframework/transaction/config/spring-tx-2.0.xsd

       

          http://www.springframework.org/schema/tool classpath:org/springframework/beans/factory/xml/spring-tool-2.0.xsd">

       

      OR INTERNET

       

          <beans default-init-method="beanInit" default-destroy-method="beanDestroy"

       

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

       

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

       

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

       

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

       

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

       

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

       

          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd

       

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

       

          http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">

       

      .

       

      It will be good, if switchyard deployment reads below spring fw configuration/reference files?

       

      META-INF/spring.schemas

      META-INF/spring.handlers

        • 1. Re: Not able to load Spring Transaction XSD for Spring DB object(s) initialise used under Switcyard project
          Saravanan Thangavel Newbie

          Seems We need to keep the combined spring.schemas & spring.handlers under Service project’s META-INF to make spring transaction work under jboss switchyard project;

           

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

           

              <resources>

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

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

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

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

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

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

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

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

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

                  <resource-root path="spring-dao-2.0.8.jar"/>

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

          <resource-root path="aopalliance-1.0.jar"/>

                  <resource-root path="."/>

           

              </resources>

           

              <dependencies>

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

                  <module name="javax.persistence.api"/>

                  <module name="javax.jms.api"/>

                  <module name="javax.api"/>

                  <module name="org.hibernate"/>

                  <module name="com.mysql"/>

              </dependencies>

          </module>


          Mission Accomplished for the day!