Log4j Error A
here for a quick overview of the site Help Center Detailed answers to any error the class "org.apache.log4j.appender" was loaded by questions you might have Meta Discuss the workings and policies could not instantiate appender named "stdout". of this site About Us Learn more about Stack Overflow the company Business Learn more about a "org.apache.log4j.consoleappender" object is not assignable hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack could not instantiate appender named "console" Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up log4j:ERROR A “org.apache.log4j.ConsoleAppender” object is not assignable to a “org.apache.log4j.Appender” variable up vote 10 down vote favorite 1 I am making a web app using gradle. I used log4j in this app. When I build the project I am getting error... 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 [org.powermock.core.classloader.MockClassLoader@16a40b2] whereas object of type log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [sun.misc.Launcher$AppClassLoader@5e3a78ad]. log4j:ERROR Could not instantiate appender named "stdout". I still did not find a good answer. And I forgot to say, My project build correctly and show log massages correctly. It doesn't work only on test classes. java exception logging log4j gradle share|improve this question edited Jan 16 '14 at 4:58 asked Jan 13 '14 at 11:58 kasunsk 7331720 The ConsoleAppender class is somehow getting loaded by a classloader from PowerMock and not correctly linked to the base Appender type. –chrylis Jan 13 '14 at 12:06 add a comment| 3 Answers 3 active oldest votes up vote 8 down vote accepted Adding this annotation works for me. @PowerMockIgnore("org.apache.log4j.*") share|improve this answe
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 http://stackoverflow.com/questions/21090735/log4jerror-a-org-apache-log4j-consoleappender-object-is-not-assignable-to-a 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 https://web.liferay.com/community/forums/-/message_boards/message/4922841 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
not work correctly without it enabled. Please turn JavaScript back on and reload this page. All Places > JBoss AS > Installation, Configuration & Deployment > Discussions Please enter a https://developer.jboss.org/thread/198505 title. You can not post a blank message. Please type your message and try again. 2 Replies Latest reply on Jun 28, 2012 11:02 AM by António Ribeiro Log4j configuration rajasekharba Apr 17, 2012 3:31 PM Hi,I have added following appender to the jboss-log4j.xml and calling logger could not like below and getting error message. No log4j.jar included in code or libararyError message : 15:15:30,000 ERROR [STDERR] log4j:ERROR A "org.jboss.logging.appender.FileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.15:15:30,000 ERROR [STDERR] log4j:ERROR The class "org.apache.log4j.Appender" was loaded by15:15:30,000 ERROR [STDERR] log4j:ERROR [BaseClassLoader@1116f9{vfszip:/C:/jboss-eap-5.1/jboss-as/server/default/deploy/abc.ear/}] whereas object of type15:15:30,000 ERROR [STDERR] could not instantiate log4j:ERROR "org.jboss.logging.appender.FileAppender" was loaded by [org.jboss.bootstrap.NoAnnotationURLClassLoader@19616c7].15:15:30,000 ERROR [STDERR] log4j:ERROR Could not instantiate appender named "FILE".Jboss-log4j.xml - appender-------------------------------------