Then the problem: I need portlet.jar to build my war but my war must not contain portlet.jar, because then arises a ClassLoader conflict.I can not delete portlet.jar from tomcat, because it is needed to other portlets.
Correct, you shouldn't include these classes in your WAR if they're provided by the application server.
If you're using Maven, mark your dependency on the portlet API as <scope>provided</scope>
. It will be available when your WAR is built, but won't be included in the WAR. If you're not using Maven, RTFM on how to achieve similar functionality with your build tool.