<HTML><BODY>Hi all<br><br>The question is about using Pax-Web (osgi servlet container) + Pax-Cdi + Weld.<br>There is a bug in pax-web <a href="https://ops4j1.jira.com/browse/PAXWEB-760">https://ops4j1.jira.com/browse/PAXWEB-760</a> than can't<br>be fixed about 2.5 year. And it seems that it is linked with weld. So I post<br>my question here - maybe someone of weld developers can give any hints, ideas<br>etc that can help us. So, the situation.<br><br>Configuration: jetty 9.3.11.v20160721, weld 2.2.12.Final, pax-cdi 0.13.0-SNAPSHOT, <br>pax-swissbox 1.8.0 , pax-web 6.0.0-SNAPSHOT.We must have a war bundle with <br>servlet + cdi bean. In servlet we do<div class="code panel" style="border-width: 1px;" data-mce-style="border-width: 1px;"><div class="codeContent panelContent"><pre class="code-java"><span class="code-keyword">private</span> void processRequest(HttpServletRequest request, HttpServletResponse response){
        HttpSession session = request.getSession();
        session.setMaxInactiveInterval(60);<span class="code-comment">//Note, these are seconds.
</span>      ....call some cdi bean method
}
</pre></div></div><p>The problem appears when we update war bundle on osgi when there is a live session. <br>So, timing is very important here. What we do by steps and time:<br> hr:min:sec<br> 1) at 00:00:00 we start our war bundle<br> 2) at 00:00:10 we make the first http request to our servlet with cdi bean call<br> 3) at 00:00:30 we update our war bundle on osgi (Bundle.update)<br> 4) at 00:00:40 we make the second http request to our servlet with cdi bean call<br> 5) at 00:01:40 we get the following exception:</p><div class="code panel" style="border-width: 1px;" data-mce-style="border-width: 1px;"><div class="codeContent panelContent"><pre class="code-java">2016-08-28 16:40:53,385 | WARN  | er@57af3ea4Timer | 39 - org.ops4j.pax.web.pax-web-jetty - 6.0.0.SNAPSHOT | org.ops4j.pax.web.service.jetty.internal.LateInvalidatingHashSessionManager | Problem scavenging sessions
java.lang.RuntimeException: Error accessing invisible AbstractSession method via reflection
        at org.ops4j.pax.web.service.jetty.internal.LateInvalidatingHashSessionManager.sessionTimeout(LateInvalidatingHashSessionManager.java:169)
        at org.ops4j.pax.web.service.jetty.internal.LateInvalidatingHashSessionManager.scavenge(LateInvalidatingHashSessionManager.java:82)
        at org.eclipse.jetty.server.session.HashSessionManager$Scavenger.run(HashSessionManager.java:84)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.<span class="code-object">Thread</span>.run(<span class="code-object">Thread</span>.java:745)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.ops4j.pax.web.service.jetty.internal.LateInvalidatingHashSessionManager.sessionTimeout(LateInvalidatingHashSessionManager.java:166)
        ... 9 more
Caused by: org.jboss.weld.exceptions.UnsatisfiedResolutionException: WELD-001308: Unable to resolve any beans <span class="code-keyword">for</span> Type: <span class="code-keyword">class </span>org.jboss.weld.context.http.HttpSessionDestructionContext; Qualifiers: []
        at org.jboss.weld.bean.builtin.InstanceImpl.get(InstanceImpl.java:101)
        at org.jboss.weld.servlet.HttpContextLifecycle.getSessionDestructionContext(HttpContextLifecycle.java:112)
        at org.jboss.weld.servlet.HttpContextLifecycle.deactivateSessionDestructionContext(HttpContextLifecycle.java:172)
        at org.jboss.weld.servlet.HttpContextLifecycle.sessionDestroyed(HttpContextLifecycle.java:153)
        at org.jboss.weld.servlet.WeldInitialListener.sessionDestroyed(WeldInitialListener.java:144)
        at org.jboss.weld.servlet.api.helpers.ForwardingServletListener.sessionDestroyed(ForwardingServletListener.java:50)
        at org.eclipse.jetty.server.session.AbstractSessionManager.removeSession(AbstractSessionManager.java:794)
        at org.eclipse.jetty.server.session.AbstractSession.timeout(AbstractSession.java:310)
        ... 14 more

<br>Any help is highly appreciated.<br><br>Best regards, Alex Sviridov</pre></div></div></BODY></HTML>