Here is a Stack Overflow question that might have the answer:
http://stackoverflow.com/questions/5206712/glassfish-deploy-commandexception-error[
^]
One solution was to clean up the temporary area on the server, because if it is full then it won't accept new deployments. The other was to be sure that the folders are named properly (case-sensitive).
There also seems to be issues surrounding possible bugs in this process. When I looked it up on their site, I went through four bug reports that all linked to each other as the solution but no one seemed to actually solve the issue. It does seem as though newer versions have less problems with this.