tomcat9 - 401 Tomcat管理者アプリケーションにログインしようとしたときに不正エラーが発生しました。 [閉じる]

tomcat9 - 401 Tomcat管理者アプリケーションにログインしようとしたときに不正エラーが発生しました。 [閉じる]

管理者アプリケーションにログインできません。

新規インストール中にtomcat-users.xmlの編集手順に従い、tomcatを再起動しました。

役割の構成は次のとおりです。

  <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"/>

どの役割でもログインできません。インストール中に多くの権限の問題に遭遇したことを覚えていて、これが関連しているかどうか疑問に思います。 server.xmlを変更していません。

編集する:

@peterhのコメントに従って定義された唯一のユーザーは次のとおりです。

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

私がやったもう一つのことは、tomcat-user.xmlファイルから主なコメントを削除することでした。 Tomcatを再起動すると、すべてが正常です!

catalina.outの次のメッセージでこのコメントに関する通知を受け取りました。

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

関連情報