laura
laura

Reputation: 2135

How to detect error in spring mvc

Below is a view of the package explorer of my project. I get this error on the project root and i am not able to find which is the problem. The project runs correctly without any error in the stack trace. enter image description here

Upvotes: 0

Views: 223

Answers (3)

devops
devops

Reputation: 9187

Try to open the "Problems" view.

Window -> Show View -> Problems (or Other -> General -> Problems)

Problems view

in this view you will find a list with errors and warnings.

Upvotes: 1

A4L
A4L

Reputation: 17595

  1. Make sure that your pom.xml contains this dependency (see the version)

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
    </dependency>
    
  2. Make sure that your web.xml stats with the following schema declaration

    <?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"
        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">
    
  3. Make sure that your Facet config for Dynamic Web Module is set to 2.5.

Hit Alt+F5 to refresh the maven Project.

If you get stuck on step 3, try to delete the project from eclipse (without deleting the content!) and reimport it as maven project.

Although if your just starting up, I would recommend using a newer version of the servlet spec (at least 3.0).

Upvotes: 1

Mukus
Mukus

Reputation: 5033

There are a couple things to check (not in any order though)-

  1. View pages. This normally isn't really an error, but eclipse keeps complaining.
  2. Errors in anything apart from the views and the java source files. For example config files. This may or may not be an issue. I've been able to run with an error showing on web.xml. It worked fine on Tomcat 7 while it failed on Tomcat 6.

I am assuming there is no error in importing libraries and anything in the source because the application compiles, builds and runs without any error.

Upvotes: 0

Related Questions