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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content