Note that there are some explanatory texts on larger screens.

plurals
  1. POlog4j configuration with jboss7 issue
    primarykey
    data
    text
    <p>java code</p> <pre><code> public static synchronized void init(String log4jXMLPath) //throws ServletException { try { if (!initialized) // set the global RepositorySelector { defaultRepository = LogManager.getLoggerRepository(); RepositorySelector theSelector = new AppRepositorySelector(); **LogManager.setRepositorySelector(theSelector, guard);** initialized = true; } Hierarchy hierarchy = new Hierarchy(new RootLogger(Level.DEBUG)); //loadLog4JConfig(servletContext, hierarchy); loadLog4JConfig(hierarchy, log4jXMLPath); ClassLoader loader = Thread.currentThread().getContextClassLoader(); repositories.put(loader, hierarchy); } catch (Exception e) { e.printStackTrace(); } } </code></pre> <p><strong>LogManager.setRepositorySelector(theSelector, guard);</strong> this line in java code throwing an error</p> <p>stacktrace</p> <pre><code>18:17:11,189 ERROR [stderr] (MSC service thread 1-2) java.lang.IllegalArgumentException: Attempted to reset the LoggerFactory without possessing the guard. 18:17:11,190 ERROR [stderr] (MSC service thread 1-2) at org.apache.log4j.LogManager.setRepositorySelector(LogManager.java:164) 18:17:11,191 ERROR [stderr] (MSC service thread 1-2) at com.mportal.logger.api.AppRepositorySelector.init(AppRepositorySelector.java:73) 18:17:11,192 ERROR [stderr] (MSC service thread 1-2) at com.mportal.logger.api.MPLoggerImpl.loadLogInstance(MPLoggerImpl.java:64) 18:17:11,192 ERROR [stderr] (MSC service thread 1-2) at com.mportal.logger.api.MPLoggerImpl.&lt;init&gt;(MPLoggerImpl.java:38) 18:17:11,192 ERROR [stderr] (MSC service thread 1-2) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 18:17:11,193 ERROR [stderr] (MSC service thread 1-2) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 18:17:11,194 ERROR [stderr] (MSC service thread 1-2) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 18:17:11,194 ERROR [stderr] (MSC service thread 1-2) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) </code></pre> <p>How to solve this one? Please give solutions.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload