[pax-web] 6.0.2 issues registering servlet filters

2017-03-09 Thread Lukas Rohner
 

Hi all


After updating pax-web from 4.2.8 to 6.0.2 by using Karaf 4.1.0 I have 
problem with the whiteboard extender. I see intermittent issues with 
registering servlet filters. Any ideas why this happens? Maybe it's a 
regression.


Lukas


2017-03-10 08:27:42,545 | ERROR | (Felix) - Bundle 
org.ops4j.pax.web.pax-web-extender-whiteboard [298] EventDispatcher: Error 
during dispatch. (java.lang.IllegalArgumentException: Filter 
[org.opencastproject.kernel.rest.CleanSessionsFilter@374df63 is not 
currently registered in any context)

java.lang.IllegalArgumentException: Filter 
[org.opencastproject.kernel.rest.CleanSessionsFilter@374df63 is not 
currently registered in any context

at 
org.ops4j.pax.web.service.spi.model.ServiceModel.removeFilter(ServiceModel.java:196)
 
[302:org.ops4j.pax.web.pax-web-spi:6.0.2]

at 
org.ops4j.pax.web.service.internal.HttpServiceStarted.unregisterFilter(HttpServiceStarted.java:620)
 
[301:org.ops4j.pax.web.pax-web-runtime:6.0.2]

at 
org.ops4j.pax.web.service.internal.HttpServiceProxy.unregisterFilter(HttpServiceProxy.java:241)
 
[301:org.ops4j.pax.web.pax-web-runtime:6.0.2]

at 
org.ops4j.pax.web.extender.whiteboard.internal.element.FilterWebElement.unregister(FilterWebElement.java:74)
 
[298:org.ops4j.pax.web.pax-web-extender-whiteboard:6.0.2]

at 
org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.unregisterWebElement(WebApplication.java:406)
 
[298:org.ops4j.pax.web.pax-web-extender-whiteboard:6.0.2]

at 
org.ops4j.pax.web.extender.whiteboard.internal.WebApplication$$Lambda$227/1119206991.accept(Unknown
 
Source) [298:org.ops4j.pax.web.pax-web-extender-whiteboard:6.0.2]

at java.util.ArrayList.forEach(ArrayList.java:1249) [?:?]

at 
org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.addWebElement(WebApplication.java:171)
 
[298:org.ops4j.pax.web.pax-web-extender-whiteboard:6.0.2]

at 
org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.addingService(AbstractTracker.java:154)
 
[298:org.ops4j.pax.web.pax-web-extender-whiteboard:6.0.2]

at 
org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.addingService(AbstractTracker.java:41)
 
[298:org.ops4j.pax.web.pax-web-extender-whiteboard:6.0.2]

at 
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
 
[?:?]

at 
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
 
[?:?]

at 
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) 
[?:?]

at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) 
[?:?]

at 
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
 
[?:?]

at 
org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)
 
[?:?]

at 
org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
 
[?:?]

at 
org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
 
[?:?]

at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557) [?:?]

at org.apache.felix.framework.Felix.registerService(Felix.java:3549) [?:?]

at 
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348)
 
[?:?]

at 
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:322)
 
[?:?]

at 
org.opencastproject.kernel.rest.RestPublisher.createEndpoint(RestPublisher.java:278)
 
[77:matterhorn-kernel:2.2.0.SNAPSHOT]

at 
org.opencastproject.kernel.rest.RestPublisher$JaxRsServiceTracker.addingService(RestPublisher.java:427)
 
[77:matterhorn-kernel:2.2.0.SNAPSHOT]

at 
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
 
[?:?]

at 
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
 
[?:?]

at 
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) 
[?:?]

at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) 
[?:?]

at 
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
 
[?:?]

at 
org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)
 
[?:?]

at 
org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
 
[?:?]

at 
org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
 
[?:?]

at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557) [?:?]

at org.apache.felix.framework.Felix.registerService(Felix.java:3549) [?:?]

at 
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348)
 
[?:?]

at 
org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:887)
 
[186:org.apache.felix.scr:2.0.8]

at 
org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:874)
 
[186:org.apache.felix.scr:2.0.8]

at 

Re: [pax-exam] Data for tests?

2017-03-09 Thread sorok...@gmail.com
TinyBundle and BNDlib _were_ required as options in the test setup 
(@Configuration method) from what I could tell, or I got errors at runtime when 
the OSGi framework went looking for TinyBundle classes needed by the test 
resource bundle. Perhaps due to the asynchronous loading in that bundle? I will 
double-check, though.

I really like the idea of an includeMavenResources() option as you describe. 
That's exactly what I expected and wanted. If I understood more about how the 
test probe is built, I would offer to work on that now. But I can do that in 
the future, if it seems like that's the best plan.

---
A. Soroka
The University of Virginia Library



> On Mar 8, 2017, at 4:13 AM, 'Christoph Läubrich' via OPS4J 
>  wrote:
> 
> I think an option to include a resource into the test-probe is the most 
> generic, simple and natural way. For special and/or advanced usage szenarios 
> the tinybundle option can still be used.
> Maybe it would even be possible to have (as an extra) some sort of 
> includeMavenResources() option that builds on top of this feature and fetches 
> all resources from scr/test/resources/ and includes them since that is what 
> one would exspect when working with maven.
> 
> BTW: are TinyBundle and BND lib are really required in the test-runtime 
> (=Test Setup)? Normally they should only be needed on construction time 
> (=test classpath).
> 
> Am 03.03.2017 19:41, schrieb sorok...@gmail.com:
>> This was a fantastic idea! Thank you, Christoph Läubrich.
>> 
>> I ended up building a dynamic bundle using TinyBundle containing my test 
>> resources just the way I want them arranged, and injecting it like any other 
>> bundle. I use a symbolic name to pick it back up inside the container and 
>> use the resources.
>> 
>> One note: I did need to put TinyBundle and BNDlib into the container to 
>> support my test resource bundle, but that wasn't a big deal. I will pack 
>> that part into a new Option or even pack the whole kit and kaboodle into a 
>> some kind of "TestResourceOption". Would this be a useful PR, or would folks 
>> rather have (as Christoph Läubrich mentions) the ability to directly include 
>> resources into the test probe (which does seem a bit simpler)?
>> 
>> Thanks, OPS4J folks!
>> 
>>   
> 
> -- 
> -- 
> --
> OPS4J - http://www.ops4j.org - ops4j@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 ops4j+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
--
OPS4J - http://www.ops4j.org - ops4j@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 ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.