This is because of change in implementation of ApplicationArchivist.java in GlassFish 4.0
In 4.0, DOLUtils.carType() is used to obtain the CAR module type instead of how it was done in 3.x version where XModuleType.CAR was used.
In 3.x, XModuleType.CAR was just an enum/constant value. However, in 4.0, the DOLUtils.carType() computes the CAR module type by doing:
The above code returns a non null module type value only if the application server distribution contains the container that could handle the CAR modules.
But glassfish-embedded-all.jar does not bundle the appclient container so the above code return NULL. Hence the EAR application fails.