【问题标题】:.Create is missing - deployment to WildFly server.Create 丢失 - 部署到 WildFly 服务器
【发布时间】: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 及其配置的新手,如果有人能告诉我错误的含义、为什么会发生以及如何修复它,我会很有帮助。谢谢!

【问题讨论】:

    标签: hibernate jboss wildfly


    【解决方案1】:

    有几件事可以尝试:

    确保在您的standalone.xml 中加载了安全性:

    <extensions>
        <extension module="org.jboss.as.security"/>
    

    确保您的安全域正确加载,彻底检查日志以查找与未加载相关的错误。最可能的原因是 jndi 数据源查找失败。

    尝试将 jboss-web.xml 中的查找更改为完整的 jndi 名称:

    <security-domain>java:/jaas/secureDomain</security-domain>
    

    【讨论】:

    • 感谢您的建议。我已经通过了它们。安全模块已正确加载,数据源连接工作正常。身份验证背后的应用程序使用此数据库连接来提取和合并数据。使用完整的 jndi 名称并没有改变任何东西,错误仍然存​​在。我确实发现,如果我删除 jboss-web.xml 我会获得身份验证,但是当我尝试使用数据库中的合并数据登录时,它无法进行身份验证。在这种情况下,我认为他不知道要使用什么凭据,因为缺少有关数据库的信息。
    猜你喜欢
    • 2019-03-24
    • 1970-01-01
    • 2015-01-16
    • 2017-03-14
    • 1970-01-01
    • 2023-03-18
    • 1970-01-01
    • 1970-01-01
    • 2016-06-02
    相关资源
    最近更新 更多