-1

I am trying to migrate some software from JBoss 5 to JBoss 7. I am stuck, as my deployment fails with the below exceptions. Keep in mind that the software is working in JBoss 5, so anything that is not working should be because of differences between JBoss 5/7, I assume.

The line in question (line 12, as pointed to in the exception), is the following:

<application-policy xmlns="urn:jboss:security-beans:1.0" name="MyProjectDatabaseLogin">

The errors/exceptions are:

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."myear.ear".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."myear.ear".PARSE: WFLYSRV0153: Failed to process phase PARSE of deployment "myear.ear"
    [stack trace omitted]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYPOJO0038: Exception while parsing POJO descriptor file: "/content/myear.ear/META-INF/myproject-auth-jboss-beans.xml"
    [stack trace omitted]
Caused by: org.projectodd.vdx.core.XMLStreamValidationException: ParseError at [row,col]:[12,4]
Message: ParseError at [row,col]:[12,4]
Message: WFLYCTL0198: Unexpected element '{urn:jboss:security-beans:1.0}application-policy' encountered
    [stack trace omitted]

ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "myear.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"myear.ear\".PARSE" => "WFLYSRV0153: Failed to process phase PARSE of deployment \"myear.ear\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYPOJO0038: Exception while parsing POJO descriptor file: \"/content/myear.ear/META-INF/myproject-auth-jboss-beans.xml\"
    Caused by: org.projectodd.vdx.core.XMLStreamValidationException: ParseError at [row,col]:[12,4]
Message: ParseError at [row,col]:[12,4]
Message: WFLYCTL0198: Unexpected element '{urn:jboss:security-beans:1.0}application-policy' encountered"}}

Why is application-policy (or the xmlns value for it) unexpected here? What is causing this exception?


I had to manually type the above xml line and errors/exceptions, so it is possible there could be some typos not actually present in the original which do not contribute to the problem, though I have reread my question here several times and I don't think I typo'd the above.

4

1 回答 1

1

我最终发现这些可配置项目不再应该在同一个文件中。此信息现在应该在服务器的配置文件中,因此您可能会将其放入domain.xml文件或standalone.xml文件中。

这是一个安全应用程序策略,因此该标签的内容现在进入标签<security-domains>中的部分<security-domain>

所以它会像下面这样。请注意,<application-policy ...>是 now<security-domain ...>并且它在<security-domains>. 此外,我之前的安全应用程序策略中有两个<login-module>,但如果使用新的 elytra 安全系统,则<login-module>安全域中只允许 1 个标签......

...
    <security-domains> <!-- Search for this in the file and put the migrated part into here -->
        <security-domain name="MySecurityDomain">
            ... all the stuff that used to be in the security application policy
            ... note that some of the stuff you put in here might need to change depending on the security system used
        </security-domain>
    </security-domains>
...
于 2018-07-09T14:45:03.760 回答