错误提示:The prefix "asp" for element "asp:config" is not bound.我查了下,都是说需要加入声明
xmlns:aop=”http://www.springframework.org/schema/aop”
然后还需要在“xsi:schemaLocation”中指定aop配置的schema的地址
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"
可是一开始就加了。却总是报错,我不知道是啥子情况了
我用的是myeclipse 2013 ,它自带有添加spring框架,我选的是spring 3.0的,然后自动导入了很多JAR包
我看其中就有spring aop的,不过里面是3.0.5.RELEASE版本,
开始我这么命名和指定地址的时候,用注解的方式,成功试了AOP。
现在用XML配置尝试就不行了。然后我把地址换成了
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.5.RELEASE.xsd"
错误依旧。不知道咋回事,求同仁们帮忙了。
万分感谢springaopmyeclipse

解决方案 »

  1.   


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

  2.   


    这是我的
    <?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:p="http://www.springframework.org/schema/p"
    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/context
        http://www.springframework.org/schema/context/spring-context.xsd 
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
      

  3.   

    <?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:p="http://www.springframework.org/schema/p"
    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/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd 
    http://www.springframework.org/schema/aop 
    http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
    <bean id="myInterceptor" class="com.xml.spring_aop.MyInterceptor"/>
    <bean id="personService" class="com.Interfc.imple.PersonServiceBean"/>
    <asp:config>
    <aop:aspect id="myaop" ref="myInterceptor">
    <aop:pointcut id="allMethod" expression="execution(* com.Interfc.imple.PersonServiceBean.*(..))"/>
    <aop:before method="doAcessCheck" pointcut-ref="allMethod"/>
     <aop:after method="doafterReturning" pointcut-ref="allMethod"/>
     </aop:aspect>
    </asp:config>

    </beans>
      

  4.   

    这个头文件你最好去spring的jar中找出来,里面都有的,打开这个xsd文件,注释里面就有这些东西,直接copy过来就行了。
      

  5.   

    xmlns:p="http://www.springframework.org/schema/p"这是什么东西???
    没见过啊。
      

  6.   

    我用的myeclipse 2013...自带一些功能。可是呢,自带的功能总是出问题-。-我都习惯了,以前弄struts 2的时候也有出现自身的BUG~~~-。-
      

  7.   

    你少东西了吧???看我的<beans 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: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-3.2.xsd
               http://www.springframework.org/schema/context
               http://www.springframework.org/schema/context/spring-context-3.2.xsd
               http://www.springframework.org/schema/tx
               http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
               http://www.springframework.org/schema/aop 
               http://www.springframework.org/schema/aop/spring-aop-3.2.xsd">
      

  8.   

    我用的myeclipse 2013...自带一些功能。可是呢,自带的功能总是出问题-。-我都习惯了,以前弄struts 2的时候也有出现自身的BUG~~~-。-我还是建议用eclipse,手动配,出毛病也好找出来,myeclipse太自动化了也不好,而且还卡
      

  9.   

    我用的myeclipse 2013...自带一些功能。可是呢,自带的功能总是出问题-。-我都习惯了,以前弄struts 2的时候也有出现自身的BUG~~~-。-我还是建议用eclipse,手动配,出毛病也好找出来,myeclipse太自动化了也不好,而且还卡
    确实有些卡。早就想换了。-。-
      

  10.   

    我用的myeclipse 2013...自带一些功能。可是呢,自带的功能总是出问题-。-我都习惯了,以前弄struts 2的时候也有出现自身的BUG~~~-。-我还是建议用eclipse,手动配,出毛病也好找出来,myeclipse太自动化了也不好,而且还卡
    开始我一直用的就是eclipse,后来被同学搞出问题了。然后自己解决了一阵子实在没办法了。就重装。然后呢,他就说要不你要myeclipse吧,我这有最新版-。-然后我就上当了。
      

  11.   

    我用的myeclipse 2013...自带一些功能。可是呢,自带的功能总是出问题-。-我都习惯了,以前弄struts 2的时候也有出现自身的BUG~~~-。-我还是建议用eclipse,手动配,出毛病也好找出来,myeclipse太自动化了也不好,而且还卡
    确实有些卡。早就想换了。-。-我以前用的就是myeclipse,太卡了,就换回eclipse了,一个插件也不装,全裸奔,那速度没得说啊!xml代码除了头文件找源文件外,都是自己一个个敲出来的,还可以练出写代码的速度啊,一举两得啊。只是等工作了公司就用myeclipse,这个没办法,不过用归用,好习惯不能丢啊
      

  12.   

    加进去了。。还是不行~~别和我的一样啊,把3.2改成你的版本
    当然改成我的3.0了其实我把3.2的jar包也弄进去了。。
      

  13.   

    错误提示:The prefix "asp" for element "asp:config" is not bound.
    一直这个错误。。没变过
      

  14.   

    你那错误提示是The prefix "aop" for element "aop:config" is not bound.吧???也就是找不到aop的schema,看看少aop包了没有???
      

  15.   

    必须看了呀。3.0和3.2的都有,3.0是添加spring的时候就自动倒进去了。3.2是我自己添加的
      

  16.   

    错误提示:The prefix "asp" for element "asp:config" is not bound.
    一直这个错误。。没变过怎么可能是这个错误???asp应该是aop啊,可能是你那里写错了再好好找找
      

  17.   

    错误提示:The prefix "asp" for element "asp:config" is not bound.
    一直这个错误。。没变过怎么可能是这个错误???asp应该是aop啊,可能是你那里写错了再好好找找
    我真瞎了。。是<aop:config>
    我特么怎么弄成asp:config。怒草。。
      

  18.   

    还是那个asp的错误???这不科学啊
      

  19.   

    错误提示:The prefix "asp" for element "asp:config" is not bound.
    一直这个错误。。没变过怎么可能是这个错误???asp应该是aop啊,可能是你那里写错了再好好找找
    我真瞎了。。是<aop:config>
    我特么怎么弄成asp:config。怒草。。我就说嘛配置写错了刚才我还想呢,怎么会是asp呢。
      

  20.   

    错误提示:The prefix "asp" for element "asp:config" is not bound.
    一直这个错误。。没变过怎么可能是这个错误???asp应该是aop啊,可能是你那里写错了再好好找找
    我真瞎了。。是<aop:config>
    我特么怎么弄成asp:config。怒草。。我就说嘛配置写错了刚才我还想呢,怎么会是asp呢。
    真是人老了不服老不行了。。我这才踏入这条路-。-难道就要终结?
      

  21.   

    错误提示:The prefix "asp" for element "asp:config" is not bound.
    一直这个错误。。没变过怎么可能是这个错误???asp应该是aop啊,可能是你那里写错了再好好找找
    我真瞎了。。是<aop:config>
    我特么怎么弄成asp:config。怒草。。我就说嘛配置写错了刚才我还想呢,怎么会是asp呢。
    真是人老了不服老不行了。。我这才踏入这条路-。-难道就要终结?不会吧???弱弱问一下哈!多大了你,怎么这时候才学这玩意儿?以前是干哪一块儿的啊???
      

  22.   

    错误提示:The prefix "asp" for element "asp:config" is not bound.
    一直这个错误。。没变过怎么可能是这个错误???asp应该是aop啊,可能是你那里写错了再好好找找
    我真瞎了。。是<aop:config>
    我特么怎么弄成asp:config。怒草。。我就说嘛配置写错了刚才我还想呢,怎么会是asp呢。
    真是人老了不服老不行了。。我这才踏入这条路-。-难道就要终结?不会吧???弱弱问一下哈!多大了你,怎么这时候才学这玩意儿?以前是干哪一块儿的啊???
    21-。-大学还没毕业。。现在在实习呢。。
      

  23.   

    错误提示:The prefix "asp" for element "asp:config" is not bound.
    一直这个错误。。没变过怎么可能是这个错误???asp应该是aop啊,可能是你那里写错了再好好找找
    我真瞎了。。是<aop:config>
    我特么怎么弄成asp:config。怒草。。我就说嘛配置写错了刚才我还想呢,怎么会是asp呢。
    真是人老了不服老不行了。。我这才踏入这条路-。-难道就要终结?不会吧???弱弱问一下哈!多大了你,怎么这时候才学这玩意儿?以前是干哪一块儿的啊???
    21-。-大学还没毕业。。现在在实习呢。。擦,以为你30多了,正想崇拜你一下呢你不错了,我22学的java,零基础,自学一年后的现在找了一份软件开发的工作,算是入行了,我是大四,也没毕业呢
      

  24.   

    错误提示:The prefix "asp" for element "asp:config" is not bound.
    一直这个错误。。没变过怎么可能是这个错误???asp应该是aop啊,可能是你那里写错了再好好找找
    我真瞎了。。是<aop:config>
    我特么怎么弄成asp:config。怒草。。我就说嘛配置写错了刚才我还想呢,怎么会是asp呢。
    真是人老了不服老不行了。。我这才踏入这条路-。-难道就要终结?不会吧???弱弱问一下哈!多大了你,怎么这时候才学这玩意儿?以前是干哪一块儿的啊???
    21-。-大学还没毕业。。现在在实习呢。。擦,以为你30多了,正想崇拜你一下呢你不错了,我22学的java,零基础,自学一年后的现在找了一份软件开发的工作,算是入行了,我是大四,也没毕业呢
    哇噢~我也大四哦~
      

  25.   

    错误提示:The prefix "asp" for element "asp:config" is not bound.
    一直这个错误。。没变过怎么可能是这个错误???asp应该是aop啊,可能是你那里写错了再好好找找
    我真瞎了。。是<aop:config>
    我特么怎么弄成asp:config。怒草。。我就说嘛配置写错了刚才我还想呢,怎么会是asp呢。
    真是人老了不服老不行了。。我这才踏入这条路-。-难道就要终结?不会吧???弱弱问一下哈!多大了你,怎么这时候才学这玩意儿?以前是干哪一块儿的啊???
    21-。-大学还没毕业。。现在在实习呢。。擦,以为你30多了,正想崇拜你一下呢你不错了,我22学的java,零基础,自学一年后的现在找了一份软件开发的工作,算是入行了,我是大四,也没毕业呢
    哇噢~我也大四哦~加我qq吧,我的帐号就是,认识一下,共同学习!!!怎么样???
      

  26.   

    错误提示:The prefix "asp" for element "asp:config" is not bound.
    一直这个错误。。没变过怎么可能是这个错误???asp应该是aop啊,可能是你那里写错了再好好找找
    我真瞎了。。是<aop:config>
    我特么怎么弄成asp:config。怒草。。我就说嘛配置写错了刚才我还想呢,怎么会是asp呢。
    真是人老了不服老不行了。。我这才踏入这条路-。-难道就要终结?不会吧???弱弱问一下哈!多大了你,怎么这时候才学这玩意儿?以前是干哪一块儿的啊???
    21-。-大学还没毕业。。现在在实习呢。。擦,以为你30多了,正想崇拜你一下呢你不错了,我22学的java,零基础,自学一年后的现在找了一份软件开发的工作,算是入行了,我是大四,也没毕业呢
    哇噢~我也大四哦~加我qq吧,我的帐号就是,认识一下,共同学习!!!怎么样???
    最近正是急缺同道中人。
      

  27.   

    你没太理解xml头文件的含义,要是弄明白了,就不会出这个错了