java - Run main in a project from EAR project -


i working on ear project jboss eap 6.4, , need run lines of code upon deployment of project. trying add project belonging ear project, java main class, , setting on project on run/debug settings. not working.

so question is, how can run main class, or piece of code upon ear project deployment.

thanks!!

if want run lines of code upon deployment of project can use following options:

(1) override servletcontextlistener methods, contextinitialized(servletcontextevent sce) method invoked automatically during server start up. this preferable approach.

(2) use code inside servlet init(), called during servlet initialization time

(3) use static initializer main class run code during class loading time of server container.

the preferred approach option(1), can here servletcontextlistener


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -