Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

503
Vistas
How to run two spring boot applications on same server?

I have two Spring Boot applications. I want them to run on different ports at the same time on the server, right now I'm testing it locally on my computer and when I run both jars and I'm using one application, the other one would refresh and logout. I can't use both applications at the same time.

Is this a problem with the embedded server, spring boot or something else? I've read a couple of articles but I'm not sure why is this or how to solve this in the best way. Should I package both apps as WAR and run them using Apache Tomcat, or is there a newest way to do this with spring boot and the jar packaging?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The sessions are based on cookie and the cookie is saved based on the name and the hostname. For example if you are running two spring boot or tomcat applications and try to connect on these 2 applications:

  • For the first application (running in localhost:8080), a session is created with by default a name JSESSIONID and the host localhost
  • For the second application (running in localhost:8090), a session is created with by default a name JSESSIONID and the host localhost and will invalidate the first application.

You can:

  • change the url (for example app1:8080 and app2:8090).
  • Change the session cookie name which depends on your architecture/server. For Spring Boot, you can change it this way: server.servlet.session.cookie.name = ANOTHERSESSIONID
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda