java - Myeclipse中创建servlet配置web.xml,访问servlet类时一直提示500
PHP中文网
PHP中文网 2017-04-18 10:26:44
0
4
831

Myeclipse中创建servlet配置web.xml,访问servlet类时一直提示HTTP Status 500 - Error instantiating servlet class sevlet.test.AServlet
xml配置改了很多次,网上也查了很久,不知道为什么一直有问题。

访问时500错误

异常信息

PHP中文网
PHP中文网

认证0级讲师

reply all(4)
PHPzhong

class not found. Check if your container cannot find this class. No, check if the output classpath of src is not set properly

黄舟
  • 500 error reason

An error occurred during the execution of the service method of the requested Servlet, and the program cannot continue to run.

  • Possible reasons

  1. Servlet does not inherit HttpServlet or implement the Servlet interface

  2. The <servlet-class> in the web.xml file is written incorrectly and does not match the real package name and class name

  3. The code in the service method throws an exception when running

  • Analysis of your situation

From the screenshot information you gave (the one where Tomcat starts to load), we can basically conclude that the red line in the content is an error in the specified class in the <servlet-class> tag of your web.xml file. Please check and confirm.

PHPzhong

sevlet.test.Aservlet sevlet Look at the package name of Aservlet

Peter_Zhu

Errors of 500 usually indicate a problem with the code. You have to start looking at the code

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template