Friday, 26 November 2010

Apache Archiva admin account locked

(Archiva 1.1.3 with default Derby database)

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:
    • ENCODED_PASSWORD - copy the encoded password value from the account created in the second step
    • LOCKED = N
  • 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.


Anonymous said...

Saved my day.
Thank you!

Anonymous said...

Thank you, thank you, thank you! This worked perfectly.


Jubz said...

Good one! This was getting on my nerves, accounts always locked out.

Anonymous said...

Worked well. Thanks

Mourad said...

thx !!!!!!!!

Anonymous said...

Great post!
I had a problem that there was no SMTP server configured, so user creation was failing; thus password copying technique did not work.

But installation was pretty fresh, so w/o any damage I have deleted users database (at /$archiva_home$/data/databases/users) and after Archiva restart it asked to reenter admin password again.

* Stop Archiva
* Backup users database
* Delete /$archiva_home$/data/databases/users dir
* Start Archiva
* Go to Archiva home page
* Enter new admin password
* Enjoy!

All credits goes to

CA Development said...

Thank you very much for the great explanation!!

I already tried to add the following security settings to the file ""


but without success so far (I have no idea what's the problem).
But your proposal worked well!!

Unknown said...

Thank you. This article helped to resolve the issue for me

Popular Posts