I am getting your concern now, loud and clear..thanks for the explanation
When the server stops is the administrative port(4848) also listening like port (8080) ?
In you script can you echo the output of netstat -a between shutdown and startup and check the output ?
And I know it would be an untidy advice but you can also kill the process which is using the 8080 port (which most likely would be your application which you use to restart domain) in a parallel thread after starting the domain programmatically.
[Message sent by forum member 'anzy' (anzy)]
http://forums.java.net/jive/thread.jspa?messageID=300204