0

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
    Did you try disabling them and enabling them once the server is up ? – ehsavoie Oct 16 '19 at 13:43
  • That will do, but I needed something automatic, is there anything you know of ? I could fiddle with a bat script or something like that to call a cli script but if there was something native meant to do that great. I know you can put scan interval to 0 to enable startup scan only, I want the exact opposite. – yourAverageDeveloper Oct 16 '19 at 13:50
  • 1
    You could check the server status in a loop using jboss-cli and then set the enable attribute also – ehsavoie Oct 16 '19 at 14:01
  • this is in fact more elegant than bat. answer that and I will accept it if no one comes up with a native solution. – yourAverageDeveloper Oct 16 '19 at 14:05
  • There is an issue with @ehsavoie suggestion as the variable will be set to enabled, and then when someone restarts the server it wont start back up. I could script it to disable on shutdown, but these are local enviroments that I cannot assure will be shutdown correctly – yourAverageDeveloper Oct 16 '19 at 14:12

1 Answers1

1

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.

jhenrique
  • 858
  • 1
  • 10
  • 17
  • Hey, thank you for your reply. Regarding option one, there is no need to increment timeout, the deploy process takes about two minutes. The problem is that if I start the server and it tries to deploy wars on boot it wont be able to start. Not because it cant deploy in a timely manner, but because something changed since Wildfly 8, ( maybe Rest Interface, maybe Http) that seems to lock the deploy. If I boot the server with the scanner off and then deploy the wars everything goes smoothly. Which leads me to your second option, which I have thought about as well. The problem with it is that – yourAverageDeveloper Oct 17 '19 at 09:13
  • 1
    The scanner will be turned on. So when there is a need for a server reboot, the problem returns. – yourAverageDeveloper Oct 17 '19 at 09:13
  • Can you post your server.log with the errors that happen when you start Wildfly with your wars? – jhenrique Oct 17 '19 at 12:21
  • Just one more detail, are you trying to start your Wildfly from within Eclipse or some IDE or are you starting it using the command line? Can you also post your JAVA options that you are using is your "standalone.conf" – jhenrique Oct 17 '19 at 13:48
  • 1
    Updated my answer with a third option, take a look please. – jhenrique Oct 17 '19 at 13:56
  • Using your java_opts the problem is the same, exact same output. The problem is the same both starting from IDE or cmd – yourAverageDeveloper Oct 17 '19 at 14:15