logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Papke (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LOG4J2-1328) JMX setting for ConfigLocationUri does not pick the right classloader for "classpath:" locations
Date Wed, 23 Mar 2016 07:09:25 GMT
Thomas Papke created LOG4J2-1328:

             Summary: JMX setting for ConfigLocationUri does not pick the right classloader
for "classpath:" locations
                 Key: LOG4J2-1328
                 URL: https://issues.apache.org/jira/browse/LOG4J2-1328
             Project: Log4j 2
          Issue Type: Bug
          Components: JMX
    Affects Versions: 2.5
            Reporter: Thomas Papke

The JMX ConfigLocationUri seems to partially struggle with “classpath:” Uris that point
to the classpath of one of the webapps (I use log4j-web.jar in the webapp). I saw that the
LoggerContextAdmin internally use “new URL(configLocation);” to load the file. So pressing
"Enter" in JMX for releading the classpath log4j configuration, fails for some webapps because
the configuration file will not be found.

Here some output from the Jconsole Mbean:
- Loading the Configlocation for the first webapp work, doing the same for the second one
fail (but the file is present in the second webapp WEB-INF/classes folder)
sorting table against column=0 ascending=true
edit: ConfigLocationUri=classpath:/log4j2-webapp1.xml
validating [row=2, column=1]: ConfigLocationUri=classpath:/log4j2-webapp1.xml
sorting table against column=0 ascending=true
edit: ConfigLocationUri=classpath:/log4j2-webapp2.xml
validating [row=2, column=1]: ConfigLocationUri=classpath:/log4j2-webapp2.xml
java.io.FileNotFoundException: Unable to load the resource [classpath:/log4j2-webapp2.xml]
using the thread context class loader or the current classs class loader
	at org.apache.naming.resources.ClasspathURLStreamHandler.openConnection(ClasspathURLStreamHandler.java:45)
	at java.net.URL.openConnection(URL.java:972)
	at java.net.URL.openStream(URL.java:1038)
	at org.apache.logging.log4j.core.jmx.LoggerContextAdmin.setConfigLocationUri(LoggerContextAdmin.java:133)

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org

View raw message