Servlet ClassNotFoundException when present in a package ... Why?

52 views Asked by At

When i am keeping the "MyServletProgram" in "java" package i get ClassNotFoundException java.MyServletProgram but when it is in default package, the program runs fine. Can you suggest where i am going wrong??

This is Servlet class

This is the project heirarchy

This is the navigator view of project

My classpaths

The error when accessing through /MyServletProgram

1

There are 1 answers

0
Neeraj Jain On BEST ANSWER

You can not name a package as java , since it is prohibited

You are likely to get an exception :

java.lang.SecurityException: Prohibited package name: java

Change you package name to something else and it will work flawlessly .