tomcat9 - 401 Unauthorized error trying to log into tomcat manager app [on hold]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
2
down vote

favorite
1












I can't log into the manager apps.



During a fresh install, I followed the instructions for editing the tomcat-users.xml, restarted tomcat



Role are configured like so:



 <role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="solaris" roles="tomcat"/>
<user username="both" password="solaris" roles="tomcat,role1"/>
<user username="role1" password="solaris" roles="role1"/>
<user username="root" password="solaris" roles="manager-gui,admin-gui"/>


I can't log in with any of the roles. I do recall having a lot of permission issues during the install and wonder if this related. I didn't make any changes to the server.xml



EDIT:



After following @peterh comments, the only defined user was



<user username="myuser" password="fancypassword" roles="manager-gui,admin-gui"/>


Another thing I did was to remove the leading comment from the tomcat-user.xml file. Restarted tomcat and all was well!



The following from catalina.out tipped me off about the comment:



06-Aug-2018 00:10:27.178 SEVERE [main] org.apache.catalina.realm.UserDatabaseRealm.startInternal Exception looking up UserDatabase under key [UserDatabase]
javax.naming.NamingException: Unexpected exception resolving reference [Root exception is org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 27; The processing instruction target matching "[xX][mM][lL]" is not allowed.]
at org.apache.naming.NamingContext.lookup(NamingContext.java:856)
at org.apache.naming.NamingContext.lookup(NamingContext.java:173)
at org.apache.catalina.realm.UserDatabaseRealm.startInternal(UserDatabaseRealm.java:213)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.realm.CombinedRealm.startInternal(CombinedRealm.java:245)
at org.apache.catalina.realm.LockOutRealm.startInternal(LockOutRealm.java:115)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 27; The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1239)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1456)
at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:400)
at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:102)
at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:94)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
at org.apache.naming.NamingContext.lookup(NamingContext.java:840)
... 20 more

06-Aug-2018 00:10:27.179 SEVERE [main] org.apache.catalina.realm.CombinedRealm.startInternal Failed to start [org.apache.catalina.realm.UserDatabaseRealm] realm
org.apache.catalina.LifecycleException: No UserDatabase component found under key [UserDatabase]
at org.apache.catalina.realm.UserDatabaseRealm.startInternal(UserDatabaseRealm.java:223)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.realm.CombinedRealm.startInternal(CombinedRealm.java:245)
at org.apache.catalina.realm.LockOutRealm.startInternal(LockOutRealm.java:115)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)

06-Aug-2018 00:10:27.184 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/docs]
06-Aug-2018 00:10:27.366 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/docs] has finished in [181] ms
06-Aug-2018 00:10:27.366 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/examples]
06-Aug-2018 00:10:27.567 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/examples] has finished in [201] ms
06-Aug-2018 00:10:27.567 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/manager]
06-Aug-2018 00:10:27.591 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/manager] has finished in [23] ms
06-Aug-2018 00:10:27.591 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/ROOT]
06-Aug-2018 00:10:27.604 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/ROOT] has finished in [12] ms
06-Aug-2018 00:10:27.604 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/host-manager]
06-Aug-2018 00:10:27.619 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/host-manager] has finished in [14] ms
06-Aug-2018 00:10:27.621 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
06-Aug-2018 00:10:27.627 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
06-Aug-2018 00:10:27.629 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 474 ms






share|improve this question













put on hold as too broad by Rui F Ribeiro, Jesse_b, SivaPrasath, schily, Jeff Schaller 2 days ago


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • Welcome on the Unix SE! You don't need: 1) tomcat roles 2) "role1" role 3) "both" user. But afaik you have to declare the "manager-gui" and "admin-gui" roles! What is in catalina.out?
    – peterh
    23 hours ago











  • The important thing is: The tomcat-users.xml must be consistent, if you use a role, you must declare it! But, the security checker methods are using simple string comparison, i.e. all the users have a Set<String> of the roles they have. This stringset is constructed from the xml (more advanced tomcat configurations may generate it from other sources, too, for example from some single-sign-on server or from LDAP, etc).
    – peterh
    23 hours ago










  • @peterh, I did manage to boil it down some. You're right, this thing been driving me bonkers.
    – vector
    23 hours ago










  • @peterh, spot on. The funny thing is I had to remove the leading comment from the xml file. I added catalina.out output to the question edit. If you would turn you comment into the answer, I'll gladly accept it.
    – vector
    22 hours ago










  • SAX is an xml parsing/processing library, SAXParseException means a syntax error in the xml test. The cause of your problem was not the comment, but that the xml had a syntax error. Removing the comment you've also removed the syntax error.
    – peterh
    22 hours ago
















