Sunday, December 11, 2011

JBOSS Error UsersRolesLoginModule.login Missing users.properties file

Error:



18:32:48,113 ERROR [org.jboss.security.authentication.JBossCachedAuthenticationManager] (http-ebiz3.cup.hp.com-16.89.84.96-8008-1) Login failure: javax.security.auth.login.LoginException: Missing users.properties file.
        at org.jboss.security.auth.spi.UsersRolesLoginModule.login(UsersRolesLoginModule.java:150) [picketbox-4.0.1.jar:4.0.1]

Explanation:

It suggests that the security domain "UsersRoles" in Jboss7 is enabled in standalone.xml and files "users.properties" and "roles.properties" are referenced in this file. However an application that is deployed cannot locate these files.

The files generally are in $JBOSS_HOME/standalone/configuration for standalone implementation. However individual application are looking for these files in $JBOSS_HOME/standalone/deployments/<application>/WEB-INF/classes directory. In my case it was:



/home/oracle/jboss702/standalone/deployments/m.war


I did not have the classes directory at the above location neither did my application was unexploded - so I do not have any directory structure either.


Solution:


I have 2 options:


Options 1


Unzar my application and then create directory classes and copy files from configuration dorectoru to this directory and test.


Option 2:


I do exactly as in option 2. However re-jar them to have an application as m.war rather than a directory as m.war.


Repackage as  "jar -cvf *"
Unpackage  as  "jar -xvf m.war"


In either way it will work..



No comments:

Post a Comment