Hi Joao,
I have taken a look at the bug you have filed, is surely related to mine, but 
slightly different.

In my case the usage of a wildcard is not relevant: the match() method in 
EventHandlerTracker$SubPackageMatcher expects a classname (something with 
dots), while an event topic is passed and it has slashes, not dots.
Thus the match never happens, wildcard or not.

I think that you should detect the problem in your environment even trying 
**without** a wildcard: can you confirm this?

If yes, I will edit the issue that you have filed: I don't think it should be 
classified as a minor.

Thanks,

Roberto

On 2018-01-16 17:24, João Assunção <joao.assun...@exploitsys.com> wrote: 
> Hello Roberto,
> 
> A few months ago I came across the same issue.
> I think it is a bug in the EventAdmin implementation (
> https://issues.apache.org/jira/browse/FELIX-5738).
> Unfortunately, I didn't find an workwaround.
> 
> João Assunção
> 
> Email: joao.assun...@exploitsys.com
> Mobile: +351 916968984
> Phone: +351 211933149
> Web: www.exploitsys.com
> 
> 
> 
> On Tue, Jan 16, 2018 at 3:44 PM, robe...@iooota.com <robe...@iooota.com>
> wrote:
> 
> > Context: Apache Karaf 4.1.3
> >
> > Hi,
> > I'm trying to force the EventAdmin to do not propagate any event dealing
> > with the logging system, but whatever value I try with the
> > "org.apache.felix.eventadmin.IgnoreTopic" parameter gets ignored.
> >
> > I've done some debugging and this is what I've noticed:
> > - the check is performed at org.apache.felix.eventadmin.
> > impl.handler.EventAdminImpl.postEvent(org.osgi.service.event.Event) line:
> > 178, where "checkTopic(...)" is invoked
> > - checkTopic() applies a set of matchers (derived from the ".cfg" file) to
> > the topic of the event considered
> > - the matcher is implemented by org.apache.felix.eventadmin.impl.handler.
> > EventHandlerTracker$SubPackageMatcher.match(java.lang.String) line: 377
> > this way
> >
> > @Override
> > public boolean match(final String className)
> > {
> >     final int pos = className.lastIndexOf('.');
> >     return pos > -1 && className.substring(0, pos +
> > 1).startsWith(m_packageName);
> > }
> >
> > "classname" is passed as "org/osgi/service/log/LogEntry/LOG_WARNING" (the
> > event topic) and "m:packageName" is "org/osgi/service/log/." (derived from
> > "org/osgi/service/log/*" in the .cfg file).
> >
> > Whatever value I set in the .cfg file <b>pos will always be -1</b> and
> > there's nothing I can do about it, since I can't choose the logging events
> > topic string. Thus, the result will be always "false" and no event will be
> > skipped.
> >
> > What am I missing?...
> >
> > Thanks in advance,
> >
> >
> > Roberto
> >
> >
> 

Reply via email to