I think I see the pertinent error message.

[main] DEBUG org.apache.felix.http.jetty - Ignoring unmatched Filter
service [javax.servlet.Filter]

Is it because I try to pick up / on my filter pattern.

On Mon, Apr 25, 2016 at 12:47 PM, David Daniel <[email protected]>
wrote:

> Carsten,
>
>  I tried to register as a whiteboard service for the filter like this
>
>         final HazelcastSessionFilter sessionFilter = new
> HazelcastSessionFilter();
>         final Dictionary<String, Object> filter1Props = new
> Hashtable<String, Object>();
>
> filter1Props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_PATTERN,
> "/");
>
> filter1Props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT,
>                 "(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME
> + "=sessionFilter)");
>         bc.registerService(Filter.class, sessionFilter, filter1Props);
>
> this comes from the example here
>
>
> https://github.com/apache/felix/blob/trunk/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/Activator.java
>
> The init function is never called.  Am I doing something wrong.  Here are
> my log messages
>
> [INFO] Started Jetty 9.2.14.v20151106 at port(s) HTTP:8084 on context path
> / [minThreads=8,maxThreads=200,acceptors=1,selectors=4]
> [INFO] Detected extended HttpService. Filters enabled.
> [INFO] Http service whiteboard started
> org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator]
> : Enabling SLF4J API support.
> org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator]
> : Enabling Jakarta Commons Logging API support.
> org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator]
> : Enabling Log4J API support.
> org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator]
> : Enabling Avalon Logger API support.
> org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator]
> : Enabling JULI Logger API support.
> org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator]
> : Enabling Log4J v2 API support. Ignored FQCN:
> org.apache.logging.log4j.spi.AbstractLogger
> [WARNING] Deprecation warning: Filter registered through Apache Felix
> whiteboard service: [javax.servlet.Filter]. Please change your code to the
> OSGi Http Whiteboard Service.
> [DEBUG] Reusing context with id []
>
> I am not sure if that filter registered is the correct filter or my cors
> filter but my assumption is that it is the session filter.
>
> On Sat, Apr 23, 2016 at 11:19 AM, Carsten Ziegeler <[email protected]>
> wrote:
>
>> David Daniel wrote
>> > I noticed ExtHttpService is deprecated.  Is there a better way to
>> register
>> > a filter now than the example here
>> >
>> http://felix.apache.org/documentation/subprojects/apache-felix-http-service.html
>> >
>>
>> Yes, the documentation is totally outdated. There is the Http Whiteboard
>> Specification - it's part of the OSGi Compendium R6 and this is how you
>> should do these things today.
>>
>> I think the examples in svn are updated. I'll probably update the docs
>> in some weeks if no one beats me to it.
>>
>> Regards
>> Carsten
>> --
>> Carsten Ziegeler
>> Adobe Research Switzerland
>> [email protected]
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>

Reply via email to