up vote
2
down vote

favorite
1












I can't log into the manager apps.



During a fresh install, I followed the instructions for editing the tomcat-users.xml, restarted tomcat



Role are configured like so:



 <role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="solaris" roles="tomcat"/>
<user username="both" password="solaris" roles="tomcat,role1"/>
<user username="role1" password="solaris" roles="role1"/>
<user username="root" password="solaris" roles="manager-gui,admin-gui"/>


I can't log in with any of the roles. I do recall having a lot of permission issues during the install and wonder if this related. I didn't make any changes to the server.xml



EDIT:



After following @peterh comments, the only defined user was



<user username="myuser" password="fancypassword" roles="manager-gui,admin-gui"/>


Another thing I did was to remove the leading comment from the tomcat-user.xml file. Restarted tomcat and all was well!



The following from catalina.out tipped me off about the comment:



06-Aug-2018 00:10:27.178 SEVERE [main] org.apache.catalina.realm.UserDatabaseRealm.startInternal Exception looking up UserDatabase under key [UserDatabase]
javax.naming.NamingException: Unexpected exception resolving reference [Root exception is org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 27; The processing instruction target matching "[xX][mM][lL]" is not allowed.]
at org.apache.naming.NamingContext.lookup(NamingContext.java:856)
at org.apache.naming.NamingContext.lookup(NamingContext.java:173)
at org.apache.catalina.realm.UserDatabaseRealm.startInternal(UserDatabaseRealm.java:213)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.realm.CombinedRealm.startInternal(CombinedRealm.java:245)
at org.apache.catalina.realm.LockOutRealm.startInternal(LockOutRealm.java:115)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 27; The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1239)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1456)
at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:400)
at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:102)
at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:94)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
at org.apache.naming.NamingContext.lookup(NamingContext.java:840)
... 20 more

06-Aug-2018 00:10:27.179 SEVERE [main] org.apache.catalina.realm.CombinedRealm.startInternal Failed to start [org.apache.catalina.realm.UserDatabaseRealm] realm
org.apache.catalina.LifecycleException: No UserDatabase component found under key [UserDatabase]
at org.apache.catalina.realm.UserDatabaseRealm.startInternal(UserDatabaseRealm.java:223)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.realm.CombinedRealm.startInternal(CombinedRealm.java:245)
at org.apache.catalina.realm.LockOutRealm.startInternal(LockOutRealm.java:115)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)

06-Aug-2018 00:10:27.184 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/docs]
06-Aug-2018 00:10:27.366 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/docs] has finished in [181] ms
06-Aug-2018 00:10:27.366 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/examples]
06-Aug-2018 00:10:27.567 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/examples] has finished in [201] ms
06-Aug-2018 00:10:27.567 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/manager]
06-Aug-2018 00:10:27.591 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/manager] has finished in [23] ms
06-Aug-2018 00:10:27.591 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/ROOT]
06-Aug-2018 00:10:27.604 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/ROOT] has finished in [12] ms
06-Aug-2018 00:10:27.604 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/host-manager]
06-Aug-2018 00:10:27.619 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/host-manager] has finished in [14] ms
06-Aug-2018 00:10:27.621 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
06-Aug-2018 00:10:27.627 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
06-Aug-2018 00:10:27.629 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 474 ms






share|improve this question













