Because if we create the portlet class directly in New Portlet Project wizard by checking "Create custom portlet class", the project doesn't exist yet, so in the 3rd page which has entry category, it will throw NullPointerException. This happened in getCategory() and getEntryCategory() before.