Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.5
-
None
-
None
Description
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 setAttribute(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 setAttribute(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) ...