--
--
------------------
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 ops4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/cb747b43-f883-4c89-92a7-176f03e7f991n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/08e6bf92-e96d-404c-87d1-5234595f47d1n%40googlegroups.com.
@Component(immediate = true, property = {
HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER + "=true",
HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT + "=("
+ HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME
+ "=*)" }, service = { ServletContextListener.class,
TestServletContextListener.class }, scope = ServiceScope.SINGLETON)
Thanks a lot for your reply.Looks like you are talking about this issue: https://ops4j1.jira.com/browse/PAXWEB-62But it's extremely old and it's closed so I though it's resolved.
In my example it's not known when the listener is registered: before the servlet is registered and servlet context is initialized or after.You are right here.But I've started from another example where the listener is declared via DS in a separate bundle.And I had deployed this bundle first : so it's registered as a service by PAX.Then I've deployed the web bundle and the listener has not been called anyway.So personally for me regardless of the order of listener registration (before or after servlet) it's never called.
The related topic for this : it's possible to declare `ServletContexHelper` with a given name. Then I canrequire to register a `Servlet` , any listener for the context identified by the name. But what happens if thereis no such context helper registered YET ? In the same way I may declare the helper in a different bundle andit's not possible to say when it will be registered : before or after the servlet.
So what will happen in that case: will it wait until the context helper appear with the given name or justsimply fails because there is no helper with this name ?
I expect that it won't fail and wait until the helper appears . Because otherwise I need to write boilerplatecode which waits for the appearance of the service which normally I should not even know about(via ServiceTracker or via @Reference). This is extremely inconvenient.
And the same situation is here with `ServletContexListener`: I have to wait until it's registered and register the servletonly after that.By the way I will check that : whether this work at all or not.But anyway: this looks like a bug because you may not rely on the order of listener registration: the listener should be called even if the servlet contextof the web app "has been already initialized". As I understand this is exactly what https://ops4j1.jira.com/browse/PAXWEB-62 issue says.
Also this is exactly how felix-jetty work: the servlet may be already intialized (registered and then even initialized) but once the servlet context listeneris registered it's called anyway.
That's why the behavior was quite confusing for me.But as I understand you confirmed that this does't work properly in pax web 7 and this is what you are working on for pax web 8.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/7bfbad5c-0945-4585-9739-6c166a1f21a2n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/f9310059-a8dc-4652-b5e9-64425d15b5dan%40googlegroups.com.