We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

stop jboss server in Linux

Medium Priority
4,135 Views
Last Modified: 2012-05-11
Hi, Here I have tried to stop jboss server in Linux .  This seems does not work. Could you please tell where is the problem ?

Please find the file attached. Sensitive information has been masked.
serverstart.txt
Comment
Watch Question

Commented:
just use the kill command
kill pid

it will not kill the JBoss, just will signal it to close
JBoss will shutdown gracefully

Commented:
also, if you have multiple IPs on that server, JBoss might bind some ports only to some IP

issue a "netstat -na" and find out the listening port and IP
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
kill -9 should be the almost the last thing you try (before rebooting)
Top Expert 2011

Commented:
/home/jboss/bin/shutdown.sh -S

Check this
http://community.jboss.org/wiki/StartStopJBoss
mohansahuSr.Manager -IT and Projects

Commented:
Hi,

try to Set up all the permissions and run levels like this:

sudo chown root:root /etc/init.d/jboss
sudo chmod ug+x /etc/init.d/jboss

ln -s /etc/rc.d/init.d/jboss /etc/rc3.d/S84jboss
ln -s /etc/rc.d/init.d/jboss /etc/rc4.d/S84jboss
ln -s /etc/rc.d/init.d/jboss /etc/rc5.d/S84jboss

ln -s /etc/rc.d/init.d/jboss/etc/rc6.d/K15jboss
ln -s /etc/rc.d/init.d/jboss/etc/rc0.d/K15jboss
ln -s /etc/rc.d/init.d/jboss/etc/rc1.d/K15jboss
ln -s /etc/rc.d/init.d/jboss/etc/rc2.d/K15jboss

and try to start up like :
$ /etc/init.d/./jboss start or $ /etc/init.d/./jboss stop

OR

Stopping JBoss, if you launched JBoss from the command line, the easiest way to stop it is to press ctrl-C.  JBoss should begin it's shutdown. (OR) ./shutdown.sh -S in jboss bin folder.

Author

Commented:
>>/home/jboss/bin/shutdown.sh -S

my jboss start is a bind to host and started as a service . Is not we should stop as a service ?

>>>just use the kill command
>>kill pid

Is it not  good to stop the service  ? is there any way for that ?

Also, how do we know  the startup status when I start jboss as a service ? it does not return anything ..seems things are in the background . How do I know the startup status ?  
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
mohansahuSr.Manager -IT and Projects

Commented:
Hi,

Use this following command to stop the server:-

% ./shutdown.sh --host=myremotemachineOrIP -S

Try providing your machine's ip address instead of "localhost".

and also check the boot & server logs in jboss

MS

Author

Commented:
>>>look at boot.log - notice the timestamp
>>>look at server.log from the timestamp of the boot.log

why timestamp is required here ? I dont understand why you are telling to note the timestamp . why do I need that ?

Commented:
to see the log at the time the server started ....
Top Expert 2011
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
>>>Could you post

Yes. But I may not post the entire server details in public . Would you like to see any specific portion ?

Please tell me which portion you would like to check ..I'd copy that part and post it here.

You may tell me which Tag to copy from those files so that it would be helpful to check
Top Expert 2011
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
>>>>Please tye to use
>>/home/jboss/bin/shutdown.sh -S
>>to see if this typical command can stop your jboss smoothly


when I run the above I get this ..

 /home/jboss/bin/shutdown.sh -S
Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
        java.net.ConnectException: Connection refused]
        at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)
        at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
        at org.jboss.Shutdown.main(Shutdown.java:235)
Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
        java.net.ConnectException: Connection refused]
        at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:101)
        at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1886)
        at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1856)
        at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257)
        ... 2 more
Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
        java.net.ConnectException: Connection refused
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:97)
        ... 7 more
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at java.net.Socket.connect(Socket.java:478)
        at java.net.Socket.<init>(Socket.java:375)
        at java.net.Socket.<init>(Socket.java:189)
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
        ... 12 more

Author

Commented:
>>>ps -ef | grep jboss

This shows the list   but not formatted . Hence I find difficult to identify the jboss process id.

Could you please modify the above command so that this prints a nicely formatted  listing . This will help me to dentify the  process id for jboss and thereafter to kill this process.

I'm using putty.exe to connect to server.
Top Expert 2011
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.