Thanks for the full trace. It looks like there's some kind of classpath conflict that's preventing the underlying discovery framework in glassfish from functioning properly. Is there a way to find out the full classpath setting that's being used to run the lookup code? It's not clear whether the fault lies on the Eclipse side or not but the same lookup will work fine if you execute it directly using a java command.
[Message sent by forum member 'ksak']
http://forums.java.net/jive/thread.jspa?messageID=444208