Jboss 'JBAS015228: Unable to load properties' 启动时
Jboss 'JBAS015228: Unable to load properties' on statup
我正在尝试让基于表单的身份验证在 Jboss EAP 6.3 和 Oracle 11g 中工作。 但是无论输入什么,登录总是失败。
我在standalone.xml中配置了一个安全域:
<security-domain name="employee-rooster" cache-type="default">
<authentication>
<login-module code="Database" flag="required">
<module-option name="dsJndiName" value="java:jboss/datasources/OracleDS"/>
<module-option name="principalsQuery" value="SELECT PASSWORD FROM USERS WHERE USERNAME = ?"/>
<module-option name="rolesQuery" value="SELECT R.NAME, 'Roles' FROM USERS_ROLES UR INNER JOIN ROLES R ON R.ID = UR.ROLE_ID INNER JOIN USERS U ON U.ID = UR.USER_ID WHERE U.USERNAME = ?"/>
</login-module>
</authentication>
<authorization>
<policy-module code="admin" flag="required"/>
</authorization>
<audit>
<provider-module code="LogAuditProvider"/>
</audit>
</security-domain>
已配置应用程序 web.xml:
<web-app>
<security-constraint>
<display-name>auth</display-name>
<web-resource-collection>
<web-resource-name>Secure Content</web-resource-name>
<url-pattern>/register.do/this_is-it</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>employee-rooster</realm-name>
<form-login-config>
<form-login-page>/loginForm.jsp</form-login-page>
<form-error-page>/loginError.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>admin</role-name>
</security-role>
</web-app>
已配置应用程序 jboss-web.xml:
<jboss-web>
<security-domain>employee-rooster</security-domain>
<use-jboss-authorization>true</use-jboss-authorization>
</jboss-web>
并在 import.sql 中的表中添加了一些值:
CREATE TABLE USERS (ID INT, USERNAME VARCHAR(32), PASSWORD VARCHAR(32));
CREATE TABLE ROLES (ID INT, NAME VARCHAR(20));
CREATE TABLE USERS_ROLES (USER_ID INT, ROLE_ID INT);
INSERT INTO USERS (ID, USERNAME, PASSWORD) VALUES (1, 'admin', 'admin');
INSERT INTO ROLES (ID, NAME) VALUES (1, 'admin');
INSERT INTO USERS_ROLES (USER_ID, ROLE_ID) VALUES (1,1);
INSERT INTO USERS (ID, USERNAME, PASSWORD) VALUES (2, 'guest', 'guest');
INSERT INTO ROLES (ID, NAME) VALUES (2, 'guest');
INSERT INTO USERS_ROLES (USER_ID, ROLE_ID) VALUES (2,2);
但是当我部署应用程序时出现此错误:
JBAS014777: Services which failed to start: service jboss.server.controll
er.management.security_realm.employee-rooster.properties_authentication: org.jbo
ss.msc.service.StartException in service jboss.server.controller.management.secu
rity_realm.employee-rooster.properties_authentication: JBAS015228: Unable to loa
d properties
登录总是失败,我怀疑是这个原因。
是什么导致了这个错误?
在 standalone.xml
中,在 <security-realms>
下我有这个:
<security-realm name="employee-rooster">
<authentication>
<properties path="employee-rooster.properties"/>
</authentication>
</security-realm>
我删除了部分,错误消失了。不好意思,我只是忘记了那段代码。
我正在尝试让基于表单的身份验证在 Jboss EAP 6.3 和 Oracle 11g 中工作。 但是无论输入什么,登录总是失败。
我在standalone.xml中配置了一个安全域:
<security-domain name="employee-rooster" cache-type="default">
<authentication>
<login-module code="Database" flag="required">
<module-option name="dsJndiName" value="java:jboss/datasources/OracleDS"/>
<module-option name="principalsQuery" value="SELECT PASSWORD FROM USERS WHERE USERNAME = ?"/>
<module-option name="rolesQuery" value="SELECT R.NAME, 'Roles' FROM USERS_ROLES UR INNER JOIN ROLES R ON R.ID = UR.ROLE_ID INNER JOIN USERS U ON U.ID = UR.USER_ID WHERE U.USERNAME = ?"/>
</login-module>
</authentication>
<authorization>
<policy-module code="admin" flag="required"/>
</authorization>
<audit>
<provider-module code="LogAuditProvider"/>
</audit>
</security-domain>
已配置应用程序 web.xml:
<web-app>
<security-constraint>
<display-name>auth</display-name>
<web-resource-collection>
<web-resource-name>Secure Content</web-resource-name>
<url-pattern>/register.do/this_is-it</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>employee-rooster</realm-name>
<form-login-config>
<form-login-page>/loginForm.jsp</form-login-page>
<form-error-page>/loginError.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>admin</role-name>
</security-role>
</web-app>
已配置应用程序 jboss-web.xml:
<jboss-web>
<security-domain>employee-rooster</security-domain>
<use-jboss-authorization>true</use-jboss-authorization>
</jboss-web>
并在 import.sql 中的表中添加了一些值:
CREATE TABLE USERS (ID INT, USERNAME VARCHAR(32), PASSWORD VARCHAR(32));
CREATE TABLE ROLES (ID INT, NAME VARCHAR(20));
CREATE TABLE USERS_ROLES (USER_ID INT, ROLE_ID INT);
INSERT INTO USERS (ID, USERNAME, PASSWORD) VALUES (1, 'admin', 'admin');
INSERT INTO ROLES (ID, NAME) VALUES (1, 'admin');
INSERT INTO USERS_ROLES (USER_ID, ROLE_ID) VALUES (1,1);
INSERT INTO USERS (ID, USERNAME, PASSWORD) VALUES (2, 'guest', 'guest');
INSERT INTO ROLES (ID, NAME) VALUES (2, 'guest');
INSERT INTO USERS_ROLES (USER_ID, ROLE_ID) VALUES (2,2);
但是当我部署应用程序时出现此错误:
JBAS014777: Services which failed to start: service jboss.server.controll
er.management.security_realm.employee-rooster.properties_authentication: org.jbo
ss.msc.service.StartException in service jboss.server.controller.management.secu
rity_realm.employee-rooster.properties_authentication: JBAS015228: Unable to loa
d properties
登录总是失败,我怀疑是这个原因。 是什么导致了这个错误?
在 standalone.xml
中,在 <security-realms>
下我有这个:
<security-realm name="employee-rooster">
<authentication>
<properties path="employee-rooster.properties"/>
</authentication>
</security-realm>
我删除了部分,错误消失了。不好意思,我只是忘记了那段代码。