Apache TomEE - unable to access "TomEE GUI", "Server Status", "Manager App" and "Host Manager" services

StackOverflow https://stackoverflow.com/questions/21673759

Question

I am working with some JEE web app using Apache TomEE (apache-tomee-plus-1.5.2 on localhost) and trying to access these services from links on TomEE's home page.

Now, I remember that earlier when I was starting with developing JEE apps, I was deploying some simple exercises to TomEE server, apps were mostly about session beans and entities accessing some database. Then, I have edited [tomee]/conf/tomcat-users.xml file, configured specific roles, username and password (concretely username=tomee and password=tomee), and I was able to go to localhost:8080/tomee (Tomcat GUI), sign in with these credentials and I could see which beans are deployed to server, or which web services.

Now, when I go to [tomee]/conf folder, there is tomcat-users.xml file and there is also tomcat-users.xml.original (which is I believe automatically generated file by TomEE at the moment when I had edited tomcat-users.xml)

In both these files, there are following lines:

  <role rolename="admin-gui"/>
  <role rolename="tomee-admin"/>
  <role rolename="manager-gui"/>
  <user password="tomee" roles="tomee-admin,manager-gui,admin-gui" username="tomee"/>

Question: if these lines are present in tomee's configuration file, why am I not able to access TomEE's services ("TomEE GUI", "Server Status", "Manager App" and "Host Manager")?

Was it helpful?

Solution

Problem was in conf/server.xml file content. I have defined Realm tag I am using for accessing database from application. And this Realm tag definition should be wrapped inside Context tag, which again is inside Host tag. Actually, TomEE server was trying to look for credentials from my Realm, and not from tomcat-users.xml file.

Moving Realm definition under Host tag (Realm is also inside Context tag), problem is solved.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top