当我尝试将我的Web应用程序Testmodule部署到Wildfly服务器时,我得到以下输出。我试图在到达应用程序之前配置安全模块,即用户身份验证。
用途:
Hibernate 2.1
Wildfly Server 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本书中的示例,但是由于上述错误而失败了。我是Wildfly及其配置的新手,如果有人能告诉我这个错误意味着什么,它为什么会发生以及如何解决它,将会很有帮助。谢谢!
答案 0 :(得分:0)
要尝试的一些事项:
确保在standalone.xml中加载安全性:
<extensions>
<extension module="org.jboss.as.security"/>
确保您的安全域正确加载,彻底检查日志以查找与未加载相关的错误。最可能的原因是jndi数据源查找失败。
尝试将jboss-web.xml中的查找更改为完整的jndi名称:
<security-domain>java:/jaas/secureDomain</security-domain>