-
1. Re: BarrierController NOT working for me in Jboss 5.1.0
jaikiran Jun 29, 2009 1:34 PM (in response to yashendrac)I haven't used the BarrierController, so i don't know how its expected to work. But this comment probably gives a hint:
<!--Whether to have the Barrier initially started or not--> <attribute name="BarrierEnabledOnStartup">false</attribute>
Try changing the value to true:<!--Whether to have the Barrier initially started or not--> <attribute name="BarrierEnabledOnStartup">true</attribute>
-
2. Re: BarrierController NOT working for me in Jboss 5.1.0
brian.stansberry Jun 29, 2009 3:42 PM (in response to yashendrac)I just tested and confirmed that at the end of startup the "org.jboss.system.server.started" is emitted from source "jboss.system:type=Server" so the problem isn't that the notification isn't emitted.
-
3. Re: BarrierController NOT working for me in Jboss 5.1.0
yashendrac Jul 1, 2009 10:22 AM (in response to yashendrac)Hi
That deployment error is gone by making changes suggested by jaikiran.Try changing the value to true:
Code: <!--Whether to have the Barrier initially started or not--> <attribute name="BarrierEnabledOnStartup">true</attribute>
So I guess because of BarrierEnabledOnStartup=false when service AuthenticationService started Barrier was on create state NOT on start state which caused the deployment error. And after setting BarrierEnabledOnStartup=true Barrier was already on start state before start of AuthenticationService.<mbean code="login.AuthenticationService" name="smc.jboss:service=AuthenticationService"> <depends>jboss:name=SmcBarrier,type=Barrier</depends> </mbean>
-
4. Re: BarrierController NOT working for me in Jboss 5.1.0
yashendrac Jul 1, 2009 10:28 AM (in response to yashendrac)Thank you very much for your help.
But I wonder whats the significance of attribute BarrierEnabledOnStartup if I always need to set it to true. It was set to false for same application earlier in jboss 4.2.1. -
5. Re: BarrierController NOT working for me in Jboss 5.1.0
dimitris Jul 1, 2009 2:38 PM (in response to yashendrac)Well, the barrier controller controls the lifecycle (start/stop status) of a 2nd barrier mbean, that you use as a dependency for other services.
It will start/stop that 2nd mbean depending on the received notifications that it receives.
Now BarrierEnabledOnStartup defines what will be the initial state of the Barrier (started or stopped) when the BarrierController starts up itself, before it starts receiving notifications to control the barrier from that point on.
If your Barrier is not starting with BarrierEnabledOnStartup=false, that means the start-up notification is not received. This can happen if the notification is not emitted, or if the mbean that emits the notification is not there by the time the BarrierController is created. The later can be avoided if you enable dynamic subscriptions.
Hope that helps. -
6. Re: BarrierController NOT working for me in Jboss 5.1.0
rossog Dec 22, 2010 5:21 AM (in response to dimitris)I still miss something. I've used a lot barrier on JBoss 4, and now that we're migrating to 5.1.0GA, something doesn't work as expected.
This barrier works with logging monitor:
{code:xml}
<mbean code="org.jboss.system.BarrierController"
name="jboss.web:service=BarrierController">
<attribute name="BarrierEnabledOnStartup">true</attribute>
<attribute name="DynamicSubscriptions">true</attribute>
<attribute name="BarrierObjectName">jboss.web:name=AJPConnector,type=Barrier</attribute>
<attribute name="StartBarrierHandback">start</attribute>
<attribute name="StopBarrierHandback">stop</attribute>
<attribute name="SubscriptionList">
<subscription-list>
<mbean name="jboss.web:service=WebServer" handback="start">
<filter factory="NotificationFilterSupportFactory">
<enable type="jboss.tomcat.connectors.started"></enable>
</filter>
</mbean>
<mbean name="jboss.system:type=Server" handback="stop">
<filter factory="NotificationFilterSupportFactory">
<enable type="org.jboss.system.server.stopped"></enable>
</filter>
</mbean>
</subscription-list>
</attribute>
</mbean>
<mbean code="org.jboss.services.loggingmonitor.LoggingMonitor"
name="jboss.monitor:type=LoggingMonitor,name=WebMetricsMonitor">
<attribute name="Filename">${jboss.server.log.dir}/web-metrics.log</attribute>
<attribute name="AppendToFile">true</attribute>
<attribute name="PatternLayout">%d %-5p [%c] (maxThreads,acceptorThreadCount,currentThreadsBusy,currentThreadCount) %m%n</attribute>
<attribute name="RolloverPeriod">DAY</attribute>
<attribute name="MonitorPeriod">5000</attribute>
<attribute name="MonitoredObjects">
<configuration>
<monitoredmbean name="jboss.web:name=ajp-127.0.0.1-8009,type=ThreadPool"
logger="web.metrics">
<attribute>maxThreads</attribute>
<attribute>acceptorThreadCount</attribute>
<attribute>currentThreadsBusy</attribute>
<attribute>currentThreadCount</attribute>
</monitoredmbean>
</configuration>
</attribute>
<depends>jboss.web:name=AJPConnector,type=Barrier</depends>
</mbean>
{code}The problem is that the second bean, LoggingMonitor, doesn't wait for notification, and starts trying to log as soon as it gets deployed:
11:10:20,491 WARN [LoggingMonitor] Unable to log attributes for mbean: jboss.web:name=ajp-192.168.38.101-8009,type=ThreadPool
javax.management.InstanceNotFoundException: jboss.web:name=ajp-127.0.0.1-8009,type=ThreadPool is not registered.
at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:526)
at org.jboss.mx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:559)
at org.jboss.services.loggingmonitor.MonitoredMBean.logAttributes(MonitoredMBean.java:116)
at org.jboss.services.loggingmonitor.LoggingMonitorTimerTask.run(LoggingMonitorTimerTask.java:69)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)The same configuration (with BarrierEnabledOnStartup=false) works perfectly on 4.2.3GA.
Am I missing something?
Thanks