【问题标题】:Liberty Profile 8.5.5 WebAppSecurityCollaboratorImpl.isUserInRole errorLiberty Profile 8.5.5 WebAppSecurityCollaboratorImpl.isUserInRole 错误
【发布时间】:2014-09-12 00:50:37
【问题描述】:

我在使用带有 LDAP 的 Liberty Profile 8.5.5 时遇到问题。 我有一个 EAR with application.xml 为安全而正确设置。 在耳朵里,我有一个正确设置了 web.xml 的 web probject。 登录身份验证顺利(request.getRemoteUser() 给出正确结果)但在接下来的操作中,当我使用 response.isUserInRoles 时返回此异常:

[致命] [isUserInRole - WebAppSecurityCollaboratorImpl.java:327] 方法中的异常 ...
异常类型:类 java.lang.NullPointerException 消息:null
java.lang.NullPointerException

我真的不明白这怎么会发生...... 如果有人有解决方案、变通方法、修复方法,请告诉我。

【问题讨论】:

  • 您好,请注意,此问题已发布到 WASdev 论坛,建议应针对 IBM 提出 PMR。这似乎已经完成。

标签: java security httprequest httpresponse websphere-liberty


【解决方案1】:

今天,我遇到了您在此处描述的完全相同的问题。我将 WebSphere Liberty Profile 8.5.5.1 与 Eclipse Kepler 一起使用。我的项目使用Wicket 框架,所以在我的 web.xml 中我有 Wicket 过滤器,如下所示:

<filter>
    <filter-name>wicket.filter</filter-name>
    <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
    <init-param>
        <param-name>applicationClassName</param-name>
        <param-value>my.wicket.Application</param-value>
    </init-param>
    <init-param>
        <param-name>configuration</param-name>
        <param-value>deployment</param-value>
    </init-param>
</servlet>

<filter-mapping>
    <filter-name>wicket.filter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

在调试时我发现在 isUserInRole 函数内部,WebSphere 似乎在寻找一个 servlet。显然,我没有在我的应用程序中使用任何 servlet,只是使用了 Wicket 过滤器。所以我的解决方法是使用 Wicket servlet 代替过滤器,这似乎工作正常。

长话短说:当您的应用程序没有任何 servlet 时,似乎 isUserInRole 不适用于 WebSphere Liberty Profile。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-01-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多