Spring Boot Deploying Old Project - spring

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?

Related

can you help me fix my STS? as it is not working

I am new to STS and trying to run my first project in it. But it is not showing me run on server option. I have tried "clean install" but still, it is not working. When I checked targeted runtimes it is not showing any server in it. Kindly help me to resolve this issue.
My recommendations for getting started with the Spring Tools 4 for Eclipse are:
start the IDE with an empty workspace
create a new Spring Boot project using the wizard "Import Spring Getting Started Content" to import some getting started guides, for example the Rest Service example
if you decide to create an empty new Spring project, use the wizard "Spring Starter Project" - it is the direct integration for https://start.spring.io - and go from there
All those options get you started with a Spring Boot project which doesn't need a separate server to run on. Spring Boot comes with am embedded server component, so you can just start the Spring Boot application as a regular Java app. No need to install a local server or use the "Run on Server" option in the IDE.

Running Spring boot application in IntelliJ gives white label error

I am trying to run Spring boot web application in IntelliJ which gives me whitelabel error. However, I am able to run the application with eclipse and also external tomcat server.
I have the context mapping available where it is returned from the application but webpage always shows WhiteLabel Error 404.
Please suggest how does the same application works in eclipse and external tomcat but not with IntelliJ.
I am using IntelliJ community edition v 2020.2.3
web pages are available in webapp folder.
First download xammp server to your machine. Then run your spring boot application. I used this method to run my spring boot application. But keep in mind that IntelliJ community doesn't directly support to spring-boot. You have to use IntelliJ ultimate for that.

Mapping missing in Intellij IDEA for Spring Boot application

I am using Spring Boot 2.3.4 , IntelliJ IDEA Ultimate version 2020.2.2 . (Example project can be found here https://github.com/ehmkah/springbootintellij ) I don't see the "mappings" sub-view in IntelliJ IDEA Services View for my springboot-application. It should be right to Health. There are several endpoints configured - they are working I see them in the browser. I guess something is not configured correctly, but I only see errors like
AM Error Loading Project: Cannot load facet Web in EventLog.
Where should I look for errors or are there any known incompatibilities?
Mappings tab as a feature requires Spring MVC bundled plugin. Please make sure it is enabled in Settings(Preferences) | Plugins.
Spring boot application mapping is only accessible with Intellij Ultimate
use plugin Endpoints Explorer, it works well with Intellij Community

Can I configure SpringBoot app to run on a tomcat that is added to eclipse IDE in its servers tab?

I am trying to create a spring boot web app. But i dont want to create a jar out of it.
I want to run the web app directly from eclipse on to the tomcat that is added to eclipse via servers tab.
Is it possible? How to achieve it?

Running a Spring MVC program in Intellij

I am a past Eclipse user and been using Intellij for 2 months on. However I am only been using it for Spring-Boot apps. I decided to make a fun Spring MVC app and I cannot figure out how to get it to deploy and run on my tomcat server. For spring boot it is pretty simple.
I was hoping someone could help me out with this.
The above picture show my options. I am using Intellij 14 full version if that matters.
Hope to hear from someone soon.
We can use Tomcat7 Plugin for running our App on IntelliJ
Follow this steps :
Click on Add Configuration
Click on +
You need to create a configuration for your Tomcat Server first.
If you don't see TomcatServer option when you try to create a configuration, you might need to enable Tomcat and TomEE Integration Plugin first by going to File -> Settings -> Plugins.
After you create a configuration for your server, you should be able to see options to run your spring application in the server.
You may also modify/configure how to run your app in the Deployment tab in your Tomcat configuration.
You need to package it using some tool or IDE.
And then to deploy
result package to your tomcat server with Idea plugin or any deploy
tool you like.
Also you can configure maven to do both targets easily.
Update: you can choose your Tomcat/TomcatEE goal in menu like at your screenshot and provide required server info here like host, port, etc.. And on the deployments page add your application artifact. And then save this build profile and use it with run>>run in main menu of IDE
No need to install tomcat server locally. You can use Tomcat7 Plugin in your pom and run it without any other configuration.

Resources