Re: Servlet Filters registered, activated but not processing request

2019-09-14 Thread Jean-Baptiste Onofré
Hi

As said, I did a fix on pax web 7.2.10 about twice service registration. It
might help.

Regards
JB

Le sam. 14 sept. 2019 à 19:41, Nhut Thai Le  a écrit :

> We recently upgrade to pax-web 7.2.10 and i haven't seen this happen again
> yet. Even with 7.2.4 it only happened a few times, I'll post the heap dump
> and instance of Filter. However, in my question, i showed that all of my 4
> filters have been registered and they have componentId, doesnt it mean they
> are instantiated?
>
> Thai
>
> On Tuesday, September 10, 2019 at 5:04:19 AM UTC-4, Grzegorz Grzybek wrote:
>>
>> Hello
>>
>> org.ops4j.pax.web.service.internal.HttpServiceStarted#registerFilter()
>> method should correctly take service ranking into account.
>>
>> With Jetty, filters are registered (sorted by rank) inside
>> org.ops4j.pax.web.service.jetty.internal.JettyServerImpl#addFilter(), you
>> could enable "org.ops4j.pax.web.service.jetty.internal" DEBUG level to
>> check what has happened.
>>
>> Heap dump would be interesting too to check if all filters were
>> registered.
>>
>> Do you have Karaf output (if using Karaf at all) for list of services
>> with objectClass=javax.servlet.Filter?
>>
>> regards
>> Grzegorz Grzybek
>>
>> czw., 15 sie 2019 o 17:30 Nhut Thai Le  napisał(a):
>>
>>> Hello,
>>>
>>> I have 4 servlet filters for one ServletContextHelper, having the same
>>> filter pattern and they are from the same bundle and have different
>>> ranking. When starting server, i see these filters have been registered:
>>>
>>> {javax.servlet.Filter}={service.id=992, service.bundleid=405,
>>> service.scope=prototype, *service.ranking=11*,
>>> osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=
>>> *WebviewerServletContextHelper*),
>>> filter.init.excludedUrls=/zkcomet,/logout/select,/logout,
>>> osgi.http.whiteboard.filter.pattern=/*, component.name
>>> =com.castortech.iris.ba.web.filters.*BaSessionFilter*,
>>> osgi.http.whiteboard.filter.asyncSupported=true, component.id=1186}
>>>   "Registered by bundle:" 
>>> *com.castortech.iris.ba.web.filters_1.0.0.qualifier
>>> [405]*
>>>   "Bundles using service"
>>> org.ops4j.pax.web.pax-web-extender-whiteboard_7.2.4 [8]
>>> {javax.servlet.Filter}={service.id=1352, service.bundleid=405,
>>> service.scope=prototype, *service.ranking=3*,
>>> osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=
>>> *WebviewerServletContextHelper*), filter.init.excludedUrls=/zkcomet,
>>> osgi.http.whiteboard.filter.pattern=/*, component.name
>>> =com.castortech.iris.ba.web.filters.*TenantFilter*,
>>> osgi.http.whiteboard.filter.asyncSupported=true, component.id=1185}
>>>   "Registered by bundle:" 
>>> *com.castortech.iris.ba.web.filters_1.0.0.qualifier
>>> [405]*
>>>   "Bundles using service"
>>> org.ops4j.pax.web.pax-web-extender-whiteboard_7.2.4 [8]
>>> {javax.servlet.Filter}={service.id=652, service.bundleid=405,
>>> service.scope=prototype, *service.ranking=2*,
>>> osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=
>>> *WebviewerServletContextHelper*), filter.init.excludedUrls=/zkcomet,
>>> osgi.http.whiteboard.filter.pattern=/*, component.name
>>> =com.castortech.iris.ba.web.filters.*KeycloakSessionFilter*,
>>> osgi.http.whiteboard.filter.asyncSupported=true, component.id=1161}
>>>   "Registered by bundle:" 
>>> *com.castortech.iris.ba.web.filters_1.0.0.qualifier
>>> [405]*
>>>   "Bundles using service"
>>> org.ops4j.pax.web.pax-web-extender-whiteboard_7.2.4 [8]
>>> {javax.servlet.Filter}={service.id=653, service.bundleid=405,
>>> service.scope=prototype, *service.ranking=1*,
>>> osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=
>>> *WebviewerServletContextHelper*), component.name
>>> =com.castortech.iris.ba.web.filters.*AuthenticationFilterForWebViewer*,
>>> component.id=1164,
>>> keycloak.config.resolver=com.castortech.iris.ba.web.filters.BundleBasedKeycloakConfigResolver,
>>> filter.init.excludedUrls=/zkcomet, osgi.http.whiteboard
>>> .filter.pattern=/*, osgi.http.whiteboard.filter.asyncSupported=true}
>>>   "Registered by bundle:" 
>>> *com.castortech.iris.ba.web.filters_1.0.0.qualifier
>>> [405]*
>>>   "Bundles using service"
>>> org.ops4j.pax.web.pax-web-extender-whiteboard_7.2.4 [8]
>>>
>>> Normally the request is processed by all 4 filters in ascending order,
>>> but this morning, after i restart the server I see when a request come in,
>>> it arrives at the TenantFilte (ranking=3) skipping filters ranking 1 and 2.
>>>
>>> [image: filterErr1.PNG]
>>>
>>> Anyone has an idea why would this happen?
>>>
>>>
>>>
>>>
>>> --
>>> --
>>> --
>>> OPS4J - http://www.ops4j.org - op...@googlegroups.com
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "OPS4J" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to op...@googlegroups.com.
>>> To view this discussion on the web visit
>>> 

Re: Servlet Filters registered, activated but not processing request

2019-09-14 Thread Nhut Thai Le
We recently upgrade to pax-web 7.2.10 and i haven't seen this happen again 
yet. Even with 7.2.4 it only happened a few times, I'll post the heap dump 
and instance of Filter. However, in my question, i showed that all of my 4 
filters have been registered and they have componentId, doesnt it mean they 
are instantiated?

Thai

On Tuesday, September 10, 2019 at 5:04:19 AM UTC-4, Grzegorz Grzybek wrote:
>
> Hello
>
> org.ops4j.pax.web.service.internal.HttpServiceStarted#registerFilter() 
> method should correctly take service ranking into account.
>
> With Jetty, filters are registered (sorted by rank) inside 
> org.ops4j.pax.web.service.jetty.internal.JettyServerImpl#addFilter(), you 
> could enable "org.ops4j.pax.web.service.jetty.internal" DEBUG level to 
> check what has happened.
>
> Heap dump would be interesting too to check if all filters were registered.
>
> Do you have Karaf output (if using Karaf at all) for list of services with 
> objectClass=javax.servlet.Filter?
>
> regards
> Grzegorz Grzybek
>
> czw., 15 sie 2019 o 17:30 Nhut Thai Le > 
> napisał(a):
>
>> Hello,
>>
>> I have 4 servlet filters for one ServletContextHelper, having the same 
>> filter pattern and they are from the same bundle and have different 
>> ranking. When starting server, i see these filters have been registered:
>>
>> {javax.servlet.Filter}={service.id=992, service.bundleid=405, 
>> service.scope=prototype, *service.ranking=11*, 
>> osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=
>> *WebviewerServletContextHelper*), 
>> filter.init.excludedUrls=/zkcomet,/logout/select,/logout, 
>> osgi.http.whiteboard.filter.pattern=/*, component.name
>> =com.castortech.iris.ba.web.filters.*BaSessionFilter*, 
>> osgi.http.whiteboard.filter.asyncSupported=true, component.id=1186}
>>   "Registered by bundle:" 
>> *com.castortech.iris.ba.web.filters_1.0.0.qualifier 
>> [405]*
>>   "Bundles using service"
>> org.ops4j.pax.web.pax-web-extender-whiteboard_7.2.4 [8]
>> {javax.servlet.Filter}={service.id=1352, service.bundleid=405, 
>> service.scope=prototype, *service.ranking=3*, 
>> osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=
>> *WebviewerServletContextHelper*), filter.init.excludedUrls=/zkcomet, 
>> osgi.http.whiteboard.filter.pattern=/*, component.name
>> =com.castortech.iris.ba.web.filters.*TenantFilter*, 
>> osgi.http.whiteboard.filter.asyncSupported=true, component.id=1185}
>>   "Registered by bundle:" 
>> *com.castortech.iris.ba.web.filters_1.0.0.qualifier 
>> [405]*
>>   "Bundles using service"
>> org.ops4j.pax.web.pax-web-extender-whiteboard_7.2.4 [8]
>> {javax.servlet.Filter}={service.id=652, service.bundleid=405, 
>> service.scope=prototype, *service.ranking=2*, 
>> osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=
>> *WebviewerServletContextHelper*), filter.init.excludedUrls=/zkcomet, 
>> osgi.http.whiteboard.filter.pattern=/*, component.name
>> =com.castortech.iris.ba.web.filters.*KeycloakSessionFilter*, 
>> osgi.http.whiteboard.filter.asyncSupported=true, component.id=1161}
>>   "Registered by bundle:" 
>> *com.castortech.iris.ba.web.filters_1.0.0.qualifier 
>> [405]*
>>   "Bundles using service"
>> org.ops4j.pax.web.pax-web-extender-whiteboard_7.2.4 [8]
>> {javax.servlet.Filter}={service.id=653, service.bundleid=405, 
>> service.scope=prototype, *service.ranking=1*, 
>> osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=
>> *WebviewerServletContextHelper*), component.name
>> =com.castortech.iris.ba.web.filters.*AuthenticationFilterForWebViewer*, 
>> component.id=1164, 
>> keycloak.config.resolver=com.castortech.iris.ba.web.filters.BundleBasedKeycloakConfigResolver,
>>  
>> filter.init.excludedUrls=/zkcomet, osgi.http.whiteboard.filter.pattern=/*, 
>> osgi.http.whiteboard.filter.asyncSupported=true}
>>   "Registered by bundle:" 
>> *com.castortech.iris.ba.web.filters_1.0.0.qualifier 
>> [405]*
>>   "Bundles using service"
>> org.ops4j.pax.web.pax-web-extender-whiteboard_7.2.4 [8]
>>
>> Normally the request is processed by all 4 filters in ascending order, 
>> but this morning, after i restart the server I see when a request come in, 
>> it arrives at the TenantFilte (ranking=3) skipping filters ranking 1 and 2. 
>>
>> [image: filterErr1.PNG]
>>
>> Anyone has an idea why would this happen?
>>
>>
>>
>>
>> -- 
>> -- 
>> --
>> OPS4J - http://www.ops4j.org - op...@googlegroups.com 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "OPS4J" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to op...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ops4j/9b41870e-fcfa-4f3c-8d43-eaf94929d375%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
--