Can I startup Wildfly ignoring deployments, and then deploy them?

1.9k views Asked by At

For some reason, if I start the server with the wars on the deployment path, the server will timeout. If I start the server and immediatly deploy the wars, they deploy with no issues. So, is there a way to delay deployments to post-startup only ?

Log until timeout appears :

 [] 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")
]'
1

There are 1 answers

6
jhenrique On

I think you might be interested in increasing the timeout of Wildfly, because the default timeout for applications is 5 minutes.

So you can adjust your standalone.xml and use something like this example, the time is in seconds by the way, so 900s would be 15 minutes...

Here is a link so you can check more variables that you may need (It is for Wildfly 10, but I think it is the same for Wildfly 11). So you can manage if you need a scan-interval or even if you want to deploy files that are in other directories by changing/adding a new path.

1 Option -> To increase timeout:

<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 Option -> To cancel scanning, to start Wildfly then to deploy, you can turn off scanning by changing your standalone.xml:

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

So now you will just start Wildfly, after that, you will run jboss-cli.bat or jboss-cli.sh depending on your OS. Type "connect" and paste this /subsystem=deployment-scanner/scanner=default:write-attribute(name="scan-enabled",value=true)

So now your wars will be deployed at runtime - after your Wildfly already started 'clean' (PS.: I am considering the default ports and the default configuration of Wildfly). Regards

UPDATED 3 Option -> Modify your standalone.conf and increase your Wildfly JVM memory allocation to this values: set "JAVA_OPTS=-Xms2G -Xmx4G"

Then try to start Wildfly again, with your wars normally. (Just be sure to change the correct one, standalone.conf or standalone.conf.bat depending on your OS).

I think your memory allocation is causing this problem.