Hezron
(Hezron Developer)
February 14, 2025, 6:03am
1
Greetings team,
Has anyone hosted/deployed .jar file in aws EC2 instance?
If yes could you share your experience or rather guide on how to secure the app via https?
I’m considering different approaches to testing/host my app.
I have tried deploying my latest vaadin 24 (Flow) app on Elastic beanstalk following the guide given in Vaadin documentation but for some reasons, the status Changes from “Ok” to “Survere” when i upload the .jar file.
The logs points to HTTP requests failed when i enable load balancer.
Any ideas,suggestions and assistance will be highly appreciated.
Regards.
Hezron
rucko24
(Rubén Espinoza)
February 14, 2025, 1:12pm
2
I tried your setup and got the same error when I had the spaces.
Once I removed all of them it worked fine.
I think it is not related to the certificate itself.
Looking at the logs, it seems spring boot is not propagating your configurations to the embedded tomcat.
I don’t know if in that instance, you could add a reverse proxy to manage the SSL certificates for your…
But you can do it.
letsencrypt for PoC’s, works pretty well.
1 Like
Hezron
(Hezron Developer)
February 15, 2025, 10:15am
3
Thanks Ruben,
Looking into the resource you’ve shared.
Based on your description, I cannot help you. Can you please provide more information about the error? Also, post the logs.
Also read the docs: Configuring HTTPS for your Elastic Beanstalk environment - AWS Elastic Beanstalk
Hezron
(Hezron Developer)
February 16, 2025, 3:12pm
5
Hello Simon,
My Elastic Beanstalk environment looked like this before i uploaded my .jar file
Whe i uploaded the .jar file, this is what got while trying to call the domain e.g myapp.com :(At this point health status showed “OK”)
This was the result after configuring Load balancer. Immediately my health changed from "OK’ to “Survere” with this details:
Let me know if you need any other clarification.
NB:// My objective is to run my app with https enabled to secure it.
Does your app run on port 5000?
server.port=5000
5000 is the port Beanstalk expect.
Hezron
(Hezron Developer)
February 16, 2025, 3:56pm
7
Yes it does.
This is how my .properties file config looks like;
server.port=5000
spring.datasource.url = jdbc:mysql://${RDS_HOSTNAME}:${RDS_PORT}/${RDS_DB_NAME}
spring.datasource.username = ${RDS_USERNAME}
spring.datasource.password = ${RDS_PASSWORD}
spring.datasource.ddl-auto = create
#Some other configurations
Have you checked the logs?
Hezron
(Hezron Developer)
February 20, 2025, 4:55am
9
here is a part of the nginx error logs.
knoobie
(Christian Knoop)
February 20, 2025, 5:20am
10
Simon is talking about your application logs.
Hezron
(Hezron Developer)
February 20, 2025, 6:29am
12
Hello Simon & Christian,
My apologies from my earlier reference, here is a more detailed info.
I suspect the issue is within my production configurations conflicting with Development configs.
Heres a snippet from aws logs:
Matti
(Matti Tahvonen)
February 20, 2025, 6:35am
13
There you have the answer: use production mode when you create the artifact. I was about to guess that even before seeing the log…
If it is “standard vaaadin maven project”, that should be trickered with:
mvn package -Pproduction
marcoc_753
(Marco Collovati)
February 20, 2025, 6:37am
14
Looks like you are deploying a development application.
Did you run the build-frontend
Vaadin maven plugin goal when building the production JAR (or the same task for a Gradle project)?
Usually, in a Maven project you have a production
profile, that enables build-frontend
during the compile phase
1 Like
Matti
(Matti Tahvonen)
February 20, 2025, 6:41am
15
And sorry for the mess, Vaadin is doing things in its custom way here and I know many people fail with Vaadin because of this. If you want to try a bit different approach, check this thread. Using this approach standard methods to create deployment artifacts like mvn package or mvn spring-boot:build-image work out of the box.
Hello Vaadin users!
I think we are not doing great job with our project builds and convetions related to our development mode. I’d like to change it a situation where no Vaadin specialities are needed (~ the production profile), the development mode starts implicitly when appropriate and the build file doesn’t look like a mess.
As an outcome of this, Vaadin would be out-of-the-box more compatible with various “cloud native tooling”, like buildpacks, it would be easier for new users to adapt an…
Hezron
(Hezron Developer)
February 20, 2025, 6:42am
16
Thanks Marco,
Correct.
I have since done this:
Added this to my .properties file: vaadin.productionMode = true
Rebuilt the .jar project with this: mvn clean package -Pproduction -Dvaadin.force.production.build=true
Uploaded the .jar file and it has worked.
Thank you all.
marcoc_753
(Marco Collovati)
February 20, 2025, 6:45am
17
There is no need to set vaadin.productionMode = true
in application.properties
. It has no effect
Hezron
(Hezron Developer)
February 20, 2025, 6:50am
18
Hello Marco,
Noted and thanks for the insight.