When derby/java db authentication is turned on via the derby.properties file, it is impossible to stop the database by means of the stop-domain asadmin command.
Steps to reproduce:
1. Install glassfish 4 server
2. Go to as_install/glassfish and create the databases directory
3. Create derby.properties file in the as_install/glassfish/databases directory - the content of the file shall be as below:
4. Execute asadmin start-database - it will succeed.
5. Execute asadmin stop-database --dbuser APP
The command will fail with the below message:
Tue Dec 10 19:10:48 CET 2013 : Connection obtained for host: 0.0.0.0, port number 1527.
Unable to stop database. Please check log in derby.log.
Command stop-database failed.
Content of the derby.log:
Tue Dec 10 19:10:14 CET 2013 : Derby shutdown warning:
Connection authentication failure occurred. Reason: Invalid authentication..
Tested it on both Windows 7 and Mac OS X 10.9