【发布时间】:2015-10-25 11:32:33
【问题描述】:
当我尝试将我的 Web 应用程序 Testmodule 部署到 Wildfly 服务器时,我得到以下输出。我试图配置一个安全模块,即在进入应用程序之前进行用户身份验证。
用法:
休眠 2.1
Wildfly 服务器 8.2
控制台输出:
13:11:22,311 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "Testmodule.war")]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => [
"jboss.undertow.deployment.default-server.default-host./Testmodule.UndertowDeploymentInfoService is missing [jboss.security.security-domain.secureDomain]",
"jboss.deployment.unit.\"Testmodule.war\".component.DatenManager.CREATE is missing [jboss.security.security-domain.secureDomain]"]}
jboss-web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<security-domain>secureDomain</security-domain>
</jboss-web>
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<security-constraint>
<web-resource-collection>
<web-resource-name>HtmlAuth</web-resource-name>
<description>application security constraints</description>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
<http-method>DELETE</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Sample Realm</realm-name>
</login-config>
<security-role>
<role-name>admin</role-name>
</security-role>
</web-app>
standalone.xml:
...
<security-domain name="secureDomain" cache-type="default">
<authentication>
<login-module flag="required" code="Database">
<module-option name="dsJndiName" value="java:/dbexample"/>
<module-option name="principalsQuery" value="select passwd from wildfly_users where username=?"/>
<module-option name="rolesQuery" value="select role, 'Roles' from wildfly_userroles where username=?"/>
</login-module>
</authentication>
</security-domain>
...
我试图复制this book 中的示例,但由于上述错误而失败。我是 Wildfly 及其配置的新手,如果有人能告诉我错误的含义、为什么会发生以及如何修复它,我会很有帮助。谢谢!
【问题讨论】: