Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

496
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda