i've solved the problem now.
it seems that the documentation is quite misleading
in the 821-1208, the default value specified for instanceRoot is as-installdomains/domain1, therefore my instanceRoot method call points to the domain directory.
however, if i try pointing to the glassfish root directory, it now works.
thanks.
[Message sent by forum member 'henry_ken' (henry_ken10_at_hotmail.com)]
http://forums.java.net/jive/thread.jspa?messageID=389934