In the new Glassfish 4.1 the package javax.enterprise.context containing annotation SessionScoped for instance is missing.
add cdi-api.jar to the project by right-clicking on Libraries, selecting Add JAR/Folder, and selecting cdi-api.jar from the modules folder of glassfish installation.