请问为什么会报这种错

来源:4-1 Spring Bean装配之Bean的定义及作用域的注解实现

慕莱坞6472995

2018-06-09 21:49

https://img4.mukewang.com/5b1bda9000018bfc09440595.jpg

https://img4.mukewang.com/5b1bdaaf00010dd510860095.jpg

请问各位为什么会出现这个情况

写回答 关注

4回答

  • Parva
    2018-10-24 20:42:47

    相信楼主已经解决了,我也遇到相同问题也解决了,发出来给后人看。

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

    问题出在这一行,楼主图片里的多出了个空格。


  • Linzhao
    2018-06-09 22:58:16

    <?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:context="http://www.springframework.org/schema/context"

    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/aop 

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

    http://www.springframework.org/schema/tx

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

    http://www.springframework.org/schema/context

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

    <context:component-scan base-package="theo.advisor"></context:component-scan>


    </beans>



    这个你直接复制粘贴用看看。不懂你为什么会那样。

    Linzha... 回复慕莱坞647...

    ?改成你的包名。(没事,闲着呢!)

    2018-06-09 23:28:29

    共 2 条回复 >

  • Linzhao
    2018-06-09 22:49:36

    https://img2.mukewang.com/5b1be8c20001b64d06200021.jpg这一句

    慕莱坞647...

    这是myeclipse加入spring框架4.1的时候自动创建的,不是我自己加上去的,真crazy

    2018-06-09 22:58:22

    共 1 条回复 >

  • Linzhao
    2018-06-09 22:19:31

    Linzha... 回复慕莱坞647...

    我也不是很懂,你怎么多了一句

    2018-06-09 22:49:15

    共 2 条回复 >

Spring入门篇

为您带来IOC和AOP的基本概念及用法,为后续高级课程学习打下基础

268773 学习 · 963 问题

查看课程

相似问题