In-place deployment at C:\...(path to file)......\build\web
deploy?DEFAULT=C:\...(path to file)......\build\web&name=AffableBean&contextroot=/AffableBean&force=true failed on GlassFish Server 4.0
Error occurred during deployment: Exception while deploying the app [AffableBean] : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Access denied for user 'root'@'localhost' (using password: YES)
Error Code: 0. Please see server.log for more details.
C:\....(path to file).....\build-impl.xml:1033: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 8 seconds)
I had the same problem(I using NetBeans7.4 + glassfish4), and after experiencing painful and trying for some time, I solved this issue in the end.
update file name AffableBean->Server Resources->sun-resources.xml to glassfish-resource.xml, and using the following to replace the content of xml.
the resource-ref is for my local jdbc connector, you may need to change to yours.