Results 1 to 4 of 4

Thread: Run in Eclipse, cannot find XSD.

  1. #1
    Join Date
    Aug 2004
    Location
    u.s.a
    Posts
    399

    Default Run in Eclipse, cannot find XSD.

    Attempting to use the Spring 2.0 new features. At command line app runs, but a run in Eclipse end in exception finding the xschema file. Is there any extra step needed to configure Eclipse 3.2rc5?

    2006-09-01 00:27:16,828 20060901-00:27:16. main DEBUG CollectionFactory - Creating [java.util.LinkedHashSet]
    2006-09-01 00:27:16,843 20060901-00:27:16. main INFO XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/C:/work/TestExternalQuery/properties/applicationContext.xml]
    2006-09-01 00:27:17,015 20060901-00:27:17. main DEBUG DefaultDocumentLoader - Using JAXP provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl]
    2006-09-01 00:27:17,265 20060901-00:27:17. main DEBUG ResourceEntityResolver - Attempting to resolve XML Schema [http://www.springframework.org/schem...ing-beans.xsd] using [org.springframework.beans.factory.xml.PluggableSch emaResolver]
    2006-09-01 00:27:17,359 20060901-00:27:17. main ERROR Application - Failed to load Spring contexts. Line 61 in XML document from URL [file:/C:/work/TestExternalQuery/properties/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The prefix "tx" for element "tx:advice" is not bound.
    org.springframework.beans.factory.BeanDefinitionSt oreException: Line 61 in XML document from URL [file:/C:/work/TestExternalQuery/properties/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The prefix "tx" for element "tx:advice" is not bound.
    Caused by:
    org.xml.sax.SAXParseException: The prefix "tx" for element "tx:advice" is not bound.
    at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source)

  2. #2
    Join Date
    Jun 2006
    Location
    SF Bay Area, California
    Posts
    524

    Default Perhaps incorrect namespace declaration

    I wonder if your XML file has a valid declaration for namespaces. I use Eclipse 3.2 and didn't need any special configuration.

    Here is the beginning of my XML file.

    Code:
    <?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:aop="http://www.springframework.org/schema/aop"
    	xmlns:tx="http://www.springframework.org/schema/tx"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans 
    	                    http://www.springframework.org/schema/beans/spring-beans.xsd 
    	                    http://www.springframework.org/schema/tx 
    	                    http://www.springframework.org/schema/tx/spring-tx.xsd 
    	                    http://www.springframework.org/schema/aop 
    	                    http://www.springframework.org/schema/aop/spring-aop.xsd">
    Try the above snippet. If that doesn't work, perhaps you may need to upgrade to the latest Eclipse 3.2.

    -Ramnivas
    Ramnivas Laddad (Follow me on Twitter)
    AspectJ in Action: Enterprise AOP with Spring Applications (2nd edition). Now available!

  3. #3
    Join Date
    Aug 2004
    Location
    u.s.a
    Posts
    399

    Default

    The XML declaration was incorrect. I initially copied the one that appears in the Spring Reference online. I even tried tweaking it to no avail.

    Thanks.

  4. #4
    Join Date
    Jun 2006
    Location
    SF Bay Area, California
    Posts
    524

    Default

    Please file a JIRA issue so that the incorrect code snippet in the reference guide can be fixed.
    Ramnivas Laddad (Follow me on Twitter)
    AspectJ in Action: Enterprise AOP with Spring Applications (2nd edition). Now available!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •