I'm trying to load my Spring Boot REST application on amazon AWS, specifically I'm using the Elastick Beanstack service.
I can configure everything correctly, but the public address (http://socialnotes-env-tomcat.eu-west-1.elasticbeanstalk.com/) does not serve the index html page. In local with
java -jar ...... snapshot.war
everything works correctly, but on amazon aws it seems not to find the index page (even if decompressing the war I see it in the main folder)
It seems very strange and I can not solve, the endpoints seem to work properly and I can also access the static files (http://socialnotes-env-tomcat.eu-west-1.elasticbeanstalk.com/static/assets/images/coffee.jpg)
I followed this guide to create the war file: https://www.mkyong.com/spring-boot/spring-boot-deploy-war-file-to-tomcat/
But I can not in any way make the index page return, I always get a 404.
Can you look in "Logs" of your project at AWS what caused the problem? You can choose option "Last 100 lines" and scrole down. That may help or at least may give some clues.
Related
I'm migrating a Spring REST app WAR, that's running fine on a cPanel Tomcat 9 installation, to a Jelastic Tomcat 9 environment. All my content is returning 404's.
My first question is, what to put into the Jelastic Context field, during deployment? I have tried two different names: (1) ROOT- (e.g. ROOT-067) that Jelastic provides, and (2) my preferred webapp name. Both yield same 404 errors. When I study the webapps Directories, in both cases my WAR is correctly unpacked.
My second question is, do I need to modify the Tomcat conf/server.xml or conf/web.xml, that Jelastic generates? I have tried leaving them as originally generated, and making similar changes that I made to both files in the cPanel deployment. With the changed files, the Jelastic deployment fails due to Timeout error after 15 minutes.
Thanks for any and all help!
Bob
Usually you don't have to do any changes in your server.xml / web.xml unless you need to have something very specific in it, did you try to set your context name just as ROOT (without index and a dash)? Could you please provide your environment name and a hosting service provider name? I will contact providers tech guys and we will investigate why that problem occurs. Will be glad to help.
I have searched everywhere for this. I'm sure I have read the information correctly but can't seem to get a full understanding of it.
I used this tutorial to get things going (https://www.jetbrains.com/help/idea/2016.3/creating-and-running-your-first-web-application.html). I do everything step by step but when it comes to running my web app, The localhost shows the official page of Tomcat and not my index.jsp that I have created. I've tried every path combination to try to get my index to show but I have had no luck.
I have done a lot of googling on this and it seems to be that when I run tomcat it reads the files from the webapps/ROOT folder instead of my project folder. How can I get my intellij or tomcat to read the files from my project? I keep reading that its my run configurations but everything looks good to me, and no one really shows what to actually do.
I wouldn't be asking unless I have tried doing this my self for hours. I'm sorry if it is really simple I just can't see it and would really appreciate your help. Thanks in advance
Structure (Ignore error messages)
Configuration
Artifacts
Deployment tab
I always get routed to this web
Artifact deployed successfully
It looks like you already have Tomcat service started on port 8080, therefore IntelliJ IDEA cannot start another instance and perform the deployment.
You need to shut down the service running on port 8080 so that IDE can start its own copy of the server and perform the configuration/deployment on start.
brew services stop tomcat should help in your case.
I am adding some things in an existing Android app, which connects to a Apache Tomcat server to get information from a database, but some of the changes required that I also make minor changes on the webapp (changing some database fields).
I had never used tomcat, but managed to do the simple changes here and there.
But when I deployed it, I noticed some errors(see the photo).
How can I fix them ?
The app works regardless of them, but the server takes a few more seconds to start up.
P.S.I read somewhere that this means that the server already has these libs, and doesnt need to use the ones from the lib folder of the app ?
I would like to setup Camunda-BPM in a Tomcat 7 running on Jelastic. I followed the instructions.
The problem now is that Jelastic does not allow to add the file bpm-platform.xml into the catalina-home/conf directory. So when I start the tomcat I get
...
Caused by: org.camunda.bpm.engine.ProcessEngineException: /opt/tomcat/conf/bpm-platform.xml does not exist. This file is necessary for deploying the camunda BPM platform
Can someone please give me a hint where I can place bpm-platform.xml so that the BPM engine starts?
The directory you're looking for is labelled as 'server' in the Jelastic dashboard - but sadly you cannot upload new files to this directory via the dashboard (only edit the existing ones).
However, you can write to this directory via FTP (http://docs.jelastic.com/ftp-ftps-support), so you should be able to add the file that way.
If you are just using a trial account at the moment, you may need to seek assistance from your hosting provider to add the file there for you manually from their side (since trial accounts do not have public IP, so can't use FTP).
In order to be conservative on resources (and costs), I would like to put more than 1 war file (representing different apps) on the same EC2 beanstalk instance.
I would like then to have appl A mapping to myapp.elasticbeanstalk.com/applA using warA and appl B mapping to myapp.elasticbeanstalk.com/applB using warB
But, the console allows you to upload a single and only war for any instance.
1) So, I understand that its not possible with the current interface. Am I right ?
2) Though, is is possible to achieve this via "non-standard" ways: uploading warA via interface and copying / updating warB to /tomcat6/webapps via ssh, ftp, etc ?
3) With (2), my concern is that B will be lost each time BT health checker decides to terminate the instance (successive failed checks for example) and restart a new one. I would then have to make warB as part of my customized AMI used by applA and create a new version of this AMI each time i update warB
Please, help me
regards
didier
You are correct ! You can not (yet ) have multiple war in beanstalk.
Amazon Forum answer is here
https://forums.aws.amazon.com/thread.jspa?messageID=219284
There is a workaround though, but not using Beanstalk, but plain EC2:
https://forums.aws.amazon.com/thread.jspa?messageID=229121
http://blog.jetztgrad.net/2011/02/how-to-customize-an-amazon-elastic-beanstalk-instance/
Shameless plug: While not related directory, I've made a plugin for Maven 2 to automate Beanstalk deployments and Elastic MapReduce as well. Check out http://beanstalker.ingenieux.com.br/
This is an old question but it took me some time to find a more up to date answer so I thought I'd share my findings.
Multiple WAR deployment is now supported natively by Elastic Beanstalk (and has been for some time).
Simply create a new zip file with each of your WAR files inside of it. If you want one of them to be available at the root context name it ROOT.war like you would if you were deploying to Tomcat manually.
Your zip file structure should looks like so:
MyApplication.zip
├── .ebextensions
├── foo.war
├── bar.war
└── ROOT.war
Full details can be found in the Elastic Beanstalk documentation.
The .ebextensions folder is optional and can contain configuration files that customize the resources deployed to your environment. See Elastic Beanstalk Environment Configuration for information on using configuration files.
There another hack which allows you to boot an arbitrary jar by installing java and using a node.js boot script:
http://docs.ingenieux.com.br/project/beanstalker/using-arbitrary-platforms.html
Hope it helps