Java EE Code Samples & Apps

Java EE Code Samples & Apps - Updates



J2EE 1.4 Sample Applications
ID Description / Workaround
6604637

J2EE 1.4 samples basic-auth and form-auth under webapps\security\apps

Issue: There are three documented ways to deploy the security sample applications.

  1. Using the asant utility
  2. Command line-based asadmin deploy
  3. Admin GUI-based deployment

The user ("j2ee") and password ("secret") are created automatically when one uses asant. However, if one chooses asadmin or the GUI console to deploy the application, the documentation doesn't describe instructions to create the user and password for the sample application to work correctly.

If the user "j2ee" is not configured then it might result in the following error:

"You could not be authenticated with the information provided..
Please check your Username and Password..

The user principal is: null"

Resolution: The fact that it complains that the user principal is "null" is an indication that the user "j2ee" is not configured.

To resolve this, create a j2ee user (defined below) before running the sample application.

To add a j2ee user:

  1. In Admin Console: Security -> Realms -> File -> Click Manage Users
  2. Click New to add a new user to the file realm.
  3. Enter the following information on the File Users page:
    • User ID (required): j2ee (the name of the user)
    • Password (required): secret (the user password)
    • Confirm password (required): secret (the user password again, for verification)
    • Group list (optional): staff (a comma-separated list of the groups to which the user belongs)
  4. Click OK to add this user to the list of users in the file realm.

Running the sample application now should succeed.


Java 8 banner (182)