On my current project there is used 4 WLS startup classes to populate caches and initialize singeltons.However I don't like this because :(used API specific to WLS and app. server classpath is poluted->no full redeployment all appl., because EJBs depend on this startup classes)
I am planning to introduce StartupWebApplication. Which is simple WebApp with 1 startup servlet (set loadonstartup=1 in web.xml. On servlet there is init hook to create and bind objects into JNDI. Destroy method unbinds these from JNDI.
EJB should be changed to lookup the JNDI for these static objects, if they want to read it.
One problem is J2EE1.3 server first deploys EJBs and on second place deploys (and runs my startup servlet)WebApplications.
Is it necessary for EJBs,while deploying EJBs, to have access to the JNDI binded objects ? (because I expect the objects are bind in WebApp after EJB deployment).
What if I d like to introduce JNDI objects caching in setSessionContext or ejbCreate methods, so that I csn not perform expensive lookups into JNDI everytime.