Servlet : SEVERE: Allocate exception for servlet

前端 未结 11 1751
故里飘歌
故里飘歌 2021-02-06 03:38

The following stacktrace is what I get when i try to access a servlet, which seems running fine from Tomcat manager.

11 Sep, 2012 11:50:12 AM org.apache.catalin         


        
11条回答
  •  暖寄归人
    2021-02-06 04:14

    If you get this error "SEVERE: Allocate exception for servlet" coupled with a "java.lang.InstantiationException" exception, make sure that your servlet class has a public no-argument constructor since the servlet container needs to be able to instantiate it.

    If your servlet class does not have an explicit non-zero argument constructor defined (which is usually the case), the default constructor provided by the compiler would suffice.

提交回复
热议问题