When you define a class you have to tell the classloader in which package you want to create it. This restriction is in place to avoid opening security holes by allowing people to define classes that the container could use in place of the container-specific ones it has generated. Don't bother too much about that, just know that you are not allowed to do that if you want your beans to be portable across application servers