0

出于某种原因,如果我在部署路径上使用战争启动服务器,服务器将超时。如果我启动服务器并立即部署战争,它们会毫无问题地部署。那么,有没有办法仅将部署延迟到启动后?

记录直到出现超时:

 [] 2019-10-17 14:25:01,442 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-3) WFLYDM0111: Keystore C:\Software\wildfly-11.0.0.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
[] 2019-10-17 14:25:09,163 WARN  [org.jboss.as.weld] (ServerService Thread Pool -- 69) WFLYWELD0052: Using deployment classloader to load proxy classes for module com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider. Package-private access will not work. To fix this the module should declare dependencies on [org.jboss.weld.core, org.jboss.weld.spi]
[] 2019-10-17 14:25:13,953 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-5) WFLYSRV0018: Deployment "deployment.backend-2.0-SNAPSHOT.war" is using a private module ("org.apache.httpcomponents") which may be changed or removed in future versions without notice.
[] 2019-10-17 14:25:15,296 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,301 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,302 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,303 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,303 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,303 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,303 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,304 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,304 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,304 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,304 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,304 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,305 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,305 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,305 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,305 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,305 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,305 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,308 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 67) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:15,309 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 66) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:18,964 WARN  [org.jboss.as.weld] (ServerService Thread Pool -- 77) WFLYWELD0052: Using deployment classloader to load proxy classes for module com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider. Package-private access will not work. To fix this the module should declare dependencies on [org.jboss.weld.core, org.jboss.weld.spi]
[] 2019-10-17 14:25:25,824 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,824 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,824 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,824 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,825 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,825 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,825 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,825 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,825 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:25,826 WARN  [org.hibernate.dialect.function.TemplateRenderer] (ServerService Thread Pool -- 74) HHH000174: Function template anticipated 4 arguments, but 1 arguments encountered
[] 2019-10-17 14:25:26,736 WARN  [org.hibernate.jpa.internal.metamodel.MetadataContext] (ServerService Thread Pool -- 74) HHH015011: Unable to locate static metamodel field : eu.glsgroup.fpcs.persistence.backend.ShipmentTypeTranslation_#language; this may or may not indicate a problem with the static metamodel
[] 2019-10-17 14:25:26,736 WARN  [org.hibernate.jpa.internal.metamodel.MetadataContext] (ServerService Thread Pool -- 74) HHH015011: Unable to locate static metamodel field : eu.glsgroup.fpcs.persistence.backend.ShipmentTypeTranslation_#importsource; this may or may not indicate a problem with the static metamodel
[] 2019-10-17 14:25:26,743 WARN  [org.hibernate.jpa.internal.metamodel.MetadataContext] (ServerService Thread Pool -- 74) HHH015011: Unable to locate static metamodel field : eu.glsgroup.fpcs.persistence.backend.ShipmentSourceTranslation_#language; this may or may not indicate a problem with the static metamodel
[] 2019-10-17 14:25:26,743 WARN  [org.hibernate.jpa.internal.metamodel.MetadataContext] (ServerService Thread Pool -- 74) HHH015011: Unable to locate static metamodel field : eu.glsgroup.fpcs.persistence.backend.ShipmentSourceTranslation_#importsource; this may or may not indicate a problem with the static metamodel
[] 2019-10-17 14:30:01,444 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0348: Timeout after [300] seconds waiting for service container stability. Operation will roll back. Step that first updated the service container was 'add' at address '[
    ("core-service" => "management"),
    ("management-interface" => "http-interface")
]'
4

1 回答 1

1

我想你可能会对增加 Wildfly 的超时时间感兴趣,因为应用程序的默认超时时间是 5 分钟。

所以你可以调整你的standalone.xml并使用类似这个例子的东西,顺便说一下,时间以秒为单位,所以 900 秒就是 15 分钟......

这是一个链接,因此您可以检查您可能需要的更多变量(它适用于 Wildfly 10,但我认为 Wildfly 11 也是如此)。因此,您可以scan-interval通过更改/添加新的path.

1 选项 -> 增加超时:

<system-properties>
    <property name="jboss.as.management.blocking.timeout" value="900"/>
</system-properties>
...
<profile>
    ...
    <subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
        <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" 
          scan-interval="5000" deployment-timeout="900" 
          runtime-failure-causes-rollback=
            "${jboss.deployment.scanner.rollback.on.failure:false}"/>
    </subsystem> 
    ...
</profile>

2 选项 -> 要取消扫描,启动 Wildfly 然后进行部署,您可以通过更改standalone.xml 来关闭扫描:

<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" scan-enabled="false"/> 

所以现在你只需启动 Wildfly,然后根据你的操作系统运行 jboss-cli.bat 或 jboss-cli.sh。输入“connect”并粘贴/subsystem=deployment-scanner/scanner=default:write-attribute(name="scan-enabled",value=true)

所以现在你的战争将在运行时部署 - 在你的 Wildfly 已经开始“干净”之后(PS:我正在考虑默认端口和 Wildfly 的默认配置)。问候

更新 3 选项 -> 修改您的standalone.conf 并将您的 Wildfly JVM 内存分配增加到此值:set "JAVA_OPTS=-Xms2G -Xmx4G"

然后尝试再次启动 Wildfly,正常进行您的战争。(请务必更改正确的,standalone.confstandalone.conf.bat取决于您的操作系统)。

我认为您的内存分配导致了这个问题。

于 2019-10-16T22:50:02.157 回答