put on hold as too broad by Rui F Ribeiro, Jesse_b, SivaPrasath, schily, Jeff Schaller 2 days ago


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • Welcome on the Unix SE! You don't need: 1) tomcat roles 2) "role1" role 3) "both" user. But afaik you have to declare the "manager-gui" and "admin-gui" roles! What is in catalina.out?
    – peterh
    23 hours ago











  • The important thing is: The tomcat-users.xml must be consistent, if you use a role, you must declare it! But, the security checker methods are using simple string comparison, i.e. all the users have a Set<String> of the roles they have. This stringset is constructed from the xml (more advanced tomcat configurations may generate it from other sources, too, for example from some single-sign-on server or from LDAP, etc).
    – peterh
    23 hours ago










  • @peterh, I did manage to boil it down some. You're right, this thing been driving me bonkers.
    – vector
    23 hours ago










  • @peterh, spot on. The funny thing is I had to remove the leading comment from the xml file. I added catalina.out output to the question edit. If you would turn you comment into the answer, I'll gladly accept it.
    – vector
    22 hours ago










  • SAX is an xml parsing/processing library, SAXParseException means a syntax error in the xml test. The cause of your problem was not the comment, but that the xml had a syntax error. Removing the comment you've also removed the syntax error.
    – peterh
    22 hours ago












up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





I can't log into the manager apps.



During a fresh install, I followed the instructions for editing the tomcat-users.xml, restarted tomcat



Role are configured like so:



 <role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="solaris" roles="tomcat"/>
<user username="both" password="solaris" roles="tomcat,role1"/>
<user username="role1" password="solaris" roles="role1"/>
<user username="root" password="solaris" roles="manager-gui,admin-gui"/>


I can't log in with any of the roles. I do recall having a lot of permission issues during the install and wonder if this related. I didn't make any changes to the server.xml



EDIT:



After following @peterh comments, the only defined user was



<user username="myuser" password="fancypassword" roles="manager-gui,admin-gui"/>


Another thing I did was to remove the leading comment from the tomcat-user.xml file. Restarted tomcat and all was well!



The following from catalina.out tipped me off about the comment:



06-Aug-2018 00:10:27.178 SEVERE [main] org.apache.catalina.realm.UserDatabaseRealm.startInternal Exception looking up UserDatabase under key [UserDatabase]
javax.naming.NamingException: Unexpected exception resolving reference [Root exception is org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 27; The processing instruction target matching "[xX][mM][lL]" is not allowed.]
at org.apache.naming.NamingContext.lookup(NamingContext.java:856)
at org.apache.naming.NamingContext.lookup(NamingContext.java:173)
at org.apache.catalina.realm.UserDatabaseRealm.startInternal(UserDatabaseRealm.java:213)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.realm.CombinedRealm.startInternal(CombinedRealm.java:245)
at org.apache.catalina.realm.LockOutRealm.startInternal(LockOutRealm.java:115)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 27; The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1239)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1456)
at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:400)
at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:102)
at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:94)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
at org.apache.naming.NamingContext.lookup(NamingContext.java:840)
... 20 more

06-Aug-2018 00:10:27.179 SEVERE [main] org.apache.catalina.realm.CombinedRealm.startInternal Failed to start [org.apache.catalina.realm.UserDatabaseRealm] realm
org.apache.catalina.LifecycleException: No UserDatabase component found under key [UserDatabase]
at org.apache.catalina.realm.UserDatabaseRealm.startInternal(UserDatabaseRealm.java:223)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.realm.CombinedRealm.startInternal(CombinedRealm.java:245)
at org.apache.catalina.realm.LockOutRealm.startInternal(LockOutRealm.java:115)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)

06-Aug-2018 00:10:27.184 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/docs]
06-Aug-2018 00:10:27.366 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/docs] has finished in [181] ms
06-Aug-2018 00:10:27.366 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/examples]
06-Aug-2018 00:10:27.567 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/examples] has finished in [201] ms
06-Aug-2018 00:10:27.567 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/manager]
06-Aug-2018 00:10:27.591 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/manager] has finished in [23] ms
06-Aug-2018 00:10:27.591 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/ROOT]
06-Aug-2018 00:10:27.604 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/ROOT] has finished in [12] ms
06-Aug-2018 00:10:27.604 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/host-manager]
06-Aug-2018 00:10:27.619 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/host-manager] has finished in [14] ms
06-Aug-2018 00:10:27.621 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
06-Aug-2018 00:10:27.627 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
06-Aug-2018 00:10:27.629 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 474 ms






