How to debug a Spring Boot application in Spring Tool Suite - web-services

I'd like to debug a simple Spring Boot application in Spring Tool Suite. It is a simple restful web service. I wanted to debug the controller and service class with embedded tomcat server.
Found this post how to debug Spring MVC application on Spring Source Tool Suite. I followed the steps:
Select Window-->Show View--> Servers.
Right Click on server in the Servers panel, select "Debug".
Add breakpoints in your code
Then right click on application, Select Debug As --> Debug on Server
After the first 2 steps, the output in console shows server has started up. However, I could find option of Debug on Server when I right clicked controller class. Application class is the only class that I could debug. However there is no way to "step into" Controller from Application.
Also, when should I launch browser and put in the request url?

First of all let's see how to launch you Spring Boot app in debug mode.
As you are using Spring Boot, you don't need an app server to run or debug it, as it is able to run in standalone mode by launching the Application class.
You have at least two ways to launch it in debug mode:
Right click on your Application class and select Debug as -> Spring Boot App. Debug as -> Java application will also work.
Open the Boot Dashboard view, right click on you application and select (Re)debug).
You can have more information about the Boot dashboard in this blog post: https://spring.io/blog/2015/10/08/the-spring-boot-dashboard-in-sts-part-1-local-boot-apps
Once the application is running in debug mode or before, it really doesn't matter, open the class (in your case the Controller) you want to debug and go to the line you are interested in. To add a breakpoint at that line, right click in the grey bar at the left end of the editor in that line and select **Toggle Breakpoint*, or just use Shift+Ctrl+B.
Then you can launch the browser and use the application. When the execution gets to the line where you have added the breakpoint, it will stop there.

Related

break point not hit in ASP.NET web API remote debug in IIS

I have attached my Visual Studio 2109 debugger to the process with my web API published in IIS
But when I try to insert a break point
"the breakpoint will not be activated currently. No symbols have been loaded for this document"
Any idea please?
Regards
Another possible solution for the same type of error is that the build has "Optimize code" checked.
"Api project" > properties > Build > (select "Configuration" for the one you are debugging), make sure "optimize code" is unchecked.
If you changed it you need to deploy the project again.
The problem was that my webAPI is an ASP.NET Core 2 web API and in this case w3wp.exe is not the correct process. The process is the application itself. In may case api.exe instead w3wp.exe
thanks

developer tools does not loads resources

When I run my ionic project to my mobile it was working good, and when I open developer tools it's fine.
I could able to view all console statement in my developer tool window, now when I run it again app runs well in the browser and in my mobile , I am not able to see any console statement.
What I get is
device ready has not fired after 5 seconds.
cordova.js:1223
Failed to load resource
file:///android_asset/www/build/index.js.map
could someone help me to view my console statements
This should be fixed in cordova-android 6.1.0. It has not been added to the npm-registry yet, so you can use it by placing this to your config.xml:
<engine name="android" spec="https://github.com/apache/cordova-android.git#6.1.0"/>

execute delphi web service from browser

I've been working on a set of ISAPI web service DLLs in Delphi 2005 that interact with our server application but I'm having real difficulty debugging issues in the web services.
At this time, I have a test SOAP server application as a Web App Debugger executable which uses the same units as the real DLLs.
I can compile and run my SOAP EXE, run the Web App Debugger tool, start the ServerInfo server, and see my SOAP app in the list of Registered Servers.
If I select it from the list and click on Go, it shows the normal Service Info Page, where I can view interfaces and the WSDL.
What I now want to do is Execute one of the methods (a simple one that returns the version info of the ISAPI DLL), and view the request and response by looking at the Log tab of the Web App Debugger, however, I've not found a way to execute the method.
Do I really need to code a special client app to test my web methods? Most examples I've seen online just say to use http://server/service/class/method?parameter=value to execute a web service method, but that doesn't seem to work with a Delphi SOAP web service.
You need to change the client to connect to the machine running the WebAppDebugger. (Typically localhost)
Run the WebAppDebugger and click on the Start button. The 'default URL' lights up... by default is
http://localhost:8081/ServerInfo.ServerInfo
Then run your WAD server project within the IDE and put in your desired breakpoint somewhere in the server code.
If running your client on the same machine, change your client to use the local host address... if you connect today to:
http://www.yourhost.com/yourapp.dll/yourclass/yourmethod
change the client to connect to something like this for debugging the traffic:
http://localhost:8081/wadClassName/yourclass/yourmethod
The name of the Web Application Debugger class is defined when you create the WAD project.

Debug web service running on local machine?

I'm using PowerBuilder Classic 12.1 to deploy a .NET Web Services target to IIS 7 running on my local machine. I'd like to be able to debug it. The documentation from Sybase says I should be able to. But when I run the debugger it says "Attaching to ASP.NET worker" and "Time left: 20 seconds". It counts down to 0 and then I see "Failed attaching to ASP.NET worker process."
I'm running PowerBuilder as an administrator, so I don't think that's the problem.
Suggestions?
Open your your project object that you are using to deploy with. If you have multiple project objects, then right click on your target in the tree-view painter and click preferences to open a dialog that let's you choose which target object will be used for deployment. Choose the one that is set with DEBUG symbol on and set to debug build.
I have had good luck debugging PB Web Services both IIS hosted and self-hosted.
I also found this in the PowerBuilder help file for you:
Using the DEBUG symbol
If you used the DEBUG conditional compilation symbol in code for the nonvisual objects you deploy as a Web service and you want this code to run, you must make sure that the enable DEBUG symbol check box is selected before you deploy the project. If you plan to debug the assembly or Web service, you should make sure the project is deployed as a debug build.
** added additional details here on 1-26-13
This blog article will help you get WCF debugging to work in PowerBuilder.NET.
Testing & Debugging PowerBuilder.NET WCF Web Services

Can't debug with micro cloud foundry

I have a application deployed to a Micro Cloud Foundry instance on my local machine. I can start, stop and update the application from within STS. For some reason, the debug options are disabled when I right click on the application or the server from within STS. What am I doing wrong?
The debug feature is introduced in MCF 1.2.0. Make sure you have the correct version of MCF.
When you add your MCF as a server, you can double click on it and have it open on the window as a tab. You then need to click on the Applications tab (which is on the lower left bottom of your MCF window). You should see a list of your pushed apps. Click on any and you should see the Debug button next to the Start button appear.
There isn't any flags to be set in order for debug to appear or not. It is there in MCF 1.2.0