500 error on Servlet instantiation

Asked

Viewed 59 times

0

Hello.

I am trying to make a Servlet, but Tomcat does not find this Servlet class. The error is:

HTTP Status 500 - Error instantiating Servlet class server.First--------------------------------------------------------------------------------

server is the package and Primeiraquestao is the class.

Follows the error of web-app.xml code:

<?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_3_0.xsd"
    id="WebApp_ID" version="3.0">
    <display-name>teds</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>

    <servlet>
        <servlet-name>questaoum</servlet-name>
        <servlet-class>servidor.PrimeiraQuestao</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>questaoum</servlet-name>
        <url-pattern>/questaoum</url-pattern>
    </servlet-mapping>

</web-app>
  • 1

    Put the folder structure, it is likely that you have put in the missing class name something or you have put the class in the wrong folder.

  • @Guilherme Nascimento type of project is Dinamic web project. In the structure I didn’t change anything, except to create the server package and the jsp folder inside the web-content folder.

  • That’s what I need to know, in which folder you created, edit the question and put the structure, can be up to a print (one of the few cases that print helps rsrs), this already helps.

No answers

Browser other questions tagged

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