jboss 缺少.Create-部署到WildFly服务器

68bkxrlz  于 2022-11-08  发布在  其他
关注(0)|答案(1)|浏览(138)

当我尝试将我的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书中的例子,但是它失败了,出现了上面的错误。我对Wildfly和它的配置完全是个新手,如果有人能告诉我这个错误是什么意思,为什么会发生,以及如何修复它,会很有帮助。谢谢!

j2qf4p5b

j2qf4p5b1#

以下是一些值得尝试的事项:
确保在您的独立.xml中加载了安全性:

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

请确保安全域正确加载,并彻底检查日志以查找与未加载相关的错误。最可能的原因是JNDI数据源查找失败。
尝试将jboss-web.xml中的查找更改为完整的JNDI名称:

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

相关问题