Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006041 [Resin] minor always 03-17-17 09:04 04-24-17 15:32
Reporter kpokrovsky View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 4.0.52 Product Version
  Product Build
Summary 0006041: com.caucho.jmx.MBeanView does not match wildcard queries
Description log4j2 can't reload mbeand due to that, because resin's mbean server can't unlink old beans.

265: private boolean isMatch(ObjectName name, ObjectName queryName, QueryExp query):
...
    if (queryName.isPropertyPattern()) {
      // If the queryName has a '*' in the properties, then check
      // the queryName properties to see if they match

      Hashtable<String,String> map = queryName.getKeyPropertyList();
      Iterator<String> iter = map.keySet().iterator();
      while (iter.hasNext()) {
        String key = iter.next();
        String value = map.get(key);

        if (! value.equals(name.getKeyProperty(key)))
          return false;
      }
    }
...

The comment is correct. But why equals on value?! No wildcard matching actually happens just plain string comparison.
Correct would be:

if (! name.getKeyProperty(key).matches(value.replace("?", ".?").replace("*", ".*?")))
          return false;
Steps To Reproduce Configure log4j2 in a web project and try to reload config using JMX. You will see an exception saying that Resin can't register log4j2 beans because they already exist.
Additional Information
Attached Files

- Relationships

- Notes
(0006748)
ferg
04-24-17 15:32

env/0119
 

- Issue History
Date Modified Username Field Change
03-17-17 09:04 kpokrovsky New Issue
03-17-17 09:06 kpokrovsky Issue Monitored: kpokrovsky
04-24-17 15:32 ferg Note Added: 0006748
04-24-17 15:32 ferg Assigned To  => ferg
04-24-17 15:32 ferg Status new => closed
04-24-17 15:32 ferg Resolution open => fixed
04-24-17 15:32 ferg Fixed in Version  => 4.0.52
04-25-17 07:27 venkatesan Issue Monitored: venkatesan
04-25-17 07:28 venkatesan Issue End Monitor: venkatesan


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
33 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker