Just ran into a great error on upgrading to Glassfish 4.  Couple of references to it from Google but no solution.

Glassfish log:

[2013-12-22T07:02:51.014+1100] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=36 _ThreadName=admin-listener(4)] [timeMillis: 1387656171014] [levelValue: 1000] [[
  Exception while loading the app : CDI deployment failure:WELD-001301 Annotation @org.glassfish.api.admin.RestEndpoints(value=[@org.glassfish.api.admin.RestEndpoint(description=disable-secure-admin, path=disable-secure-admin, opType=POST, params=[], useForAuthorization=false, configBean=interface com.sun.enterprise.config.serverbeans.Domain)]) is not a qualifier
org.jboss.weld.exceptions.IllegalArgumentException: WELD-001301 Annotation @org.glassfish.api.admin.RestEndpoints(value=[@org.glassfish.api.admin.RestEndpoint(description=disable-secure-admin, path=disable-secure-admin, opType=POST, params=[], useForAuthorization=false, configBean=interface com.sun.enterprise.config.serverbeans.Domain)]) is not a qualifier

Turns out I had some modules from Glassfish included into a library in the project so I could compile some EJBs.  Turns out as well that including that library in the deployed EAR is a bad idea :).

Simply told Netbeans not to package it in the Project Properties -> Libraries page and all was good again.

Simple error – only put it here because I couldn’t find anything on the net.  Had to do the hard yards myself.  Hate that!

Oh yes – and you have to clean and build otherwise the library doesn’t get cleaned out from the build directory.  (I know it’s obvious – but it messed me up for a while.)