I have Jboss 5.1 running on linux it has four ejb services running, Now when I try to stop the jboss by pressing crtl-c on it's console or try to run shutdown.sh it doesn't shut down.What I have to every time is run 'pgrep -f jboss' then get the pid and do 'kill -9 <pid>' also if I do 'ps -ef | grep jboss' it doesn't display anything even if jboss is running if I do 'ps -ef | grep java' then it shows the java process whihc is having the same pid of the 'pgrep -f jboss'.Need help on these two issues.
Sounds like you have a stray thread that is not shutting down. Does any of your code start up threads (hope not, that's a Java EE non-no). One way to find out is, after hitting CTRL-C, wait a minute, then ask for a Java thread dump (CTRL-\). Examine the threads that are running, look for threads whose stack traces include your code; that should give you some clue as to what is causing the problem.