Severity: Exception sending context initialized event to listener instance of class [Myjava.myservletcontextlistener] Java.lang. NullPointerException

Source: Internet
Author: User

The above error is what I encountered when customizing the servlet listener, and I'll start with a general description of what I'm going to do (I'm just beginning to learn, if there's a mistake, please correct me):

In order to count the number of site visits, prevent the server restart, the original access is zeroed, so the custom listener class, implement the Servletcontextlistener interface, after the server stopped,

Put the current number of visits to the project under the Count/count.txt, the problem is out here, the Count/count.txt file is not placed in the Webroot directory, so hint null pointing to the exception

Put the file under Webroot and it's OK.

Remark: Beginner small white, please teach more!

Severity: Exception sending context initialized event to listener instance of class [Myjava.myservletcontextlistener] Java.lang. NullPointerException

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.