Servlet configured with annotations not loaded

Asked

Viewed 42 times

1

I have the following class:

public class SpringServlet extends AbstractAnnotationConfigDispatcherServletInitializer{

    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{};
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{WebAppConfiguration.class,JPAConfiguration.class};
    }

    @Override
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }

}

My Serrvlet is not loaded when I upload the application, returning me Error 404. Do you have any idea why? In my log there is no error. I used Spring with xml and I’m trying to learn how to use with annotations.

I am using Tomcat7.

  • 1

    where is the note ?

  • @Cristianurbainski what note? I am following examples from a book and the annotated classes are Webappconifguration and Jpaconfiguration. In the Servlet class there is no annotation. As soon as possible I edit the question added the Webappconfiguration and Jpaconfiguration code

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.