websphere – 无法使用ibm-application-bnd.xml将角色映射到组
发布时间:2020-12-16 23:01:12 所属栏目:百科 来源:网络整理
导读:我正在尝试使用ibm-application-bnd.xml映射用户组.将它放入META-INF文件夹.在尝试访问安全页面时获取下一条消息: [08.05.15 17:42:21:242 MSK] 00000084 WebCollaborat A SECJ0129E: ... GET в null:/loginmodule/date/,Authorization failed,Not granted
我正在尝试使用ibm-application-bnd.xml映射用户组.将它放入META-INF文件夹.在尝试访问安全页面时获取下一条消息:
[08.05.15 17:42:21:242 MSK] 00000084 WebCollaborat A SECJ0129E: ... GET в null:/loginmodule/date/,Authorization failed,Not granted any of the required roles: user-role 当我尝试使用ibm控制台进行配置时,它可以工作.所有配置WAS都写入ibm-application-bnd.xmi而不是ibm-application-bnd.xml. 我错了什么? IBM应用-bnd.xml: <?xml version="1.0" encoding="UTF-8"?> <application-bnd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://websphere.ibm.com/dxml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-application-bnd_1_2.xsd" xmlns="http://websphere.ibm.com/xml/ns/javaee" version="1.2"> <security-role name="user-role"> <group name="user-group" /> </security-role> </application-bnd> web.xml中: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <session-config> <session-timeout>30</session-timeout> </session-config> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> <security-constraint> <display-name>Constraint</display-name> <web-resource-collection> <web-resource-name>secrets</web-resource-name> <description /> <url-pattern>/date/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>user-role</role-name> </auth-constraint> </security-constraint> <security-role> <role-name>user-role</role-name> </security-role> <servlet> <servlet-name>date</servlet-name> <servlet-class>ru.servlet.TimeServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>date</servlet-name> <url-pattern>/date/*</url-pattern> </servlet-mapping> </web-app> 解决方法
WebSphere Application Server仅使用XML for EE 5,并且基于每个部署描述符做出该决定.如果正在使用ibm-application-bnd.xmi,那么我怀疑你的application.xml的版本=“1.4”或更低版本,所以在更新到EE 5 XML头之后再试一次(删除doctype,添加xmlns,添加xmlns:xsi,添加xsi:schemaLocation,更新版本属性).
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |