The problem is you are trying to preserve state
. That is, you are trying to maintain data either between requests for the same user (or perhaps shared among all users?)
The Servlet is designed to be stateless. Meaning each time it runs it should not "remember" anything from any previous execution. The advantages of stateless classes are primarily performance and scalability. The best practice is to only use instance variables for read-only constants, which should be declared final
To persist state for a single user, store it in the session if it is small, else store it in a persistent store (like a database).
To persist state to be shared among multiple users, you have other options. A singleton design pattern is useful as long as you understand there will be one per server. In other words many web applications are hosted on more than one server to offer high availability, so there will be a singleton on each server.
If that does not meet your requirements, a database is probably your best bet. There are more complex solutions, like distributed cashes, as well.