XML document from ServletContext resource is invalid

The console throws me this error

ERROR: org.springframework.web.servlet.DispatcherServlet - Context initialization failed

Line 23 in XML document from ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml] is invalid

This is my servlet-context file

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <annotation-driven />

    <resources mapping="/resources/**" location="/resources/" />

    <beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <beans:property name="prefix" value="/WEB-INF/views/" />
        <beans:property name="suffix" value=".jsp" />

    <context:component-scan base-package="mvc.test.hib" />

What i'm missing? i'm quite new to programming with spring/hibernate and there is things that still i don't understand very well

EDIT: additonal details, i'm using Spring tool suite, and the default MVC spring template project.


The file you have posted is only 21 lines, whereas the error message you've given is saying that line 23 is invalid. Assuming that you lost a couple of line breaks in posting the file though, it looks like your missing a close tag for the <beans:beans> declaration. Add the following to the end of your file and the xml syntax will be valid.


You'll find it easier to write XML if you use an IDE (e.g. Eclipse) or a text editor which has inbuilt XML validation (e.g. Notepad++ with the XML Tools plugin). This will make it easier and faster for you to find syntax errors.

Need Your Help

CALayer and drawRect

core-animation calayer nsview drawrect nstextfield

I'm completely new to Core Animation, CALayer and all this stuff, so bear with me.

ExecutorService and SwingWorker

java swing model-view-controller swingworker executors

I have looked all over for this answer, but can not seem to find it, so apologies if this is a dumb question. Please be gentle.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.