Spring xml problem

后端 未结 2 1786
梦如初夏
梦如初夏 2021-02-14 08:34

I\'m trying to write a simple Spring AOP app, but I have problem with the xml configuration.

My xml:




&         


        
相关标签:
2条回答
  • 2021-02-14 09:24

    Change the <beans declaration at the top of the XML to look like this:

    <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"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
    

    You're just adding this "http://www.springframework.org/schema/aop/spring-aop-3.0.xsd". The xsi:schemaLocation attribute is just a bunch of pairs. The first of each pair is a schema URI, the second is the URL where the schema can be found. You can think of it as a map: key, then value.

    0 讨论(0)
  • 2021-02-14 09:36

    The xsi:schemaLocation attribute must have an even number of URIs. Each pair associates a namespace URI with the location of the XSD. Your xsi:schemaLocation contains three URIs, so it is invalid. This is what the message is telling you.

    You need to provide the location of the XSD for http://www.springframework.org/schema/aop

    0 讨论(0)
提交回复
热议问题