Can we debug springboot application using IntelliJ - spring

I am new to the springboot and currently trying to debug the spring boot application. Is there any way to do thta?

The same question has posted in here[1] as well.
This resource will also helpful for you[2].
Please have a look on these resources. These will be helpful for you.
[1] How to debug spring-boot application with IntelliJ IDEA community Edition?
[2] https://www.baeldung.com/spring-debugging

Related

Debug Spring Boot 3 in IntelliJ Community

Since the migration to Spring Boot 3 my application doesn't hold at breakpoints any more, when I run the Maven Spring Boot goal mvn spring-boot:run.
This is because Spring forks the thread or the process and the debugger is not attached to this.
In former Spring-Boot versions you could disable forking by passing -Dspring-boot.run.fork=false (see How to debug spring-boot application with IntelliJ IDEA community Edition?).
Unfortunatly this option was removed as you can read in the Spring Boot 3.0 Migration Guide:
The fork attribute of spring-boot:run and spring-boot:start that was deprecated in Spring Boot 2.7 has been removed.
Is there any possibility to make breakpoints work again?
Ideas so far
Of course IntelliJ Ultimate has better Spring Boot integration. I'm trying to make it work with the Community Edition.
I also tried not to run the Maven goal but to make an Application run configuration. This failed so far, because of java.lang.ClassNotFoundException, it doesn't find the Main class. Not sure if I should investigate that option further.
Last idea was to start the Maven goal with debug options such that an external debugger can attach. That didn't work either and even if it would, I could only attach the debuger after startup with would make debugging the creation of spring context impossible.

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

Spring boot + Activiti explorer

Is it possible to integrate activiti explorer maven plugin with activiti Spring boot app?, so that we can make use of activit-explorer to view deployed process in activit-spring boot engine.
I know we can use rest-api over spring boot to query process engine, but I want to know if it is possible to run the explorer over spring boot by adding it as a maven plugin during deployment?Or can we tweak the activit-explorer.war somehow to point to spring-boot activiti engine?
activiti-explorer.war is standalone webapp by itself. I've write some guideline on how to manually to embed activiti-explorer to you own app. http://blog.canang.com.my/2016/05/12/embedding-activiti-explorer-to-your-application/
Most probably step 5 in my blog is your solution.
btw, there's reason why the name is 'default'. I can't recall it atm
I thought of answering my own question so that it will be useful for other developers with similar requirement. If you want to make an eco-system where activiti-rest, explorer and your custom end points co-exist, please refer this thread from activit forum. I have tried this and is working fine. link to thread
I would like to give my observation here. In order to avoid getting into pulling source and trying to build myself, I achieved partial success, by installing the activit-explorer as part of the usual standalone installation.Started the standalone activiti-explorer using Apache-Tomcat but I configured the database for Activiti as same as (MYSQL in my case) I used in my spring-boot application to hit the common ground.
But apparently the activiti version in my spring boot app was 5.19.0.0 and that for activiti-explorer was 5.22.0.0, which created some misalignment for spring boot application startup to fail. I am hopeful that with matching versions it might succeed. When I get some more time on me I will try and update. Since then may be someone can use this route.

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.

Setting up Intellij with Spring MVC framework

I've been Googling and reading a lot but I simply cannot add spring framework to my application.
On the IntelliJ website it says simply click 'Add module' and then under technologies select Spring. The only technology I have available is Groovy?!
Can anyone please help me with this?
The Community Edition of IntelliJ doesn't have the same out-of-the-box support for Spring (and EE development in general) the Ultimate Edition does.
Features and edition comparison
You may still use Spring, but you won't get the same IDE integration.
I would suggest trying the offical spring website tutorial with one of these two Youtube videos:
Official Spring website about Intellij:
Serving Web Content with Spring MVC, Build with your IDE
Youtube video tutorials on setting up spring with Intellij:
Spring MVC with Intellij Full Java Config. No web.xml or Servlet.xml
or
Spring MVC application with Intellij Idea (with xml config)

Resources