我正在尝试在Apache tomcat
的角色名称中使用完全可分辨的名称。角色名称将包含"=" chars
。
例如:
<tomcat-users>
<role rolename="cn=tomcat,dc=com"/>
<user username="tomcat" password="tomcat" roles="cn=tomcat,dc=com"/>
</tomcat-users>
当我尝试启动tomcat时,我得到:
SEVERE:为UserDatabase创建UserDatabase MBean的异常 javax.management.MalformedObjectNameException:无效字符'=' 价值的一部分财产 在javax.management.ObjectName.construct(未知来源) 在javax.management.ObjectName。(未知来源) at org.apache.catalina.mbeans.MBeanUtils.createObjectName(MBeanUtils.java:870) 在org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java:379) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:194) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:150) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:112) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:84) 在org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) 在org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) 在org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401) 在org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:346) 在org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:725) 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 在org.apache.catalina.startup.Catalina.start(Catalina.java:675) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 在org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322) 在org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:451)
答案 0 :(得分:1)
如果要将Tomcat配置为使用LDAP身份验证,请使用JNDIRealm:
http://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#JNDIRealm