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

  • Home
  • SEARCH
  • 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 572281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:35:48+00:00 2026-05-13T13:35:48+00:00

Trying to configure spring 3 MVC, here is what I did so far: I

  • 0

Trying to configure spring 3 MVC, here is what I did so far:

I added all the spring 3.0 libraries to my netbeans project.

My web.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <servlet>
        <servlet-name>WebApplication1</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>WebApplication1</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>    
</web-app>

Next I created a WebAppliation1-servlet.xml, also in my /web-inf folder:

<?xml version="1.0" encoding="UTF-8"?>
<!--
 - DispatcherServlet application context for PetClinic's web tier.
-->
<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:context="http://www.springframework.org/schema/context"
  xmlns:oxm="http://www.springframework.org/schema/oxm"
  xsi:schemaLocation="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
    http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd">

 <!--
  - The controllers are autodetected POJOs labeled with the @Controller annotation.
 -->
 <context:component-scan base-package="org.springframework.Hi"/>

 <!--
  - The form-based controllers within this application provide @RequestMapping
  - annotations at the type level for path mapping URLs and @RequestMapping
  - at the method level for request type mappings (e.g., GET and POST).
  - In contrast, ClinicController - which is not form-based - provides
  - @RequestMapping only at the method level for path mapping URLs.
  -
  - DefaultAnnotationHandlerMapping is driven by these annotations and is
  - enabled by default with Java 5+.
 -->



 <!--
  - This bean resolves specific types of exceptions to corresponding logical
  - view names for error views. The default behaviour of DispatcherServlet
  - is to propagate all exceptions to the servlet container: this will happen
  - here with all other types of exceptions.
 -->
 <bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
  <property name="exceptionMappings">
   <props>
    <prop key="org.springframework.web.servlet.PageNotFound">pageNotFound</prop>
    <prop key="org.springframework.dao.DataAccessException">dataAccessFailure</prop>
    <prop key="org.springframework.transaction.TransactionException">dataAccessFailure</prop>
   </props>
  </property>
 </bean>


 <!--
  - The BeanNameViewResolver is used to pick up the visits view name (below).
  - It has the order property set to 2, which means that this will
  - be the first view resolver to be used after the delegating content
  - negotiating view resolver.
  -->
 <bean class="org.springframework.web.servlet.view.BeanNameViewResolver" p:order="1"/>
 <!--

  - This bean configures the 'prefix' and 'suffix' properties of
  - InternalResourceViewResolver, which resolves logical view names
  - returned by Controllers. For example, a logical view name of "vets"
  - will be mapped to "/WEB-INF/jsp/vets.jsp".
 -->
 <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/jsp/"
   p:suffix=".jsp" p:order="2"/>



</beans>

I then created a simple welcome.jsp in the folder /WEB-INF/jsp/welcome.jsp

I then created a package:

org.springframework.Hi

And I created a TestController.java file:

package org.springframework.Hi;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;


@Controller
public class TestController {


    @RequestMapping("/")
    public String welcomeHandler(){
        return "welcome";
    }

}

I wanted this to work w/o any file extensions, so I don’t have to end my urls with xxx.htm etc.

So when I run the netbeans project I get the error:

type Status report

message Servlet WebApplication1 is not available

description The requested resource (Servlet WebApplication1 is not

available) is not available.

What exactly am I missing here?

Tomcat logs

Thanks for the feedback

My tomcat logs show this:

SEVERE: Servlet /WebApplication1 threw load() exception
java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
        at org.springframework.web.servlet.DispatcherServlet.<clinit>(DispatcherServlet.java:207)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
  • 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-05-13T13:35:49+00:00Added an answer on May 13, 2026 at 1:35 pm

    I’m asuming that error message you quoted was the error message the browser sees when it tries to access the application. This is because it didn’t deploy properly.

    You need to look through the web server startup logs, that will give you much more information as to why it didn’t deploy.

    edit: OK, that helps a lot… you need to add Apache Commons Logging to your classpath.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to configure and Maven multi-module project with Spring / JPA. Here's the
I am trying to configure Spring MVC programmatically instead of xml files. Almost everything
I'm trying to write a web application using Spring MVC. I have a configuration
I am trying to configure Spring Security in my simple application. Here is my
I'm trying to use Spring to configure a web app deployed in JBoss. I've
I'm trying to configure ASP.NET MVC 2 RC and Spring .NET 1.3 to use
I'm trying to configure a Spring config (xml) file and am trying to add
I was trying to configure spring 3.1 and hibernate. I have written a simple
I'm trying to configure a class with Annotation based configuration in Spring 3, which
I am trying to configure the NCommon NHRepository in my project with Structure Map.

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.