The solution to log4j problems caused by setting up the spring DM 2.0 Environment is:
1. Introduce the bundle of springdm2.0, as shown in the following figure:
Note: slf4j. API, slf4j. log4j, slf4j.org. Apache. commons. logging, and org. Apache. log4j are jar related to springdm log processing. However, the log system cannot be started normally when only the four are introduced. For more information, see the following document.
At this time, the following warning will be reported:
1. osgi> log4j: warn no appenders cocould be found for logger (Org. springframework. osgi. extender. Internal. activator. contextloaderlistener ).
2. log4j: Warn please initialize the log4j system properly.
This indicates that the log system is still not started properly. After one night of suffering, I finally found a solution in the sample of springdm2.0m1, as shown below:
1. CreateFragment Project;
In this case, select jar (com.springframesource.org. Apache. log4j) as shown in ):
2. Add log4j. properties;
Add the log4j. properties file under the src directory of the newly created fragment project.
Start again. OK. The log system is normal! The startup information is as follows:
By the way: I introduced springdm bundle at the beginning, the com.springsource.net. SF. cglib-2.1.3.jar is also introduced in, caused some strange errors, remember not to introduce it OK!