share|improve this question













I can't log into the manager apps.



During a fresh install, I followed the instructions for editing the tomcat-users.xml, restarted tomcat



Role are configured like so:



 <role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="solaris" roles="tomcat"/>
<user username="both" password="solaris" roles="tomcat,role1"/>
<user username="role1" password="solaris" roles="role1"/>
<user username="root" password="solaris" roles="manager-gui,admin-gui"/>


I can't log in with any of the roles. I do recall having a lot of permission issues during the install and wonder if this related. I didn't make any changes to the server.xml



EDIT:



After following @peterh comments, the only defined user was



<user username="myuser" password="fancypassword" roles="manager-gui,admin-gui"/>


Another thing I did was to remove the leading comment from the tomcat-user.xml file. Restarted tomcat and all was well!



The following from catalina.out tipped me off about the comment:



06-Aug-2018 00:10:27.178 SEVERE [main] org.apache.catalina.realm.UserDatabaseRealm.startInternal Exception looking up UserDatabase under key [UserDatabase]
javax.naming.NamingException: Unexpected exception resolving reference [Root exception is org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 27; The processing instruction target matching "[xX][mM][lL]" is not allowed.]
at org.apache.naming.NamingContext.lookup(NamingContext.java:856)
at org.apache.naming.NamingContext.lookup(NamingContext.java:173)
at org.apache.catalina.realm.UserDatabaseRealm.startInternal(UserDatabaseRealm.java:213)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.realm.CombinedRealm.startInternal(CombinedRealm.java:245)
at org.apache.catalina.realm.LockOutRealm.startInternal(LockOutRealm.java:115)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 27; The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1239)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1456)
at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:400)
at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:102)
at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:94)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
at org.apache.naming.NamingContext.lookup(NamingContext.java:840)
... 20 more

06-Aug-2018 00:10:27.179 SEVERE [main] org.apache.catalina.realm.CombinedRealm.startInternal Failed to start [org.apache.catalina.realm.UserDatabaseRealm] realm
org.apache.catalina.LifecycleException: No UserDatabase component found under key [UserDatabase]
at org.apache.catalina.realm.UserDatabaseRealm.startInternal(UserDatabaseRealm.java:223)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.realm.CombinedRealm.startInternal(CombinedRealm.java:245)
at org.apache.catalina.realm.LockOutRealm.startInternal(LockOutRealm.java:115)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)

06-Aug-2018 00:10:27.184 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/docs]
06-Aug-2018 00:10:27.366 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/docs] has finished in [181] ms
06-Aug-2018 00:10:27.366 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/examples]
06-Aug-2018 00:10:27.567 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/examples] has finished in [201] ms
06-Aug-2018 00:10:27.567 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/manager]
06-Aug-2018 00:10:27.591 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/manager] has finished in [23] ms
06-Aug-2018 00:10:27.591 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/ROOT]
06-Aug-2018 00:10:27.604 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/ROOT] has finished in [12] ms
06-Aug-2018 00:10:27.604 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/host-manager]
06-Aug-2018 00:10:27.619 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/host-manager] has finished in [14] ms
06-Aug-2018 00:10:27.621 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
06-Aug-2018 00:10:27.627 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
06-Aug-2018 00:10:27.629 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 474 ms








share|improve this question












share|improve this question




share|improve this question








edited 22 hours ago
























asked 2 days ago









vector

1114




1114




put on hold as too broad by Rui F Ribeiro, Jesse_b, SivaPrasath, schily, Jeff Schaller 2 days ago


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






