Read this article on the Internet, write well, help me solve the problems I encountered. So I reproduced him. Log4j:warn No Appenders could is found for logger Log4j:warn please initialize the log4j system properly. After "normal" configuration log4j, start Tomcat to report the above error. See this message to me the feeling is that in the Log4j.properties property file, not found with the specified logger corresponding to the Appender, let me initialize log4j. But I've already specified the properties file in the environment variable log4j.properties, each time you run start Tomcat or report the above information. Although it is warn information, and the log can be normal output, but the psychological or awkward, it is certainly in the configuration of the environment when there is a problem. In general, the program reports the error message, I think it is a human problem, not a computer problem. So I began to look for the wrong journey in an arduous way. Search the Internet for relevant error messages, found that there are many similar posts, although the error message slightly different, but the common is the above warning message. The relevant solutions written in it are also not very effective. This problem tortured me for a long time, depressed. Inadvertently see such a word, "a clean running environment for the program, is very important." "Suddenly I have a kind of enlightened feeling, handsome." Maybe I put the jar bag in the wrong place. However, the place is set aside. That's where the problem is, and there's probably no place to put it. This is a common problem in the programmer's work, in the context of running many programs, where the jar package may be everywhere, if not in time to clean up, will be the next development of the program is not necessarily when, produce unexpected impact. Back to the point, now I think of the problem is that it is possible that when the program has not read the Log4j.properties property file I specified, it has started to run the log4j-related Log4j-1.2.8.jar file, so the report does not initialize the warning message. So where exactly is the early implementation of the Log4j-1.2.8.jar file? What aroused my greatest suspicion was the jar file under C:/borland/jbuilder2005/thirdparty/jakarta-tomcat-5.0.27/common/lib. As it turns out, when I remove this jar file, the message never appears again when I start Tomcat from the new run. Now come back and think about whyThis will happen. My own analysis may be due to the following reasons. Because it is a third-party software that is integrated in JBuilder, when you start Tomcat in JBuilder, first he automatically finds the jar file under Common/lib in the project's own folder, and if so, load it and then find conf/ Log4j.properties and other related configuration files, which is why the information that is not initialized is reported. If you do not find the project in the Common/lib to use the jar file, first configure the conf/under the configuration file, and then to the project itself contained in the LIB to find the use of the jar file, then the first log4j initialization work done, So at this point, when you start Tomcat, you are no longer prompted for a warning message that is not initialized. Summary: When configuring a variety of operating environments, do not think that the jar file will be used to copy all the relevant Lib folder, it will save a lot of things, take it for granted that will automatically call, but when the relevant configuration has a sequence of time, will bring a lot of unnecessary trouble and unexpected problems. So be fully aware of the purpose of the jar file and where he should be. Tip: You can set the following two variables in an environment variable catalina_opts-dlog4j.configuration=file:/c:/borland/jbuilder2005/thirdparty/ Jakarta-tomcat-5.0.27/conf/log4j.properties CLASSPATH C:/borland/jbuilder2005/lib/log4j-1.2.8.jar; But after I run successfully, I will delete these two variables, the program is still normal operation. If there are problems with your program running, it is recommended that you add the two environment variables.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.