[jboss-user] [Beginners Corner] - Re: How can I find out from command line if JBoss is current

thoste do-not-reply at jboss.com
Fri Apr 11 15:29:17 EDT 2008


"PeterJ" wrote : You could run a twiddle command to check the value of an attribute of an mbean, such as:
  | 
  | twiddle get "jboss.system:type=Server" Started
  | 
  | This is not a perfect solution because this command will yield "Started=true" as soon as JMX and JNDI are running, but HTTP and thus web applications are usually not available until a few seconds later.

Your suggestion implies that if JBoss is not running the above command returns a statement

Started=false

But this is not the case. Instead I am getting an exception (see below).

Is there another solution?

D:\JBoss\v4\bin>twiddle get "jboss.system:type=Server" Started
11:49:28,781 ERROR [Twiddle] Exec failed
org.jboss.util.NestedRuntimeException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming
        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:1099 and discovery failed with error: jav
        at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        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.ServiceUnavailableExceptio
        at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)
        at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
        ... 10 more
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connect
        at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
        ... 11 more
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:507)
        at java.net.Socket.connect(Socket.java:457)
        at java.net.Socket.(Socket.java:365)
        at java.net.Socket.(Socket.java:265)
        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:244)
        ... 11 more
D:\JBoss\v4\bin>



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4143523#4143523

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4143523



More information about the jboss-user mailing list