rushead [
http://community.jboss.org/people/rushead] created the discussion
"Best way to initialize environment on deployment / startup?"
To view the discussion, visit:
http://community.jboss.org/message/616310#616310
--------------------------------------------------------------
I am trying to port my war file from JBoss AS 5.1 to JBoss AS 7.
To provide a correct resource management I have to initialize my specific environment when
the war file is deployed, before the Servlets are instantiated.
I already tried 2 ways:
1. Implementation of the environment initialization in a ServletContextListener* The
#contextInitialized is called when all Servlet are instantiated --> little too late...
2. Implementation of the environment initialization in another Servlet (in #init), use
"<load-on-startup>"* The implemented servlet is always initialized after
the normal Servlet (<load-on-startup> is ignored?!)
* The only difference between the two servlets is that the StartupServlet is implementing
Servlet the "old" way and the real Servlet is using JaxWS (@WebService)
And now my questions:
* Why is the ServletContextListener called when all Servlets are instantiated?
* Why is "<load-on-startup>" ignored when the implementation differ only
in the WS implementation?
* Last but not least: What is the best and usual way to initialize a custom environment
for several servlets in a war file?* The initialization / startup servlet should run on
Tomcat also if possible...
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/616310#616310]
Start a new discussion in JBoss AS7 Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]