IllegalAccessError when initializing log4j extras Logger on EAP6

Solution Verified - Updated -

Issue

  • The following error when trying to initiate the Logger with DOMConfigurator.configureAndWatch():
java.lang.IllegalAccessError: tried to access class org.apache.log4j.xml.XMLWatchdog from class org.apache.log4j.xml.DOMConfigurator
  • The following error when trying to initiate the Logger that uses log4j extras functionality (e.g. TimeBasedRollingPolicy) with DOMConfigurator.configureAndWatch():
java.lang.IllegalAccessError: tried to access class org.apache.log4j.xml.DOMConfigurator$1 from class org.apache.log4j.xml.DOMConfigurator

Environment

Red Hat JBoss Enterprise Application Platform 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.