Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8360713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:31:59+00:00 2026-06-09T11:31:59+00:00

I am creating a HelloWorld web/spring application from scratch. I have followed this tutorial

  • 0

I am creating a HelloWorld web/spring application from scratch. I have followed this tutorial in order to learn how to use the mvc pattern. So, after finished all steps and starts to run the application I received this error in console:

Grave: Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 11 in XML document from ServletContext resource
[/WEB-INF/dispatcher-servlet.xml] is invalid; nested exception is
org.xml.sax.SAXParseException; lineNumber: 11; columnNumber: 100;
cvc-complex-type.2.4.c

Searching around SO question I found some threat like below but have not resolved my error.

  • Cannot find the declaration of element 'beans' in internet offline mode
  • Spring Security beginner's question. Build failed

So, I deduced that could be the dispatcher-servlet.xml at WEB-INF folder. This xml looks like:

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


    <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix">
            <value>/WEB-INF/jsp/</value>
        </property>

        <property name="suffix">
            <value>.jsp</value>
        </property>
    </bean>

    <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="interceptors">
            <list>
                <ref local="localeChangeInterceptor" />
            </list>
        </property>

        <property name="urlMap">
            <map>
                <entry key="/hello.html">
                    <ref bean="helloController" />
                </entry>
            </map>
        </property>

    </bean>

    <bean id="helloController" class="controllers.HelloController">
    </bean>

    <bean id="localeChangeInterceptor"
        class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">

        <property name="paramName" value="hl" />

    </bean>

    <bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
    </bean>

</beans>

Finally these are my included jars:

commons-logging-1.1.1.jar

org.springframework.aop-3.1.2.RELEASE.jar
org.springframework.asm-3.1.2.RELEASE.jar
org.springframework.aspects-3.1.2.RELEASE.jar
org.springframework.beans-3.1.2.RELEASE.jar
org.springframework.context-3.1.2.RELEASE.jar
org.springframework.context.support-3.1.2.RELEASE.jar
org.springframework.core-3.1.2.RELEASE.jar
org.springframework.expression-3.1.2.RELEASE.jar
org.springframework.instrument-3.1.2.RELEASE.jar
org.springframework.instrument.tomcat-3.1.2.RELEASE.jar
org.springframework.jdbc-3.1.2.RELEASE.jar
org.springframework.jms-3.1.2.RELEASE.jar
org.springframework.orm-3.1.2.RELEASE.jar
org.springframework.oxm-3.1.2.RELEASE.jar
org.springframework.spring-library-3.1.2.RELEASE.libd
org.springframework.test-3.1.2.RELEASE.jar
org.springframework.transaction-3.1.2.RELEASE.jar
org.springframework.web-3.1.2.RELEASE.jar
org.springframework.web.portlet-3.1.2.RELEASE.jar
org.springframework.web.servlet-3.1.2.RELEASE.jar
org.springframework.web.struts-3.1.2.RELEASE.jar

spring-webmvc-3.0.5.RELEASE.jar

Thanks in advance

EDIT 1:

After make the changes of @Biju Kunjummen, looks like now the problem is that there is a comflic in bean declaration:

Grave: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Cannot resolve reference to bean 'helloController' while setting bean property 'urlMap' with key [TypedStringValue: value [/hello.html], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloController' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [controllers.HelloController]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: 
    The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
    Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor
    String cannot be resolved to a type

I have checked the controller and looks fine into src/controllers dir:

package controllers;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

public class HelloController implements Controller {

    public ModelAndView handleRequest(HttpServletRequest request,
              HttpServletResponse response) throws ServletException, IOException {

              String Mess = "Hello World!";

              ModelAndView modelAndView = new ModelAndView("hello");
              modelAndView.addObject("message", Mess);

              return modelAndView;
              }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:32:00+00:00Added an answer on June 9, 2026 at 11:32 am

    You have the http://www.springframework.org/schema/mvc as the default, but your bean definitions belong to the http://www.springframework.org/schema/beans namespace, that should be the issue.

    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans xmlns="http://www.springframework.org/schema/mvc"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:beans="http://www.springframework.org/schema/beans"
    ...">
    
    
    <beans:bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <beans:property name="prefix">
            <beans:value>/WEB-INF/jsp/</beans:value>
        </beans:property>
    

    …..

    Or make beans namespace the default this way:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns:mvc="http://www.springframework.org/schema/mvc"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://www.springframework.org/schema/beans"
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
           http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
    
    
        <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="prefix">
                <value>/WEB-INF/jsp/</value>
            </property>
    
            <property name="suffix">
                <value>.jsp</value>
            </property>
        </bean>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm creating a very simple (hello World quality) web application using spring mvc 3.0.
Using this tutorial: http://www.c-sharpcorner.com/uploadfile/UrmimalaPal/creating-a-windows-phone-7-application-consuming-data-using-a-wcf-service/ I have created sample/hello world application on the windows phone
I just read a good tutorial at http://cateof.wordpress.com/2009/09/27/helloworld-air-application-in-linux/ about creating simple apps with AIR/FLEX.
Does anyone have a hello world sample or tutorial for creating an Eclipse plugin
I am trying to learn how to write more dynamic web sites that use
Just creating my first IntelliJ web application that runs on tomcat. The project ran
I have an application named HelloWorld installed, yet not deployed. Its state is Installed
Good morning, I am trying to local test my web application, which makes use
I am creating a web service with spring + jetty + cxf using the
I'm having trouble with a synchronous AJAX request. I am creating a web application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.