It's an interesting problem. But, without seeing the lines of code which start JBoss, it's difficult to guess what the problem might be.
Can you show those few lines of code without compromising your system?
Does the command which starts JBoss end with an ampersand (&) to tell bash to runn the process in background and return control to the script (terminal) which called it?
You could also try inserting a timeout to see if that helps. I found this in a set of shell hints and tips I found somewhere on the web (author unknown to me).
Command timeout (or aborting a command which can hang) This solution runs the command in the background and waits for it to complete. A sleep command is also run to provide a timeout.
Works but full timeout period is always waited before exiting
TIMEOUT=60 # timelimit for command
This should allow time for JBoss to start in background, then return control to the terminal that started the script.