Common Errors with Solution

  1. Null Pointer Exception at line…

    Solution :

    • Check line number at which null pointer occur

    • Apply break point on line (before of Null pointer line no.) e.g. at 23 null pointer is occurred. apply break point at 22

    • By debugging check which value is null. it may be variable or Object containing Null value.

  2. Array out of bound exception…

    Solution :

    • This error occurred if we are accessing arrays value before giving or initializing array.

    • Or if you are accessing array location greater than of declared size of arrays.

  3. Address already in use: JVM Bind –Server Error

    This error is occurred during server startup and due that server is unable to start.

    The cause is due to our server which is already running or started and we are starting again.

    Solution :

    • To resolve this problem stop server from where it is started or just restart your machine.

  4. Driver class not Found Exception –JDBC error

    Solution :

    • Make sure that mysql.jar file is added into java build path properly.

    • For web project put mysql.jar in lib folder and then add to build path always. Instead of adding into build path directly.

  5. Bad version in .class File

    This error is occurred. If we are running class on one jdk version and that class is compiled from different jdk version.

    Solution :

    • This error is also occurred in web project running on server. At that time ensure that jre of project and jre of tomcat server is must be same.