<div dir="ltr">Yeah, moving the lookup to the area you mentioned worked - thanks again!</div><div class="gmail_extra"><br><div class="gmail_quote">On 13 December 2016 at 10:54, Tom Jenkinson <span dir="ltr">&lt;<a href="mailto:tom.jenkinson@redhat.com" target="_blank">tom.jenkinson@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks, I will take a look. Did this change recently? If not I am at a loss why it is starting to fail an existing test.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 12 December 2016 at 21:33, Brian Stansberry <span dir="ltr">&lt;<a href="mailto:brian.stansberry@redhat.com" target="_blank">brian.stansberry@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
&gt; On Dec 12, 2016, at 3:21 PM, Brian Stansberry &lt;<a href="mailto:brian.stansberry@redhat.com" target="_blank">brian.stansberry@redhat.com</a>&gt; wrote:<br>
&gt;<br>
&gt; This is the problem: the TransactionExtension initialize method of touching classes that result in doing static initialization stuff that reads the system props at that point, which is too early:<br>
&gt;<br>
<br>
</span>s/of touching/is touching/g<br>
<br>
A likely fix is to just not store a ref to coordinatorEnvironmentBean in TransactionSubsystemRootResour<wbr>ceDefinition$StatisticsEnabled<wbr>Handler. Just find it and use it in applyUpdateToRuntime/revertUpd<wbr>ateToRuntime neither of which will get called before system properties are set. They don’t get called at all if the user doesn’t do a write-attribute op to change that attribute.<br>
<div class="m_8851304012755779469HOEnZb"><div class="m_8851304012755779469h5"><br>
&gt; &quot;ServerService Thread Pool -- 21@3635&quot; prio=5 tid=0x30 nid=NA runnable<br>
&gt;  java.lang.Thread.State: RUNNABLE<br>
&gt;         at com.arjuna.common.util.propert<wbr>yservice.PropertiesFactory.ini<wbr>tPropertiesFactory(PropertiesF<wbr>actory.java:53)<br>
&gt;         - locked &lt;0x1389&gt; (a java.lang.Class)<br>
&gt;         at com.arjuna.common.util.propert<wbr>yservice.PropertiesFactory.get<wbr>DefaultProperties(PropertiesFa<wbr>ctory.java:36)<br>
&gt;         at com.arjuna.common.internal.uti<wbr>l.propertyservice.BeanPopulato<wbr>r.getNamedInstance(BeanPopulat<wbr>or.java:86)<br>
&gt;         at com.arjuna.common.internal.uti<wbr>l.propertyservice.BeanPopulato<wbr>r.getDefaultInstance(BeanPopul<wbr>ator.java:53)<br>
&gt;         at com.arjuna.ats.arjuna.common.a<wbr>rjPropertyManager.getCoordinat<wbr>orEnvironmentBean(arjPropertyM<wbr>anager.java:51)<br>
&gt;         at org.jboss.as.txn.subsystem.Tra<wbr>nsactionSubsystemRootResourceD<wbr>efinition$StatisticsEnabledHan<wbr>dler.&lt;init&gt;(TransactionSubsyst<wbr>emRootResourceDefinition.java:<wbr>518)<br>
&gt;         at org.jboss.as.txn.subsystem.Tra<wbr>nsactionSubsystemRootResourceD<wbr>efinition.registerAttributes(T<wbr>ransactionSubsystemRootResourc<wbr>eDefinition.java:314)<br>
&gt;         at org.jboss.as.controller.regist<wbr>ry.NodeSubregistry.registerChi<wbr>ld(NodeSubregistry.java:104)<br>
&gt;         at org.jboss.as.controller.regist<wbr>ry.ConcreteResourceRegistratio<wbr>n.registerSubModel(ConcreteRes<wbr>ourceRegistration.java:225)<br>
&gt;         at org.jboss.as.controller.extens<wbr>ion.ExtensionRegistry$Subsyste<wbr>mRegistrationImpl.registerSubs<wbr>ystemModel(ExtensionRegistry.<wbr>java:706)<br>
&gt;         at org.jboss.as.txn.subsystem.Tra<wbr>nsactionExtension.initialize(T<wbr>ransactionExtension.java:104)<br>
&gt;         at org.jboss.as.controller.extens<wbr>ion.ExtensionAddHandler.initia<wbr>lizeExtension(ExtensionAddHand<wbr>ler.java:131)<br>
&gt;         at org.jboss.as.controller.extens<wbr>ion.ExtensionAddHandler.initia<wbr>lizeExtension(ExtensionAddHand<wbr>ler.java:104)<br>
&gt;         at org.jboss.as.controller.extens<wbr>ion.ParallelExtensionAddHandle<wbr>r$ExtensionInitializeTask.<wbr>call(ParallelExtensionAddHandl<wbr>er.java:144)<br>
&gt;         at org.jboss.as.controller.extens<wbr>ion.ParallelExtensionAddHandle<wbr>r$ExtensionInitializeTask.<wbr>call(ParallelExtensionAddHandl<wbr>er.java:127)<br>
&gt;         at java.util.concurrent.FutureTas<wbr>k.run(FutureTask.java:266)<br>
&gt;         at java.util.concurrent.ThreadPoo<wbr>lExecutor.runWorker(ThreadPool<wbr>Executor.java:1142)<br>
&gt;         at java.util.concurrent.ThreadPoo<wbr>lExecutor$Worker.run(ThreadPoo<wbr>lExecutor.java:617)<br>
&gt;         at java.lang.Thread.run(Thread.ja<wbr>va:745)<br>
&gt;         at org.jboss.threads.JBossThread.<wbr>run(JBossThread.java:320)<br>
&gt;<br>
&gt;<br>
&gt;&gt; On Dec 12, 2016, at 2:50 PM, Tom Jenkinson &lt;<a href="mailto:tom.jenkinson@redhat.com" target="_blank">tom.jenkinson@redhat.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Thanks for the input/<br>
&gt;&gt;<br>
&gt;&gt; This is the point I do not think the property has been set by:<br>
&gt;&gt;<br>
&gt;&gt; &quot;MSC service thread 1-3@2595&quot; prio=5 tid=0x14 nid=NA runnable<br>
&gt;&gt;  java.lang.Thread.State: RUNNABLE<br>
&gt;&gt;        at com.arjuna.ats.arjuna.common.R<wbr>ecoveryEnvironmentBean.getExpi<wbr>ryScannerClassNames(RecoveryEn<wbr>vironmentBean.java:336)<br>
&gt;&gt;        - locked &lt;0x1bb6&gt; (a com.arjuna.ats.arjuna.common.R<wbr>ecoveryEnvironmentBean)<br>
&gt;&gt;        at sun.reflect.NativeMethodAccess<wbr>orImpl.invoke0(NativeMethodAcc<wbr>essorImpl.java:-1)<br>
&gt;&gt;        at sun.reflect.NativeMethodAccess<wbr>orImpl.invoke(NativeMethodAcce<wbr>ssorImpl.java:62)<br>
&gt;&gt;        at sun.reflect.DelegatingMethodAc<wbr>cessorImpl.invoke(DelegatingMe<wbr>thodAccessorImpl.java:43)<br>
&gt;&gt;        at java.lang.reflect.Method.invok<wbr>e(Method.java:498)<br>
&gt;&gt;        at com.arjuna.common.internal.uti<wbr>l.propertyservice.BeanPopulato<wbr>r.handleGroupProperty(BeanPopu<wbr>lator.java:263)<br>
&gt;&gt;        at com.arjuna.common.internal.uti<wbr>l.propertyservice.BeanPopulato<wbr>r.configureFromProperties(Bean<wbr>Populator.java:170)<br>
&gt;&gt;        at com.arjuna.common.internal.uti<wbr>l.propertyservice.BeanPopulato<wbr>r.getNamedInstance(BeanPopulat<wbr>or.java:87)<br>
&gt;&gt;        at com.arjuna.common.internal.uti<wbr>l.propertyservice.BeanPopulato<wbr>r.getDefaultInstance(BeanPopul<wbr>ator.java:53)<br>
&gt;&gt;        at com.arjuna.ats.arjuna.common.r<wbr>ecoveryPropertyManager.getReco<wbr>veryEnvironmentBean(recoveryPr<wbr>opertyManager.java:34)<br>
&gt;&gt;        at org.jboss.as.txn.service.Arjun<wbr>aRecoveryManagerService.start(<wbr>ArjunaRecoveryManagerService.j<wbr>ava:96)<br>
&gt;&gt;        - locked &lt;0x1bd2&gt; (a org.jboss.as.txn.service.Arjun<wbr>aRecoveryManagerService)<br>
&gt;&gt;        at org.jboss.msc.service.ServiceC<wbr>ontrollerImpl$StartTask.<wbr>startService(ServiceController<wbr>Impl.java:1963)<br>
&gt;&gt;        at org.jboss.msc.service.ServiceC<wbr>ontrollerImpl$StartTask.run(Se<wbr>rviceControllerImpl.java:1896)<br>
&gt;&gt;        at java.util.concurrent.ThreadPoo<wbr>lExecutor.runWorker(ThreadPool<wbr>Executor.java:1142)<br>
&gt;&gt;        at java.util.concurrent.ThreadPoo<wbr>lExecutor$Worker.run(ThreadPoo<wbr>lExecutor.java:617)<br>
&gt;&gt;        at java.lang.Thread.run(Thread.ja<wbr>va:745)<br>
&gt;&gt;<br>
&gt;&gt; (that is output from the debugger)<br>
&gt;&gt;<br>
&gt;&gt; Once releasing that thread and letting the container continue startup I see this execute:<br>
&gt;&gt; 2016-12-12 20:46:49,731 TRACE [org.jboss.as.controller.manag<wbr>ement-operation] (Controller Boot Thread) Final response for step handler org.jboss.as.server.operations<wbr>.SystemPropertyAddHandler@5c7e<wbr>7735 handling add in address [(&quot;system-property&quot; =&gt; &quot;RecoveryEnvironmentBean.expir<wbr>yScannerClassNames&quot;)] is {&quot;outcome&quot; =&gt; &quot;success&quot;}<br>
&gt;&gt; 2016-12-12 20:46:49,787 TRACE [org.jboss.as.controller.manag<wbr>ement-operation] (Controller Boot Thread) Final response for step handler org.jboss.as.controller.Valida<wbr>teModelStepHandler@f15c8f7 handling internal-model-validation in address [(&quot;system-property&quot; =&gt; &quot;RecoveryEnvironmentBean.expir<wbr>yScannerClassNames&quot;)] is {&quot;outcome&quot; =&gt; &quot;success&quot;}<br>
&gt;&gt;<br>
&gt;&gt; I believe this is different to previous behaviour as I have had a defect raised against TX: <a href="https://issues.jboss.org/browse/JBEAP-7820" rel="noreferrer" target="_blank">https://issues.jboss.org/brows<wbr>e/JBEAP-7820</a>. It&#39;s possible that there is a regression in Narayana (somehow) if nothing changed in this area in the core itself.<br>
&gt;&gt;<br>
&gt;&gt; Thanks for your input,<br>
&gt;&gt; Tom<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 12 December 2016 at 20:15, Brian Stansberry &lt;<a href="mailto:brian.stansberry@redhat.com" target="_blank">brian.stansberry@redhat.com</a>&gt; wrote:<br>
&gt;&gt; This works fine for me. Adding that xml snippet to standalone.xml after the &lt;extensions&gt; element I see the property being set during boot before any processing of subsystem operations begins.<br>
&gt;&gt;<br>
&gt;&gt;&gt; On Dec 12, 2016, at 1:55 PM, Brian Stansberry &lt;<a href="mailto:brian.stansberry@redhat.com" target="_blank">brian.stansberry@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I don’t see anything in the organization of boot ops that would have changed the ordering, and the add op for that system property should be executing prior to the subsystem ops. I’ll see if I can reproduce.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Dec 12, 2016, at 12:10 PM, Kabir Khan &lt;<a href="mailto:kabir.khan@jboss.com" target="_blank">kabir.khan@jboss.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Where are you trying to use the system property from? They should only be attempted resolved during the RUNTIME stage, not MODEL.<br>
&gt;&gt;&gt;&gt;&gt; On 12 Dec 2016, at 18:00, Tom Jenkinson &lt;<a href="mailto:tom.jenkinson@redhat.com" target="_blank">tom.jenkinson@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; I have a subsystem that configures itself from system properties.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; For example:<br>
&gt;&gt;&gt;&gt;&gt; &lt;system-properties&gt;<br>
&gt;&gt;&gt;&gt;&gt; &lt;property name=&quot;RecoveryEnvironmentBean.<wbr>expiryScannerClassNames&quot; value=&quot;com.arjuna.ats.internal<wbr>.arjuna.recovery.ExpiredTransa<wbr>ctionStatusManagerScanner com.arjuna.ats.internal.arjuna<wbr>.recovery.AtomicActionExpirySc<wbr>anner&quot;/&gt;<br>
&gt;&gt;&gt;&gt;&gt; &lt;/system-properties&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; In earlier revisions of WFLY this worked fine. However I am now seeing that the system property is not set until after my subsystem has started. I can tell this as I have breakpoints on where I process the property. I can see &quot;MSC service thread 1-4&quot; attempting to process the property (which is not set). I do later see messages that suggest the system property is set but at that the later point:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; 2016-12-12 17:57:48,042 TRACE [org.jboss.as.controller.manag<wbr>ement-operation] (Controller Boot Thread) Final response for step handler org.jboss.as.server.operations<wbr>.SystemPropertyAddHandler@784c<wbr>8c5f handling add in address [(&quot;system-property&quot; =&gt; &quot;RecoveryEnvironmentBean.expir<wbr>yScannerClassNames&quot;)] is {&quot;outcome&quot; =&gt; &quot;success&quot;}<br>
&gt;&gt;&gt;&gt;&gt; 2016-12-12 17:57:48,093 TRACE [org.jboss.as.controller.manag<wbr>ement-operation] (Controller Boot Thread) Final response for step handler org.jboss.as.controller.Valida<wbr>teModelStepHandler@87b4493 handling internal-model-validation in address [(&quot;system-property&quot; =&gt; &quot;RecoveryEnvironmentBean.expir<wbr>yScannerClassNames&quot;)] is {&quot;outcome&quot; =&gt; &quot;success&quot;}<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Does my subsystem need to depend on something to get the old behaviour of being started after system properties are processed?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; My subsystem is the transaction one and the service is the recovery manager.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Thanks!<br>
&gt;&gt;&gt;&gt;&gt; Tom<br>
&gt;&gt;&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt;&gt;&gt; wildfly-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt; <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/wildfly-dev</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt;&gt; wildfly-dev mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/wildfly-dev</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Brian Stansberry<br>
&gt;&gt;&gt; Manager, Senior Principal Software Engineer<br>
&gt;&gt;&gt; JBoss by Red Hat<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt; wildfly-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/wildfly-dev</a><br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Brian Stansberry<br>
&gt;&gt; Manager, Senior Principal Software Engineer<br>
&gt;&gt; JBoss by Red Hat<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt; wildfly-dev mailing list<br>
&gt;&gt; <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/wildfly-dev</a><br>
&gt;&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Brian Stansberry<br>
&gt; Manager, Senior Principal Software Engineer<br>
&gt; JBoss by Red Hat<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; wildfly-dev mailing list<br>
&gt; <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/wildfly-dev</a><br>
<br>
--<br>
Brian Stansberry<br>
Manager, Senior Principal Software Engineer<br>
JBoss by Red Hat<br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>