Tomcat - starting webapps in a specific order

前端 未结 9 646
既然无缘
既然无缘 2020-12-05 07:51

I know that Tomcat and the Servlet spec do not support starting webapps in a particular order.

However, this seems to me like a common use case, and I\'m wondering i

9条回答
  •  余生分开走
    2020-12-05 08:45

    Here is another trick on Linux.

    Some of our webservice applications fail to deploy, because of erroneous WSDL. This happens if they are deployed or started after a number of other applications. The order in which they are started depends on the order in which context xml's are found in /opt/apache-tomee/conf/Catalina/localhost

    Can be verified using "ls -1f". A plain "ls" gives a sorted output.

    This used to be the order in which files were added to that directory, but with ext4 filesystems, the order is based on a hash of the filename. This can be disabled as follows:

    # tune2fs -O ^dir_index /dev/xyz
    

    Now you can at least decide yourself in which order they will be started. Reordering: move all files to a temporary folder, move them back in the desired sequence.

提交回复
热议问题