Hi, I have a web project and the web project has an ejb jar included in its build path.The ejb project automatically loads the log4j.properties which is located in ejbModule folder. I have the below in web.xml.My question is , since, I have load-on startup set to 2, the log4j.properties that comes with struts.jar will be loaded first and then, the log4j.properties in ejb project will be loaded .Is that correct? Could anyone please let me know? Thanks in advance,
The number in the load-on-startup stanza refers to the order in which servlets will be loaded. Since you only have one servlet, specifying 2 just means that the servlet will be loaded when the web application starts up. It has no significance in deciding whether it gets loaded before or after the EJB jar file.
Whether the war file or the EJB jar file will be loaded first is not specified in the J2EE spec, and can vary by app server. I use WebSphere, and in every instance I've monitored, it loads the EJB jar before the war file if they are part of the same EAR file. It may be different for your app server, though. You can tell by monotoring the System Out log as the server starts up. There will be a log entry for every entity as it starts up.