-
15. Re: How to reliably count active sessions (re-post)
francis17101970 Sep 9, 2008 8:58 AM (in response to mrgordonz)"mrgordonz" wrote:
Hi Peter,
That certainly fixed the issue with the exception - thx. My command is now:D:\JBoss_Tomcat\bin>twiddle -s localhost:1098 get "jboss.web:host=localhost,path=/MyApp,type=Manager" activeSessions
But now when I execute that command, nothing happens - the cursor just sits there and the command window never returns to a prompt.
Is there a log file or something that would give me a clue as to why the command never seems to complete?
Cheers,
Paul
Hi Paul,
what release of JBoss are you using ? with 4.2.2 GA works correctly.C:\jboss-4.2.0.GA\bin>twiddle -s localhost get "jboss.web:host=localhost,path=/HelloApp,type=Manager" activeSessions activeSessions=1
Try with this release. Hope it helps
Regards -
16. Re: How to reliably count active sessions (re-post)
mrgordonz Sep 9, 2008 9:02 AM (in response to mrgordonz)Hi Francesco,
I am using 4.0.5, and unfortunately I can't upgrade because that is the version that the application vendor supports. I need to make sure I use supported 3rd party software, and that means I am stuck with 4.0.5.
Cheers,
Paul -
17. Re: How to reliably count active sessions (re-post)
peterj Sep 9, 2008 1:31 PM (in response to mrgordonz)"mrgordonz" wrote:
My command is now:D:\JBoss_Tomcat\bin>twiddle -s localhost:1098 get "jboss.web:host=localhost,path=/MyApp,type=Manager" activeSessions
But now when I execute that command, nothing happens - the cursor just sits there and the command window never returns to a prompt.
You are using the wrong port number, it should be 1099. Or you can leave the port off. -
18. Re: How to reliably count active sessions (re-post)
mrgordonz Sep 9, 2008 6:58 PM (in response to mrgordonz)Hi Peter,
The installation of JBoss in this case is bundled with an application (Saba), and the Saba engineers have "tweaked" JBoss such that it listens on port 1098, not 1099. I have no idea why they did this, but when I check to see which ports are open (ie: being listened on), JBoss is listening on port 1098, not 1099.
Here is what happens when I try it using the default port:D:\SabaWeb\JBoss_Tomcat\bin>twiddle -s localhost get "jboss.web:host=localhost,path=/Saba,type=Manager" activeSessions 08:48:16,204 ERROR [Twiddle] Exec failed org.jboss.util.NestedRuntimeException: Could not obtain connection to any of these urls: localhost and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]; - nested throwable: (javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]) at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:143) at org.jboss.console.twiddle.command.MBeanServerCommand.getMBeanServer(MBeanServerCommand.java:59) at org.jboss.console.twiddle.command.GetCommand.execute(GetCommand.java:149) at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:305) Caused by: javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587) at javax.naming.InitialContext.lookup(InitialContext.java:347) at org.jboss.console.twiddle.Twiddle.createMBeanServerConnection(Twiddle.java:250) at org.jboss.console.twiddle.Twiddle.connect(Twiddle.java:268) at org.jboss.console.twiddle.Twiddle.access$300(Twiddle.java:62) at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:139) ... 3 more Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269) at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385) ... 10 more Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:243) ... 11 more Caused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:464) at java.net.Socket.connect(Socket.java:414) at java.net.Socket.<init>(Socket.java:310) at java.net.Socket.<init>(Socket.java:212) at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84) at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77) at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:239) ... 11 more
Perhaps the changed port number is what is causing twiddle to sit there and do nothing - I've tried letting it go for a coupe of hours and it never returns a result.
Cheers,
Paul -
19. Re: How to reliably count active sessions (re-post)
francis17101970 Sep 10, 2008 3:34 AM (in response to mrgordonz)odd.....maybe they've already an instance of JBoss running on that port.....changing jBoss service ports without knowing exactly what you are doing is a bit like waking up a sleeping dog :-)
Regards -
20. Re: How to reliably count active sessions (re-post)
mrgordonz Sep 16, 2008 12:42 AM (in response to mrgordonz)"PeterJ" wrote:
Found it! The MBean you want is:
jboss.web:host=localhost,path=YYY,type=Manager
where YYY is the web application context. The interesting attributes are:
activeSessions
sessionCounter
maxActiveSessions
and various others.
Hi Peter,
I hope you don't mind me bugging you again. The MBean you identified was perfect. I am now able to monitor the number of active sessions exactly as I want using my monitoring software. But, I have one customer that uses an older version of the application, which in turn uses an older version of JBoss: 3.2.1.
I know, I know - it's as old as the dinosaurs, but there isn't anything I can do about it until they upgrade.
I have done some searching and the MBean you found isn't there (at least I can't find it). When I go to http://localhost:8180/jmx-console I get a giant listing of MBeans as usual, but under the section jboss.web, there is only one MBean: service=WebServer
Do you know if the MBean you found is present in JBoss 3.2.1? If it isn't in 3.2.1, is there a different MBean which also provides activeSessions information?
Cheers,
Paul -
21. Re: How to reliably count active sessions (re-post)
peterj Sep 16, 2008 11:26 AM (in response to mrgordonz)I would search for an MBean containing "host=localhost" or "type=Manager".
Alternatively, you could look at web console and see if it still has that information. The names used in web console should help you locate the mbean.