Is there a way to execute the method of a class after the deployment of my EAR?
In the EAR there is no WebProject.
I know the possibility of a ServletContextListener in a WebProject but i'd like to configure it in the EAR or in an EJB-jar if there is a way.
There are no post-deploy options, I'm answering the question assuming you'd like to run some logic when your server starts, after deployment.
You may use Startup Beans, which is a WebSphere programming extension.
A little warning if you're planning to migrate to a more recent version (like WAS 8 or 8.5); this feature (startup beans) became a part of EJB 3.1 specification, so all servers supporting this specification level, including WebSphere, already have this functionality as specified, so this feature is deprecated and you shall prefer EJB3.1 specified solution.