This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes log4j file load Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "log4j file load" Watch "log4j file load" New topic
Author

log4j file load

Tmmet Johnson
Ranch Hand

Joined: Nov 03, 2004
Posts: 56
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,


<servlet>
<servlet-name>AppName</servlet-name>
<servlet-class>sorg.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: log4j file load