Announcement Announcement Module
Collapse
No announcement yet.
spring-tx-3.0.xsd not found Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring-tx-3.0.xsd not found

    I have the following spring config:

    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/tx
    http://www.springframework.org/schem...ing-tx-3.0.xsd
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schem...-beans-3.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    ...

    <tx:annotation-driven mode="aspectj" transaction-manager="transactionManager" />

    </beans>

    and am receiving the following error:

    org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 26 in XML document from class path resource [spring-config/applicationContext.xml] is invalid;
    nested exception is org.xml.sax.SAXParseException: The prefix "tx" for element "tx:annotation-driven" is not bound.
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:396)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:334)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:302)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:143)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:178)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:149)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:212)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:126)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:92)
    at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:130)
    at org.springframework.context.support.AbstractApplic ationContext.obtainFreshBeanFactory(AbstractApplic ationContext.java:467)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:397)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:139)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:83)

    In my log it looks like the schema mapper has loaded the right schemas. I see the entry for spring-tx-3.0.xsd. I have spring-framework-3.0.4.RELEASE\dist\org.springframework.transaction-3.0.4.RELEASE.jar in my classpath and in includes the /org/springframework/transaction/config/spring-tx-3.0.xsd file with the annotation-driven tag.

    === 2011-01-14 09:20:42,074 [main] INFO ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlAp plicationContext@281acd47: startup date [Fri Jan 14 09:20:42 CST 2011]; root of context hierarchy
    === 2011-01-14 09:20:42,150 [main] INFO XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [spring-config/applicationContext.xml]
    === 2011-01-14 09:20:42,154 [main] DEBUG DefaultDocumentLoader - Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBu ilderFactoryImpl]
    === 2011-01-14 09:20:42,190 [main] DEBUG PluggableSchemaResolver - Loading schema mappings from [META-INF/spring.schemas]
    === 2011-01-14 09:20:42,197 [main] DEBUG PluggableSchemaResolver - Loaded schema mappings: {...
    http://www.springframework.org/schem...-beans-3.0.xsd,
    http://www.springframework.org/schem...-beans-3.0.xsd,
    http://www.springframework.org/schem...ing-tx-3.0.xsd,
    http://www.springframework.org/schem...ing-tx-3.0.xsd,
    http://www.springframework.org/schem...ontext-3.0.xsd,
    http://www.springframework.org/schem...ontext-3.0.xsd,
    ...}
    === 2011-01-14 09:20:42,200 [main] DEBUG PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schem...beans-3.0.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-3.0.xsd
    === 2011-01-14 09:20:42,252 [main] DEBUG PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schem...ntext-3.0.xsd] in classpath: org/springframework/context/config/spring-context-3.0.xsd
    === 2011-01-14 09:20:42,267 [main] DEBUG PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schem...-tool-3.0.xsd] in classpath: org/springframework/beans/factory/xml/spring-tool-3.0.xsd

    It seems for some reason that the resolver fails to find the schema. Any ideas on why that might be?

    Craig

  • #2
    It looks like I was missing:

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

    Comment

    Working...
    X