http://happilyblogging.wordpress.com/2012/10/04/not-a-valid-glassfish-server-installation-netbeans/app
Essentially, you must stop the gf3 server and rename the console-core-X.X.X.jar located in \glassfish3\glassfish\lib\install\applications__admingui\WEB-INF\lib to console-core-3.1.2.jar
wordpress
//改爲該版本的netbeans可以集成的版本.ui