Hello,

I'll put the breakpoint at addErrorPageModel and check the value when this
error happen again.
About the prototype, i use it because both R6 and R7 recommends in section
140.5

Thai

On Tue, Sep 10, 2019 at 3:29 AM Grzegorz Grzybek <[email protected]>
wrote:

> Hello
>
> We have:
>  –
> org.ops4j.pax.web.itest.undertow.WhiteboardR6IntegrationTest#testErrorServlet
>  –
> org.ops4j.pax.web.itest.jetty.WhiteboardR6IntegrationTest#testErrorServlet
>  –
> org.ops4j.pax.web.itest.tomcat.WhiteboardR6IntegrationTest#testErrorServlet
>
> which tests servlet with "osgi.http.whiteboard.servlet.errorPage = [
> "404", "442", "5xx", "java.io.IOException" ]". This test never failed with
> such exception...
>
> Questions:
>  – did you try debugging and checking what's passed in
> org.ops4j.pax.web.service.spi.model.ServiceModel#addErrorPageModel? (e.g.,
> value of org.ops4j.pax.web.service.spi.model.ContextModel#classLoader)
> inside ErrorModel?
>  – why do you use scope = prototype?
>
> regards
> Grzegorz Grzybek
>
> wt., 3 wrz 2019 o 16:46 Nhut Thai Le <[email protected]> napisał(a):
>
>> Hello,
>>
>> We are using pax-web-extender-whiteboard 7.2.4 on equinox and I have a
>> few error page servlet annotated as followed:
>> @Component(
>> service = Servlet.class,
>> property = {
>> HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME + "=Error403Servlet",
>> "alias=/error403",
>> "osgi.http.whiteboard.servlet.errorPage=403",
>> "osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name
>> =WebviewerServletContextHelper)"
>> },
>> scope = ServiceScope.PROTOTYPE
>> )
>> public final class Error403Servlet extends HttpServlet {...}
>>
>> However, sometimes when we start the server, we got this error:
>>
>> java.lang.IllegalArgumentException 
>> <http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+illegalargumentexception>:
>>  Error 
>> <http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+error>
>>  page for [403] already registered.
>>      at 
>> org.ops4j.pax.web.service.spi.model.ServiceModel.addErrorPageModel(ServiceModel.java:315)
>>      at 
>> org.ops4j.pax.web.service.internal.HttpServiceStarted.registerErrorPage(HttpServiceStarted.java:961)
>>      at 
>> org.ops4j.pax.web.service.internal.HttpServiceProxy.registerErrorPage(HttpServiceProxy.java:343)
>>      at 
>> org.ops4j.pax.web.extender.whiteboard.internal.element.ServletWebElement.register(ServletWebElement.java:107)
>>      at 
>> org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.registerWebElement(WebApplication.java:392)
>>      at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
>>      at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
>>      at java.util.ArrayList 
>> <http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+arraylist>$ArrayListSpliterator.forEachRemaining(Unknown
>>  Source)
>>      at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
>>      at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
>>      at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown 
>> Source)
>>      at 
>> java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown 
>> Source)
>>      at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
>>      at java.util.stream.ReferencePipeline.forEach(Unknown Source)
>>      at 
>> org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.addWebElement(WebApplication.java:170)
>>      at 
>> org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.addingService(AbstractTracker.java:193)
>>      at 
>> org.ops4j.pax.web.extender.whiteboard.internal.tracker.AbstractTracker.addingService(AbstractTracker.java:46)
>>      at 
>> org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
>>      at 
>> org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
>>      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.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
>>      at 
>> org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:920)
>>      at 
>> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
>>      at 
>> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
>>      at 
>> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
>>      at 
>> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
>>      at 
>> org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
>>      at 
>> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
>>      at 
>> org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:469)
>>      at 
>> org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:887)
>>      at 
>> org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:874)
>>      at 
>> org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132)
>>      at 
>> org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:941)
>>      at 
>> org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:741)
>>      at 
>> org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:675)
>>      at 
>> org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:430)
>>      at 
>> org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:657)
>>      at 
>> org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:341)
>>      at org.apache.felix.scr.impl.Activator 
>> <http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+activator>.loadComponents(Activator
>>  
>> <http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+activator>.java:390)
>>      at org.apache.felix.scr.impl.Activator 
>> <http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+activator>.access$200(Activator
>>  
>> <http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+activator>.java:54)
>>      at org.apache.felix.scr.impl.Activator 
>> <http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+activator>$ScrExtension.start(Activator
>>  
>> <http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+activator>.java:265)
>>      at 
>> org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:254)
>>      at 
>> org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:227)
>>      at 
>> org.apache.felix.utils.extender.AbstractExtender.addingBundle(AbstractExtender.java:187)
>>      at 
>> org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:469)
>>      at 
>> org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:1)
>>      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.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
>>      at 
>> org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908)
>>      at 
>> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
>>      at 
>> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
>>      at 
>> org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213)
>>      at 
>> org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120)
>>      at 
>> org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112)
>>      at 
>> org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:168)
>>      at org.eclipse.osgi.container.Module.publishEvent(Module.java:476)
>>      at org.eclipse.osgi.container.Module.doStart(Module.java:578)
>>      at org.eclipse.osgi.container.Module.start(Module.java:449)
>>      at 
>> org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1628)
>>      at 
>> org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1608)
>>      at 
>> org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1579)
>>      at 
>> org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1522)
>>      at 
>> org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
>>      at 
>> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
>>      at 
>> org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
>>
>>
>> Since the error page is working fine despite this exception, is it a race
>> condition in the service registry that cause this exception? Should this be
>> reported as bug on pax-web or felix scr? We tried to upgrade to pax-web
>> 7.2.10 but still got the same error from time to time
>>
>> Thai Le
>>
>>
>> --
>> --
>> ------------------
>> OPS4J - http://www.ops4j.org - [email protected]
>>
>> ---
>> 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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ops4j/a5f3e942-754b-4c95-b958-a6cf6c5f75c0%40googlegroups.com
>> <https://groups.google.com/d/msgid/ops4j/a5f3e942-754b-4c95-b958-a6cf6c5f75c0%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> --
> ------------------
> OPS4J - http://www.ops4j.org - [email protected]
>
> ---
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ops4j/CAAdXmhp4yG-VR%2BULWW%2BMx6XCERc80x3nCbO%3DbCRtCFoJ8DaCbw%40mail.gmail.com
> <https://groups.google.com/d/msgid/ops4j/CAAdXmhp4yG-VR%2BULWW%2BMx6XCERc80x3nCbO%3DbCRtCFoJ8DaCbw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Castor Technologies Inc
460 rue St-Catherine St Ouest, Suite 613
Montréal, Québec H3B-1A7
(514) 360-7208 o
(514) 798-2044 f
[email protected]
www.castortech.com

CONFIDENTIALITY NOTICE: The information contained in this e-mail is
confidential and may be proprietary information intended only for the use
of the individual or entity to whom it is addressed. If the reader of this
message is not the intended recipient, you are hereby notified that any
viewing, dissemination, distribution, disclosure, copy or use of the
information contained in this e-mail message is strictly prohibited. If you
have received and/or are viewing this e-mail in error, please immediately
notify the sender by reply e-mail, and delete it from your system without
reading, forwarding, copying or saving in any manner. Thank you.
AVIS DE CONFIDENTIALITE: L’information contenue dans ce message est
confidentiel, peut être protégé par le secret professionnel et est réservé
à l'usage exclusif du destinataire. Toute autre personne est par les
présentes avisée qu'il lui est strictement interdit de diffuser, distribuer
ou reproduire ce message. Si vous avez reçu cette communication par erreur,
veuillez la détruire immédiatement et en aviser l'expéditeur. Merci.

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ops4j/CAJVRZt-V65MgqZ%2BA_DcmxNM7iQA9NNiN45BOSOBhykqL9x_pGw%40mail.gmail.com.

Reply via email to