Spring DM 2.0 Environment configuration solves log4j problem

Source: Internet
Author: User
Tags log4j

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

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.