0

I have a Glassfish server in production which uses JDBC Realm for authentication. It works well, but there is the need to change all the roles/groups. I developed a new version of the web application in a test environment changing glassfish-web.xml and web.xml to align them with the groups contained in the groups table on the db for test. Everything works flawlessly. So I moved the web application to the production environment and updated the content of the groups table on production db. The authentication works well but roles are not recognized. How can I investigate this problem ? I checked the production db and the groups table is fine and can be accessed for select. Glassfish-web.xml and web.xml are the same of the test enviroment. This is a real brain teaser. The only explanation I can give is that Glassfish-web.xml is discarded for unknown reasons or the old file is still present and read from some other location than web-inf directory.

Thanks for any help

Filippo

Filippo
  • 1,123
  • 1
  • 11
  • 28

1 Answers1

0

Explore your domain's folder under GlassFish root folder + \domains. If you are unsure what domain you are on, it is domain1 by default. Under this folder you should have a folder called applications. This folder contains the deployed version of all your applications, and it's the place where to check your application's Glassfish-web.xml configuration file.

Anyway, if you are having this kind of problems, a Clean & Build of your project, followed by a redeploy, usually works.

perissf
  • 15,979
  • 14
  • 80
  • 117
  • The applications folder is empty. The domain.xml points to a different directory which contains all the application files. In production I have only Glassfish server so I can only move files from test environment there, I cannot build and deploy from production server. – Filippo Jun 20 '12 at 11:33
  • If your applications folder is empty, I suggest to create a new domain from scratch and make it the default domain. Moving the files it's not enough, you need to deploy your ear or war. Before deployment, you can change your descriptor files without rebuilding anything. – perissf Jun 20 '12 at 14:45
  • Following yout first clue I found the directory domains\domain1\generated\policy\appName\appName. It contains two files, granted.policy and excluded.policy, which contains permission informations based on elaboration of glassfish-web and web.xml. Its content was aligned with the previous configuration, not the one with the new roles, so I deleted the entire content of /generated and at the restart of the server it was re-created. Now the groups/roles are correctly recognized, so, in the end, it was a problem of cached data. – Filippo Jun 21 '12 at 06:40