<div dir="ltr"><div>I believe that this problem is related to <a href="https://github.com/exoplatform/ws/commit/50a829a047ff91a1f358d9ef2536486dceb320ec">https://github.com/exoplatform/ws/commit/50a829a047ff91a1f358d9ef2536486dceb320ec</a><br>
</div><div><br></div><div>It seems to me that RequestLifeCycle.end() is being called sooner than expected in <a href="https://github.com/exoplatform/ws/blob/2.4.0-Alpha3/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java">https://github.com/exoplatform/ws/blob/2.4.0-Alpha3/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java</a><br>
</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 29 November 2013 15:15, Nicolas Filotto <span dir="ltr"><<a href="mailto:nicolas.filotto@exoplatform.com" target="_blank">nicolas.filotto@exoplatform.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">There are many things that have been added between Alpha1 and Alpha3, so I will need more details. What do you mean exactly by "<span style="font-family:arial,sans-serif;font-size:13px">strange behavior with some ThreadLocal<> variables"?</span><div>
<span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Please note that I don't work on Fridays so I will answer next week once I will have more details</span></div>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 28, 2013 at 8:46 PM, Lucas Ponce <span dir="ltr"><<a href="mailto:lponce@redhat.com" target="_blank">lponce@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nicolas,<br>
<br>
Do you know if there is some change related multithreading between kernel 2.5.0-Alpha3 and 2.5.0-Alpha1 ?<br>
<br>
Debugging a class I'm seeing some strange behaviour with some ThreadLocal<> variables.<br>
<br>
Thanks again,<br>
Lucas<br>
<br>
----- Mensaje original -----<br>
> De: "Nicolas Filotto" <<a href="mailto:nicolas.filotto@exoplatform.com" target="_blank">nicolas.filotto@exoplatform.com</a>><br>
> Para: "Lucas Ponce" <<a href="mailto:lponce@redhat.com" target="_blank">lponce@redhat.com</a>><br>
> CC: "gatein-dev" <<a href="mailto:gatein-dev@lists.jboss.org" target="_blank">gatein-dev@lists.jboss.org</a>><br>
> Enviados: Jueves, 28 de Noviembre 2013 18:08:29<br>
> Asunto: Re: [gatein-dev] SessionManagerContainer in exo.kernel.container 2.6.0-Alpha3<br>
><br>
> If you use the SessionManagerContainer, why don't you have a compilation<br>
> error ?<br>
><br>
><br>
> On Thu, Nov 28, 2013 at 4:50 PM, Lucas Ponce <<a href="mailto:lponce@redhat.com" target="_blank">lponce@redhat.com</a>> wrote:<br>
><br>
> > Hello Nicolas,<br>
> ><br>
> > POMSessionManager.java needs to access to SessionContext at this point:<br>
> ><br>
> > public POMSession getSession() {<br>
> > SessionContext context = configurator.getContext();<br>
> > return context != null ? (POMSession)<br>
> > context.getAttachment("mopsession") : null;<br>
> > }<br>
> ><br>
> > This is needed to PortalNamesCache.java to perform a query to<br>
> > POMDataStorage component:<br>
> ><br>
> > @Override<br>
> > public <V> V execute(POMSession session, POMTask<V> task) throws<br>
> > Exception {<br>
> > if (!session.isModified()) {<br>
> > if (task instanceof SearchTask.FindSiteKey) {<br>
> > SearchTask.FindSiteKey find = (SearchTask.FindSiteKey)<br>
> > task;<br>
> > List<PortalKey> data = (List<PortalKey>)<br>
> > session.getFromCache(find.getKey());<br>
> > if (data == null) {<br>
> > V result = super.execute(session, task);<br>
> > LazyPageList<PortalKey> list =<br>
> > (LazyPageList<PortalKey>) result;<br>
> > session.putInCache(find.getKey(),<br>
> > Collections.unmodifiableList(new ArrayList<PortalKey>(list.getAll())));<br>
> > return result;<br>
> > } else {<br>
> > return (V) new LazyPageList<PortalKey>(new<br>
> > ListAccessImpl<PortalKey>(PortalKey.class, data), 10);<br>
> > }<br>
> > } else if (task instanceof PortalConfigTask.Save || task<br>
> > instanceof PortalConfigTask.Remove) {<br>
> > V result = super.execute(session, task);<br>
> ><br>
> > session.scheduleForEviction(SearchTask.FindSiteKey.PORTAL_KEY);<br>
> ><br>
> > session.scheduleForEviction(SearchTask.FindSiteKey.GROUP_KEY);<br>
> > return result;<br>
> > }<br>
> > }<br>
> ><br>
> > //<br>
> > return super.execute(session, task);<br>
> > }<br>
> ><br>
> > With the current change of version in exo.core, the getSession() in<br>
> > POMSessionManager is always null, so a NPE is thrown breaking the POM<br>
> > service.<br>
> ><br>
> > I wonder how I can integrate these new changes to have same behaviour that<br>
> > previous version.<br>
> ><br>
> > Thanks,<br>
> > Lucas<br>
> ><br>
> ><br>
> > ----- Mensaje original -----<br>
> > > De: "Nicolas Filotto" <<a href="mailto:nicolas.filotto@exoplatform.com" target="_blank">nicolas.filotto@exoplatform.com</a>><br>
> > > Para: "Lucas Ponce" <<a href="mailto:lponce@redhat.com" target="_blank">lponce@redhat.com</a>><br>
> > > CC: "gatein-dev" <<a href="mailto:gatein-dev@lists.jboss.org" target="_blank">gatein-dev@lists.jboss.org</a>><br>
> > > Enviados: Jueves, 28 de Noviembre 2013 17:29:27<br>
> > > Asunto: Re: [gatein-dev] SessionManagerContainer in exo.kernel.container<br>
> > 2.6.0-Alpha3<br>
> > ><br>
> > > What is the need exactly ? Beeing able to scope a component to a Session?<br>
> > > If so it is now possible to define a scope to a component thanks to<br>
> > > <a href="https://jira.exoplatform.org/browse/KER-258" target="_blank">https://jira.exoplatform.org/browse/KER-258</a>. Out of the box, the kernel<br>
> > > supports the scope Singleton, ApplicationScoped and Dependent. By adding<br>
> > > some configuration you can extend the list to SessionScoped and<br>
> > > RequestScoped. Here is the configuration to add if you want both:<br>
> > ><br>
> > > <component><br>
> > > <key>org.exoplatform.container.context.ContextManager</key><br>
> > > <type>org.exoplatform.container.context.ContextManagerImpl</type><br>
> > > <component-plugins><br>
> > > <component-plugin><br>
> > > <name>main-scopes</name><br>
> > > <set-method>addContexts</set-method><br>
> > > <type>org.exoplatform.container.context.ContextPlugin</type><br>
> > > <init-params><br>
> > > <object-param><br>
> > > <name>request-scope</name><br>
> > > <object type="org.exoplatform.container.context.RequestContext"/><br>
> > > </object-param><br>
> > > <object-param><br>
> > > <name>session-scope</name><br>
> > > <object type="org.exoplatform.container.context.SessionContext"/><br>
> > > </object-param><br>
> > > </init-params><br>
> > > </component-plugin><br>
> > > </component-plugins><br>
> > > </component><br>
> > ><br>
> > > Please note that the components that you want to scope to SessionScoped<br>
> > or<br>
> > > RequestScoped must be proxyable as they are normal scopes (which means<br>
> > that<br>
> > > you will access to the methods through a proxy and you must not access to<br>
> > > the fields directly), moreover components that you want to scope to<br>
> > > SessionScoped must be Serializable as SessionScoped is a passivating<br>
> > scope.<br>
> > ><br>
> > > Please also note that thanks to KER-252 you can use the annotations<br>
> > defined<br>
> > > in JSR 330 such as Inject<br>
> > ><br>
> > ><br>
> > > On Thu, Nov 28, 2013 at 3:36 PM, Lucas Ponce <<a href="mailto:lponce@redhat.com" target="_blank">lponce@redhat.com</a>> wrote:<br>
> > ><br>
> > > > Hello,<br>
> > > ><br>
> > > > There is a issue in current master that is impacting to REST management<br>
> > > > services in GateIn.<br>
> > > ><br>
> > > > <a href="https://issues.jboss.org/browse/GTNPORTAL-3308" target="_blank">https://issues.jboss.org/browse/GTNPORTAL-3308</a><br>
> > > ><br>
> > > > Investigating it looks like that issue appears since migration to<br>
> > > > 2.6.0-Alpha3 core.<br>
> > > ><br>
> > > > Main symptom is a NPE in POMSessionManager class:<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > <a href="https://github.com/gatein/gatein-portal/blob/428874e25ee9e6dada3fd1a54a4aa9f02f42d641/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java#L224-L229" target="_blank">https://github.com/gatein/gatein-portal/blob/428874e25ee9e6dada3fd1a54a4aa9f02f42d641/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java#L224-L229</a><br>
> > > ><br>
> > > > One of the changes of 2.6.0-Alpha3 is to drop the<br>
> > SessionManagerContainer<br>
> > > > interface from PortalContainer.<br>
> > > ><br>
> > > > Is there a workaround to access to same functionality in order to fix<br>
> > this<br>
> > > > issue ?<br>
> > > ><br>
> > > > Thanks in advance,<br>
> > > > Lucas<br>
> > > > _______________________________________________<br>
> > > > gatein-dev mailing list<br>
> > > > <a href="mailto:gatein-dev@lists.jboss.org" target="_blank">gatein-dev@lists.jboss.org</a><br>
> > > > <a href="https://lists.jboss.org/mailman/listinfo/gatein-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/gatein-dev</a><br>
> > > ><br>
> > ><br>
> ><br>
><br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
gatein-dev mailing list<br>
<a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/gatein-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/gatein-dev</a><br></blockquote></div><br><br clear="all"><br>-- <br><font><b>Trong Tran</b></font><br style="color:rgb(102,102,102);font-family:'trebuchet ms',sans-serif">
<span style="color:rgb(102,102,102);font-family:'trebuchet ms',sans-serif"></span><span style="color:rgb(102,102,102);font-family:'trebuchet ms',sans-serif"><i><span style="color:rgb(102,102,102);font-family:'trebuchet ms',sans-serif">(+84) 983841909 <span style="color:rgb(255,153,0)">|</span></span> </i></span><span style="font-family:'trebuchet ms',sans-serif"><span style="color:rgb(102,102,102)"><span><a href="mailto:trongtt@gmail.com" target="_blank">trongtt@gmail.com</a><br>
Twitter: <a href="http://twitter.com/trongtt" target="_blank">http://twitter.com/trongtt</a></span></span></span><span style="font-family:'trebuchet ms',sans-serif"><span style="color:rgb(102,102,102)"><span><span style="color:rgb(102,102,102);font-family:'trebuchet ms',sans-serif"><i><span style="color:rgb(102,102,102);font-family:'trebuchet ms',sans-serif"><span style="color:rgb(255,153,0)"></span></span></i></span></span></span></span><span style="font-family:'trebuchet ms',sans-serif"></span>
</div>