Basically, you can write a daemon program polling the server.log and use regular expression to search for the error string and do whatever you like...
I don't know if there are any built-in functions available in glassfish to do that...
[Message sent by forum member 'marshalking' (marshalking)]
http://forums.java.net/jive/thread.jspa?messageID=285526