Springs Element 'beans' cannot have character [children], because the type's content type is element-only

前端 未结 14 1624
北恋
北恋 2021-02-18 13:17

I search some page in stackoverflow to solve this problem, did follow some true answer but not working. I am new in spring , sorry. here is my dispatcher-servlet



        
相关标签:
14条回答
  • I had the same problem and I resolved it by validating my xml using the online xml validation tool and found out that there was an extra whitespace which was the cause for the error.

    0 讨论(0)
  • 2021-02-18 13:51

    for me I mistyped a character somewhere in the xml file . just remove it and the error gone.

    0 讨论(0)
  • 2021-02-18 13:54

    Follow the below steps outlined and you should be able to resolve it :

    1. Try to open the xml in Internet Explorer or any xml view tool and see whether the xml is rendered properly.
    2. Or you can do a ctrl + shift + F to format the xml file and see if xml is well formed or not.
    3. With the above step you should be able to find the exact location where you need to make changes to make the xml well formed.
    4. In my case I had to just remove the extra "<" closing tag to resolve the issue.
    0 讨论(0)
  • 2021-02-18 13:56

    I got the same problem. Realized it is due to some unknown spaces that my IDE couldn't recognize. Opened it in Sublime text and corrected the spaces. Works perfectly now.

    0 讨论(0)
  • 2021-02-18 14:01

    I got similar error. The way how I fixed it was replacing:

    <property name="param">true</property>
    

    on

    <property name="param" value="true"/>
    
    0 讨论(0)
  • 2021-02-18 14:03

    I had the same problem. I looked at it for hours. I could not find any problem. Then I decided, sometimes you see something different if you use a different editor. I closed Netbeans and opened the file in emacs. I immediately saw, there were some kind of non-breaking space characters, or tabs, or some type of whitespace that wasn't whitespace. I don't know which character it was but it showed up in red in emacs, but was whitespace in Netban

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