The problem of setting up the Spring DM 2.0 Environment log4j problem Solving method is
First, the introduction of SpringDM2.0 bundle, the final completion as shown:
Note: To introduce Slf4j.api, slf4j.log4j, slf4j.org.apache.commons.logging and org.apache.log4j, these four are related jars of SPRINGDM log processing. However, only the introduction of these four, at this time the log system will still not start normally, the details look at the following article.
At this point, the following warning will be reported:
1. osgi> Log4j:warn No appenders could be found for logger ( Org.springframework.osgi.extender.internal.activator.ContextLoaderListener).
2. Log4j:warn Initialize the log4j system properly.
This indicates that the log system is still not booting properly. After a night of torture, finally found in SPRINGDM2.0M1 's own sample of the solution, specifically as follows:
1, create a fragment project;
The jar (com.springframesource.org.apache.log4j) as shown should be selected at this time:
2, add log4j.properties;
Add the Log4j.properties file under the SRC directory of the new Fragment Project project that you just created.
Start again, OK, the log system is normal! The startup information is as follows:
By the way: I introduced SPRINGDM bundle in the beginning, the Com.springsource.net.sf.cglib-2.1.3.jar also introduced, causing some strange mistakes, remember not to introduce it OK!
Spring DM 2.0 Environment configuration solves log4j problem