put on hold as too broad by Rui F Ribeiro, Jesse_b, SivaPrasath, schily, Jeff Schaller 2 days ago


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • Welcome on the Unix SE! You don't need: 1) tomcat roles 2) "role1" role 3) "both" user. But afaik you have to declare the "manager-gui" and "admin-gui" roles! What is in catalina.out?
    – peterh
    23 hours ago











  • The important thing is: The tomcat-users.xml must be consistent, if you use a role, you must declare it! But, the security checker methods are using simple string comparison, i.e. all the users have a Set<String> of the roles they have. This stringset is constructed from the xml (more advanced tomcat configurations may generate it from other sources, too, for example from some single-sign-on server or from LDAP, etc).
    – peterh
    23 hours ago










  • @peterh, I did manage to boil it down some. You're right, this thing been driving me bonkers.
    – vector
    23 hours ago










  • @peterh, spot on. The funny thing is I had to remove the leading comment from the xml file. I added catalina.out output to the question edit. If you would turn you comment into the answer, I'll gladly accept it.
    – vector
    22 hours ago










  • SAX is an xml parsing/processing library, SAXParseException means a syntax error in the xml test. The cause of your problem was not the comment, but that the xml had a syntax error. Removing the comment you've also removed the syntax error.
    – peterh
    22 hours ago
















  • Welcome on the Unix SE! You don't need: 1) tomcat roles 2) "role1" role 3) "both" user. But afaik you have to declare the "manager-gui" and "admin-gui" roles! What is in catalina.out?
    – peterh
    23 hours ago











  • The important thing is: The tomcat-users.xml must be consistent, if you use a role, you must declare it! But, the security checker methods are using simple string comparison, i.e. all the users have a Set<String> of the roles they have. This stringset is constructed from the xml (more advanced tomcat configurations may generate it from other sources, too, for example from some single-sign-on server or from LDAP, etc).
    – peterh
    23 hours ago










  • @peterh, I did manage to boil it down some. You're right, this thing been driving me bonkers.
    – vector
    23 hours ago










  • @peterh, spot on. The funny thing is I had to remove the leading comment from the xml file. I added catalina.out output to the question edit. If you would turn you comment into the answer, I'll gladly accept it.
    – vector
    22 hours ago










  • SAX is an xml parsing/processing library, SAXParseException means a syntax error in the xml test. The cause of your problem was not the comment, but that the xml had a syntax error. Removing the comment you've also removed the syntax error.
    – peterh
    22 hours ago















Welcome on the Unix SE! You don't need: 1) tomcat roles 2) "role1" role 3) "both" user. But afaik you have to declare the "manager-gui" and "admin-gui" roles! What is in catalina.out?
– peterh
23 hours ago





Welcome on the Unix SE! You don't need: 1) tomcat roles 2) "role1" role 3) "both" user. But afaik you have to declare the "manager-gui" and "admin-gui" roles! What is in catalina.out?
– peterh
23 hours ago













The important thing is: The tomcat-users.xml must be consistent, if you use a role, you must declare it! But, the security checker methods are using simple string comparison, i.e. all the users have a Set<String> of the roles they have. This stringset is constructed from the xml (more advanced tomcat configurations may generate it from other sources, too, for example from some single-sign-on server or from LDAP, etc).
– peterh
23 hours ago




The important thing is: The tomcat-users.xml must be consistent, if you use a role, you must declare it! But, the security checker methods are using simple string comparison, i.e. all the users have a Set<String> of the roles they have. This stringset is constructed from the xml (more advanced tomcat configurations may generate it from other sources, too, for example from some single-sign-on server or from LDAP, etc).
– peterh
23 hours ago












@peterh, I did manage to boil it down some. You're right, this thing been driving me bonkers.
– vector
23 hours ago




@peterh, I did manage to boil it down some. You're right, this thing been driving me bonkers.
– vector
23 hours ago












@peterh, spot on. The funny thing is I had to remove the leading comment from the xml file. I added catalina.out output to the question edit. If you would turn you comment into the answer, I'll gladly accept it.
– vector
22 hours ago




@peterh, spot on. The funny thing is I had to remove the leading comment from the xml file. I added catalina.out output to the question edit. If you would turn you comment into the answer, I'll gladly accept it.
– vector
22 hours ago












SAX is an xml parsing/processing library, SAXParseException means a syntax error in the xml test. The cause of your problem was not the comment, but that the xml had a syntax error. Removing the comment you've also removed the syntax error.
– peterh
22 hours ago




SAX is an xml parsing/processing library, SAXParseException means a syntax error in the xml test. The cause of your problem was not the comment, but that the xml had a syntax error. Removing the comment you've also removed the syntax error.
– peterh
22 hours ago















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay