Many times I have had this problem. It's time to note the solution here, so I would not waste any time in the future. I just forgot the admin password or locked it some way.
Here is a step by step solution:
- Download and install some database client for Derby (I have SQuirreL SQL Client 3.2.0).
- Create new account on Archiva's Web interface, and remember the password.
- Stop Archiva on server.
- Locate users database folder on the server (I have it in /usr/share/apache-archiva/data/databases/users/), make a backup and download it to your local machine, and then remove the content of this folder on server.
- Connect to the database with your client (in SQuirreL, I'm using Apache Derby Embedded driver and jdbc:derby:C:/derby_home/databases/users/ as URL with user name sa).
If you get an error Error occured in IPlugin.sessionStarted() for Hibernate Plugin within SQuirreL, just ignore (close) it. - Find table JDOUSER within SA schema and open its content for editing (in SQuirreL: right click on content and then click Make Editable).
- Set values for all or just for admin account:
- COUNT_FAILED_LOGIN_ATTEMPTS = 0
- ENCODED_PASSWORD - copy the encoded password value from the account created in the second step
- LOCKED = N
- PASSWORD_CHANGE_REQUIRED = N
- PERMANENT = Y
- VALIDATED = Y
- Close the database session.
- Copy all files from local database folder to server's database folder.
- Run the Apache Archiva and log in as admin with password that you set for the new account in the step 2 of this guide.
