Facing issue while upgrading to Spring boot 2.2.4 - spring

I am trying to upgrade my project spring boot version to 2.2.4 and for that, I have generated the spring boot project from https://start.spring.io/ but it is not working well. When I run the application it starts on 8080 port after stopping the project if I try to run the project again it gives the error saying port already in use. I have tried with different port and all port I can use only once unless I manually free the port using CMD. Please help here if anyone is facing the same issue.

I have faced same problem 'port already in use' but I killed tomcat process and
problem is solved.

Related

Neo4J connection timed out in Spring Boot 2.2.4 but not in 2.0.5

I'm building a Spring Boot application with neo4j. I have an issue connecting to a deployed database when I'm running on Spring Boot 2.2.4. In an other project with Spring Boot 2.0.5 it works, but when I upgrade that project to 2.2.4 it also breaks with the same exception.
The weird thing is that it also works on 2.2.4 locally when using a local Docker image.
I get the following exception when I try to connect to a deployed neo4j instance in the cloud using an uri of the form bolt://35.xx.xx.xx:7687 AND on Spring Boot 2.2.4:
If I run my docker image and I change the connection uri to bolt://localhost:7687 it also works perfectly fine on Spring Boot 2.2.4.
Even in my gitlab CI/CD pipeline the test works fine using a service inside the pipeline, also with the same neo4j image.
This is my build.gradle:
And these are the versions effectively installed:
I also can always use browser to connect to my database that's why I assume that it has something to do with the versions instead of my cloud configuration.
Anyone any idea what I have to change on my configuration?
Thanks in advance!
We run following versions:
neo4j 3.5.14
Spring Boot 2.2.4
Java 11
EDIT 1
As someone proposed, I also setup a very simplistic example application (https://neo4j.com/developer/java/) using just the neo4j driver v4 with my GCP instance of Neo4J. This works perfectly fine.
EDIT 2
My application.properties looks like this:
spring.data.neo4j.uri=bolt://35.xxx.xxx.xxx:7687 # <- in prod
spring.data.neo4j.uri=bolt://localhost:7687 # <- in dev
spring.data.neo4j.uri=bolt://neo4j:7687 # <- in CI/CD
spring.data.neo4j.username=neo4j
spring.data.neo4j.password=****
spring.data.neo4j.embedded.enabled=false
The different environments are splitted in seperate property files that set the spring active profile. Im always testing this with replacing the localhost one in the application-dev.properties to the public ip.
My final setup (and solution) was to use only following dependencies:
implementation 'org.springframework.boot:spring-boot-starter-data-neo4j'
implementation 'org.neo4j.driver:neo4j-java-driver-spring-boot-starter:4.0.0.1'
And use following settings in the properties file:
org.neo4j.driver.uri=bolt://35.xx.xx.xx:7687
org.neo4j.driver.authentication.username=neo4j
org.neo4j.driver.authentication.password=neo4j
org.neo4j.driver.config.encrypted=false
Encryption wasn't the problem, but the settings had to be set to org.neo4j.driver instead of the org.springramework.boot dependency. The springframework dependency is still needed to use #Query etc in the repositories, thats why I needed both.

Exception while creating new spring boot project in STS

I have downloaded STS 3.9.0 and Java 8 is installed on my machine.When I open STS and try to create new "spring starter project I get following error".
after researching I found that we can resolve this by changing url to "https://start.spring.io" this,but after doing that I get following error.
This looks like connection or proxy issue.
Please check your connection or firewall settings which is used by STS.
And as a second option, you can use https://start.spring.io/ for generating project and can import in your IDE.

Spring Boot Deploying Old Project

I had created a spring boot project in the past, and now I am coming back to using spring boot again. However, I am running into issues when I click "run as spring project" (which informs me that my server/app has deployed as expected on port 8080 with a context root of "/"). When I open my browser and go to localhost:8080, it still shows up with content from my old project. Any ideas on how to fix this? (P.S. it is not a maven issue -- I have clean/installed).
Try following these steps :
1)Stop all the Java processes in your system .
2) Restart your app .
3) Open a new incognito window in your browser and try again .
If it still doesnt work , provide more details like which version of Spring boot are you using and contents of your application.properties .
Also , are you using docker to run your apps?

Spring boot 1.4.2 with Tomcat 8.5.8 crashes, port already in use. Works fine with Tomcat 8.5.6

I've got two relatively simple Spring Boot apps. They both use Tomcat 8.5.6 with Spring Boot 1.4.2. And they work fine.
For grins and giggles, I changed the Tomcat version to the latest version in that tree, 8.5.8.
Now, neither app starts. "Port 8080 already in use". Somehow, Spring Boot seems to start port 8080 twice (or is not catching the fact that it has already started and tries again).
Any ideas?
The problem was caused by the Tomcat team refactoring the embedded startup in a way that broke Spring Boot.
It's fixed in Tomcat 8.5.9

how to deploy Spring boot actuate application in external tomcat server

Im trying to just use the basic endpoints that comes with spring actuate and want to deploy in the external tomcat server without using spring boot. How to achieve this, could anyone help me please. Is there any configuration changes that I need to do. This website gives an idea but it uses older version of spring-boot-actuate. Also EndpointHandlerMapping and EndpointHandlerAdapter doesnt come with newer version of spring boot actuate.
Anyways I get 404 resource not found when deploying to the server.
Check out this question to see if it helps you. The Actuator component is a Spring Boot feature but you can use individual components within an existing application with the right build and configuration setups.

Resources