'AWS Elastic Beanstalk - Failed to deploy application

I am not able to deploy my application on Elastic Beanstalk. Getting below error in eb-engine.log

An error occurred during execution of command [app-deploy] - [PostBuildEbExtension]. Stop running the command. Error: Container commands build failed. Please refer to /var/log/cfn-init.log for more details. 

and In cfn-init.log I am getting below error

[ERROR] Command replace-config (cp .ebextensions/server.xml /etc/tomcat8/server.xml) failed
[ERROR] Error encountered during build of postbuild_0_Ad_Server: Command replace-config failed
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 573, in run_config
    CloudFormationCarpenter(config, self._auth_config).build(worklog)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 273, in build
    self._config.commands)
  File "/usr/lib/python3.7/site-packages/cfnbootstrap/command_tool.py", line 127, in apply
    raise ToolError(u"Command %s failed" % name)
cfnbootstrap.construction_errors.ToolError: Command replace-config failed


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source