ActionError
does not take the error message itself. Instead, it takes a key to the error message in the application's MessageResources bundle.
From the Struts documentation on Automatic Form Validation:
Return an ActionErrors instance containing ActionMessage's, which are classes that contain the error message keys (into the application's MessageResources bundle) that should be displayed.
So, you should do something like this:
errors.add("userName",new ActionError("userName.invalid"));
Then, in your resource bundle, you should have something like this:
userName.invalid=Invalid UserName
Also, Struts 1.x is quite old and has reached End-Of-Life. If this is a new application, I would recommend looking at something newer.