Doctor - it hurts when I do this.
Don't do that
In other words, your Netbeans configuration is obviously using a port you're blocking with iptables.
So don't block it
I'm guessing the problem is with Glassfish. I'm also guessing that you want Netbeans for doing J2EE development. In which case, you probably *want* to use Glassfish. Just keep the port enabled, and Life should be Good