如果文件中有任何更改,我在WildFly服务器中要求停止自动部署目录。 问题是我想要将特定文件夹排除在自动部署之外,而不是整个目录。
我尝试通过更改路径添加另一个与默认部署扫描程序相同的部署扫描程序,但没有成功。请告诉我在standalone.xml中进行了哪些更改。 提前谢谢。
默认部署扫描程序
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="1" auto-deploy-zipped="true" auto-deploy-exploded="true" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
</subsystem>
添加了新的部署扫描程序
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
<deployment-scanner path="deployments/demo/dist" relative-to="jboss.server.base.dir" scan-interval="1" auto-deploy-zipped="false" auto-deploy-exploded="false" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
</subsystem>
获得此例外
12:01:26,611 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:131)
at org.jboss.as.server.ServerService.boot(ServerService.java:347)
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:271)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[165,62]
Message: WFLYCTL0069: Duplicate subsystem declaration
at org.jboss.as.server.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:1195)
at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_4(StandaloneXml.java:457)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:144)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:106)
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:123)
答案 0 :(得分:1)
您现在有两个子系统名为deployment-scanner
。您只需要一个子系统条目。
我还建议您使用Web控制台或CLI添加新的部署扫描程序。使用CLI,命令看起来如下所示。
/subsystem=deployment-scanner/scanner=custom:add(path=deployments/demo/dist, relative-to=jboss.server.base.dir, scan-interval=1, auto-deploy-zipped=false, auto-deploy-exploded=false, runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}")