Liferay Error Could Not Instantiate Appender Named Console
English » 1. Installation / Deployment / Setup Recent Posts Statistics RSS (Opens New Window) Answer (Unmark) Mark as an Answer Threads [ Previous | Next ] Temporary solution for the log4j classloader ERROR for Liferay plugins Frank Yu May 3, 2010 5:49 PM RE: Temporary solution for the log4j classloader ERROR for Liferay plugins Firas BD November 11, 2011 6:41 AM RE: Temporary solution for the log4j classloader ERROR for Liferay plugins Jose Jimenez March 26, 2015 6:21 AM Temporary solution for the log4j classloader ERROR for Liferay plugins May 3, 2010 5:49 PM Answer Frank Yu Rank: New Member Posts: 14 Join Date: June 30, 2008 Recent Posts Portlets such as solr-web-5.2.7.1.war don't have log4j.jar, logging.properties, and log4j.properties packaged in the war file.When the portlet is hot deployed in Liferay, however, the above three files are added by Liferay to the following folders:tomcat-6.0.18\webapps\solr-web\WEB-INF\classes\log4j.propertiestomcat-6.0.18\webapps\solr-web\WEB-INF\classes\logging.propertiestomcat-6.0.18\webapps\solr-web\WEB-INF\lib\log4j.jarBecause the portlets and Liferay core use two different classloaders (WebappClassLoader and StandardClassLoader), you will see the following error message in Tomcat console:log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.log4j:ERROR The class "org.apache.log4j.Appender" was loaded bylog4j:ERROR [WebappClassLoader delegate: false repositories: /WEB-INF/classes/----------> Parent Classloader:org.apache.catalina.loader.StandardClassLoader@1ac1fe4] whereas object of typelog4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [WebappClassLoader delegate: false repositories: /WEB-INF/classes/----------> Parent Classloader:org.apache.catalina.loader.StandardClassLoader@1ac1fe4].log4j:ERROR Could not instantiate appender named "CONSOLE".This is a Liferay deployment bug. See the JIRA ticket at: http://issues.liferay.com/browse/LPS-9376There are two ways to fix this issue:1. Add the following log4j.xml file to ****-portlet\docroot\WEB-INF\src folder so that log4j.xml will be packaged to webapps\****-portlet\WEB-INF\classes folder when the packaged .war is hot deployed. Lucidchart Diagram ExportXMLWordPrintable Details Type: Bug Status: Closed Resolution: Fixed Affects Version/s: 6.2.X EE Fix Version/s: 6.2.X EE Component/s: Portal Services, Search Infrastructure, Search Infrastructure > SOLR Impl Labels: QA-F Branch Version/s: 6.2.x Backported to Branch: Committed Story Points: 20 Description showing in deployment logs: log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.Poo lingClientConnectionManager). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more in fo. Issue Links causes LPS-55435 Solr4 - logging: https://web.liferay.com/community/forums/-/message_boards/message/4922841 @liferay.home@ is not resolved in log4j.xml: solr-adapter.log is created in wrong path Closed Activity All Comments Work Log History Activity Transitions Ascending order - Click to sort in descending order Hide Permalink Shitian "Shelton" Zhang added a comment - 22/Oct/14 1:32 AM FAILED Manual Testing using the following steps: Set up solr. https://issues.liferay.com/browse/LPS-50924 Deploy solr4-web to portal. Copy jars to /solr4-web/WEB-INF/lib. Reproduced on: Tomcat 7.0.42 + MySQL 5.5.34. Portal ee-6.2.x EE GIT ID: e1e04d8100f3b2c09aa08011585b348de80d45b8. Plugins ee-6.2.x GIT ID: d04b6893c2ff8a8179805d1c5da7e2405b09954d. After deploy, there are: log4j.jar log4j-extras.jar slf4j-api.jar When copy jcl-over-slf4j.jar and slf4j-log4j12.jar (from solr), these appear in console: 06:55:50,069 INFO [localhost-startStop-1][HotDeployImpl:217] Deploying solr4-web from queue 06:55:50,070 INFO [localhost-startStop-1][PluginPackageUtil:1016] Reading plugin package for solr4-web Oct 22, 2014 6:55:50 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable. log4j:ERROR The class "org.apache.log4j.Appender" was loaded by log4j:ERROR [WebappClassLoader context: /solr4-web delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@3435cf9c ] whereas object of type log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [WebappClassLoader context: delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@3435cf9c ]. log4j:ERROR Could not instantiate appender named "CONSOLE". Failed on: Tomcat 7.0.42 + MySQL 5.5.34. Portal ee-6.2.x EE GIT ID: b25f9ea2306508f883ad111abe4d4976263bb537. Plugins ee-6.2.x GIT ID: a8391f58beb5d7a66971d98c4748e18e493afe2b. After deploy, there are: log4j.jar slf4j-api.jar help others com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering https://samebug.io/exceptions/553442/com.liferay.portal.kernel.deploy.hot.HotDeployException/error-registering-portlets-for-my-portlet?soft=false portlets for my-portlet liferay.com | 9 months ago 0 mark [LPS-9376] The deploy process added log4j.jar at /lib for any plugins - Liferay Issues https://coderanch.com/t/63230/open-source/log-log-WARN-appenders-logger liferay.com | 9 months ago com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for my-portlet find similars Liferay Portal Service 0 0 mark The deploy liferay error process added log4j.jar for any plugins. This will cause errors in tomcat like following. log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable. log4j:ERROR The class "org.apache.log4j.Appender" was loaded by log4j:ERROR [WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@1ac1fe4 ] whereas object of type log4j:ERROR "org.apache.log4j.ConsoleAppender" liferay error could was loaded by [WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@1ac1fe4 ]. log4j:ERROR Could not instantiate appender named "CONSOLE". How to fix it? change the deployment process. Liferay Issues | 6 years ago | Jonas Yuan com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for my-portlet find similars Liferay Portal Service 0 0 mark The deploy process added log4j.jar for any plugins. This will cause errors in tomcat like following. log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable. log4j:ERROR The class "org.apache.log4j.Appender" was loaded by log4j:ERROR [WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@1ac1fe4 ] whereas object of type log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [WebappClassLoader delegate: false repositories: /WEB-INF/classes/ ----------> Parent Classloader: org.apache.catalina.loader.StandardClassLoader@1ac1fe4 ]. log4j:ERROR Could not instantiate appender named "CONSOLE". How to fix it? change the deployment process. Liferay Issues | 6 years ago | Jonas Yuan com.liferay.portal.kernel.deploy.hot.HotDeployException: E Certification Databases Caching Books Engineering Languages Frameworks Products This Site Careers Other all forums Forum: Other Open Source Projects log4j: log4j:WARN No appenders could be found for logger (org.apache.commons.digester Peter Primrose Ranch Hand Posts: 755 posted 9 years ago I wonder what causes this error message: log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax). log4j:WARN Please initialize the log4j system properly. but when I do: log.info(......) I can see the output on the console, any idea? Ulf Dittmer Rancher Posts: 42968 73 posted 9 years ago The message means that the log4j.properties file was not found. Printing logging output to the console (or rather System.out) is the fallback if the logging is not otherwise initialized. Kamal Ahmed Ranch Hand Posts: 91 posted 9 years ago This indicates that if you look in your log4j properties file, the Logger is not assigned an appender, here is a sample log4j.properties that works, compare this with the one you have: log4j.rootLogger=DEBUG, testAppender log4j.appender.testAppender=com.webmethods.sc.logging.log4j.WmDailyFileAppender log4j.appender.testAppender.file=log/test1.log log4j.appender.testAppender.datePattern='.'yyyy-MM-dd_HH_mm log4j.appender.testAppender.Append=false log4j.appender.testAppender.layout=com.webmethods.sc.log4j.PatternLayout log4j.appender.testAppender.layout.ConversionPattern=%m%n #Prevent internal log4j DEBUG messages from polluting the output. log4j.logger.org.apache.log4j.PropertyConfigurator=INFO log4j.logger.org.apache.log4j.config.PropertySetter=INFO log4j.logger.org.apache.log4j.FileAppender=INFO Peter Primrose Ranch Hand Posts: 755 posted 9 years ago ok....this is my log4j.properites file: log4j.rootLogger=ERROR, stdout, runwayAppender # SqlMap logging configuration... log4j.logger.com.ibatis=DEBUG log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG log4j.logger.java.sql.Connection=DEBUG log4j.logger.java.sql.Statement=DEBUG log4j.logger.java.sql.PreparedStatement=DEBUG log4j.logger.java.sql.ResultSet=DEBUG # Console output... log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender