<font size=2 face="sans-serif">Thanks Martin. <br>
<br>
It looks like I have an integration defect to track down. <br>
<br>
Regards</font>
<br><font size=2 face="sans-serif">Benjamin</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Martin Kouba &lt;mkouba@redhat.com&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Benjamin Confino/UK/IBM@IBMGB,
weld-dev@lists.jboss.org, </font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Emily Jiang/UK/IBM@IBMGB,
Steven Schader &lt;schader@us.ibm.com&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">21/10/2016 08:33</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">Re: [weld-dev]
Unique BeanIdentifierIndex every time I restart a server</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>Hi Benjamin,<br>
<br>
it looks like an integration issue. The index hash should be the same <br>
unless an ID of a session/conversation scoped bean changes.<br>
<br>
Its value is computed using java.util.Arrays.hashCode(BeanIdentifier[]).
<br>
Note that BeanIdentifier.hashCode() is always based on the String <br>
representation of the ID.<br>
<br>
In you case, I can see the difference in:<br>
org.eclipse.osgi.internal.loader.EquinoxClassLoader@d6318459<br>
org.eclipse.osgi.internal.loader.EquinoxClassLoader@b3a3f568<br>
<br>
It seems the BeanDeploymentArchive.getId() is different between <br>
deployments which violates the Weld SPI contract:<br>
&quot;The identifier must be consistent between multiple occurrences of
this <br>
deployment.&quot; [1]<br>
<br>
It's also possible to disable this optimization:<br>
</font></tt><a href="http://docs.jboss.org/weld/reference/latest/en-US/html/configure.html#_bean_identifier_index_optimization"><tt><font size=2>http://docs.jboss.org/weld/reference/latest/en-US/html/configure.html#_bean_identifier_index_optimization</font></tt></a><tt><font size=2><br>
<br>
Martin<br>
<br>
[1]<br>
</font></tt><a href="https://github.com/weld/api/blob/master/weld-spi/src/main/java/org/jboss/weld/bootstrap/spi/BeanDeploymentArchive.java"><tt><font size=2>https://github.com/weld/api/blob/master/weld-spi/src/main/java/org/jboss/weld/bootstrap/spi/BeanDeploymentArchive.java</font></tt></a><tt><font size=2><br>
<br>
Dne 20.10.2016 v 18:22 Benjamin Confino napsal(a):<br>
&gt; Hello.<br>
&gt;<br>
&gt; I've been investigating a bug relating to session failover and I've<br>
&gt; noticed that my BeanIdentifierIndexhas a different hash every time
I<br>
&gt; start and stop the server. This is consistent across every app I tried.<br>
&gt;<br>
&gt; For example:<br>
&gt;<br>
&gt; Upon starting the server I see my debug output<br>
&gt;<br>
&gt; GREP &nbsp; &nbsp;BeanIdentifierIndex [hash=591986009, indexed=3]<br>
&gt; &nbsp; &nbsp; &nbsp;0:<br>
&gt; WELD%AbstractBuiltInBean%invalidBeansXml#com.ibm.ws.transaction.cdi_1.0.15.20161018-1920.additionalClasses%HttpSession<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;1:<br>
&gt; WELD%AbstractBuiltInBean%invalidBeansXml#invalidBeansXml.war%HttpSession<br>
&gt; &nbsp; &nbsp; &nbsp;2:<br>
&gt; WELD%AbstractBuiltInBean%invalidBeansXml#org.eclipse.osgi.internal.loader.EquinoxClassLoader@d6318459[com.ibm.ws.org.jboss.weld.2.4.0:1.0.15.20161018-1920(id=108)].additionalClasses%HttpSession<br>
&gt;<br>
&gt;<br>
&gt; I stop the server, and start it again<br>
&gt;<br>
&gt; GREP &nbsp; &nbsp;BeanIdentifierIndex [hash=-375657379, indexed=3]<br>
&gt; &nbsp; &nbsp; &nbsp;0:<br>
&gt; WELD%AbstractBuiltInBean%invalidBeansXml#com.ibm.ws.transaction.cdi_1.0.15.20161018-1920.additionalClasses%HttpSession<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;1:<br>
&gt; WELD%AbstractBuiltInBean%invalidBeansXml#invalidBeansXml.war%HttpSession<br>
&gt; &nbsp; &nbsp; &nbsp;2:<br>
&gt; WELD%AbstractBuiltInBean%invalidBeansXml#org.eclipse.osgi.internal.loader.EquinoxClassLoader@b3a3f568[com.ibm.ws.org.jboss.weld.2.4.0:1.0.15.20161018-1920(id=108)].additionalClasses%HttpSession<br>
&gt;<br>
&gt;<br>
&gt; Same three classes but the hash is completely different.<br>
&gt;<br>
&gt; My question is simple. Is this the expected behaviour or is this a
sign<br>
&gt; that something's gone wrong?<br>
&gt;<br>
&gt; Regards<br>
&gt; Benjamin<br>
&gt; Unless stated otherwise above:<br>
&gt; IBM United Kingdom Limited - Registered in England and Wales with
number<br>
&gt; 741598.<br>
&gt; Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
PO6 3AU<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; weld-dev mailing list<br>
&gt; weld-dev@lists.jboss.org<br>
&gt; </font></tt><a href="https://lists.jboss.org/mailman/listinfo/weld-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/weld-dev</font></tt></a><tt><font size=2><br>
&gt;<br>
<br>
-- <br>
Martin Kouba<br>
Software Engineer<br>
Red Hat, Czech Republic<br>
<br>
</font></tt>
<br><font size=2 face="sans-serif"><br>
Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales with number
741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU<br>
</font>