小编Moh*_*ish的帖子

javax.servlet.ServletException:UT010031:登录失败

我正在尝试通过和JEE使用JAAS编程安全性来构建应用程序,但是我从未成功登录,但总是收到错误提示,这是我的代码:WildFly 10Postgres Database**javax.servlet.ServletException: UT010031: Login failed**

Postgres 数据库表:

CREATE TABLE users
(
  id bigint NOT NULL,
  pass character varying(255),
  role character varying(255),
  username character varying(255),
  version bigint,
  CONSTRAINT users_pkey PRIMARY KEY (id)
)
Run Code Online (Sandbox Code Playgroud)

数据表行内容:

287;"8D969EEF6ECAD3C29A3A629280E686CF0C3F5D5A86AFF3CA12020C923ADC6C92";"ADMIN";"administrator";1
Run Code Online (Sandbox Code Playgroud)

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">
    <display-name>Karbonic</display-name>

    <servlet>
        <servlet-name>FacesServlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>FacesServlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>/public/home.xhtml</welcome-file>
    </welcome-file-list>

    <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>main-realm</realm-name>
        <form-login-config>
            <form-login-page>/public/login.xhtml</form-login-page>
            <form-error-page>/public/login.xhtml</form-error-page>
        </form-login-config>
    </login-config>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Administrator</web-resource-name>
            <url-pattern>/users/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>ADMIN</role-name> …
Run Code Online (Sandbox Code Playgroud)

jaas java-ee jdbcrealm wildfly wildfly-10

5
推荐指数
0
解决办法
2108
查看次数

标签 统计

jaas ×1

java-ee ×1

jdbcrealm ×1

wildfly ×1

wildfly-10 ×1