Start and debug open liberty server from checked out source code - open-liberty

I checked out the source code of open liberty from https://github.com/OpenLiberty/open-liberty and was wondering how to start the server from the sources and deploy an application to the started server.
I found several classes with a main method, but none of them are looking promising so far. My goal is to debug the source code of the open liberty server with a deployed application.
How can I achieve this?

To debug a Liberty server you can do the following steps:
run wlp/bin/server debug myServer. This will halt the server launch process until a debugger is attached on the default debugging port (7777)
Attach a debugger on the debug port
Your IDE should prompt you to "attach sources", and you can select your application source and/or the Liberty source code too

Related

Unable to connect to web sever IIS Express

I am working on project, where I need to have an access to debugging option.
I've tried to run my application as usually, but this time I received following message:
Unable to connect to web server 'IIS Express'
When I checked the console output I found there following note:
Failed to register URL "http://localhost:49748/" for site xxx application "/". Error description: The process cannot access the file because it is being used by another process. (0x80070020)
Successfully registered URL "https://localhost:44333/" for site xxx application "/"
I found also that 0x80070020 error - "in the case of IIS Express (or IIS) means that the port that it is attempting to listen on is being used by another process" (link to the similar question).
I can't understand what's happen here. When I try to run this application I'm receiving this error in my Visual Studio, but the application is starting in the background (I can manually navigate to the https://localhost:44333 and app is there). The problem is that I can't debug the code, cause the Visual Studio looks like 'unrelated' to this instance. Previously IIS Express was opening new browser window with URL of the application, and I was able to debugging my code.
I also can't understand why this problem is not appearing for brand new project - I've created new web app project to test this behaviour, and it does what I expect - I can use debugging in VS.
What I've tried to do so far is:
Restart VS,
Restart my local machine,
Change app url in solution explorer/properties/debug,
Remove applicationhost.config from .vs directory
and nothing works for me.
Before this issue appear I forked this repo: https://github.com/jasontaylordev/CleanArchitecture
and downloaded WSL and Docker - I doubt that this have an impact on my solution, but maybe this information will be helpful.
Is there anything what I can change/edit to back to my previous behaviour?
Thanks
I had this issue after upgrading to Windows 10 20H2. There are many answers I found on SO that did not work for me, but I found this blog that helped me figure out the problem. Try running netsh interface ipv4 show excludedportrange protocol=tcp on the command liine and check to make sure that the port you are using is not one of the excluded ports listed. If so, change it to one that is not excluded. I did this and everything worked as normal again.

How to attach IntelliJ Go debugger to local process

I'm coding in Go using IntelliJ IDEA with Go plugin. I am working on a project that uses gocui, which doesn't work in IntelliJ console window. So I run my program from console.
How can I attach this wonderful IntelliJ debugger to the process that runs outside IntelliJ (in my console)? I tried run -> attach to local process, but it showed an empty box.
Unfortunately right now the plugin does not support this feature. You can track the request for it here: https://github.com/go-lang-plugin-org/go-lang-idea-plugin/issues/620
However, be warned that delve does not support attaching to a running process on Windows (in case that's your OS).
You can also track the request here: https://youtrack.jetbrains.com/issue/GO-620 for Gogland.
I'll update this in case I find a way to help you run the app from the IDE instead so that you can debug it easier.
I discovered by accident one trick that allows to run my application in normal console from IntelliJ. Simply run IntelliJ from a console. Then, if I run (or debug) my application, it opens in that console.

Debugging TS in WebStorm

Server starts through gulp. In Run Configuration I've created a JavaScript Debug and set server url. Extension in Chrome is available. As a build system I use Webpack. In Debugging mode I can see that connection is successful but breakpoints are not working.
You need setting up Remote URL mappings in your JavaScript Debug run configuration accordingly. Please see http://richb-hanover.com/debugging-webpack-apps-with-webstorm-2016-1/, https://blog.jetbrains.com/webstorm/2015/09/debugging-webpack-applications-in-webstorm/ for some hints

RAD 8 does not recognize that WAS has started

I have recently experienced a new problem using RAD 8.0.2. When I launch a WAS server from within RAD, with or without any apps published to it, WAS will start and will show output in the console. I can even access the server from my web browser. However, RAD never recognizes that WAS has started successfully and after the timeout limit is reached, RAD claims that the server failed to start. I have tried this with WAS 6.1 and 7.0 test environments and WebSphere Portal 6.1 external environment and I always get the same result. Naturally, this makes development extremely difficult and I am anxious to get this fixed. Any help would be greatly appreciated! - John
May be an SSL certificate expiration problem, try this
http://www-01.ibm.com/support/docview.wss?uid=swg21514601
I don't think the issue is with RAD 8.0. I had similar issue which is caused by overridden .Metadata properties. Please follow the steps mentioned below.
Close RAD
Kill Java and Javaw.exe on the TaskManager which runs in the background to run eclipse/RAD
Remove the .Metadata properties from the workspace path( Remember when you remove this properties, the workspace settings and the server will be removed from your workspace)
Open RAD as Administrator, it automatically creates .metadata in your workspace path. But, it would be a default (without the workspace settings).
Need to update the user libraries in your workspace and add the servers again( The server settings would be still available as the Server profile was never changed). These settings would update your .Metadata on your workspace.
Try toggling the SOAP and RMI option to see if that helps you.
Sometimes it has trouble and it always works if you switch the protocols that RAD uses to connect to Test envionment server.
Also as a sanity check ensure that the port numbers that are specified in the server configuration in RAD is correct. There are chances that an incorrect port number could be a culprit too.
HTH
Manglu
I could solve the problem by deleting the server profile "AppSrv1" (Windows -> Preferences -> Servers) and by creating a new one using the profile management tool at the same page.

Why cant I profile using vsperfmon by attaching to dllhost.exe?

I have a native C++ project that uses COM to communicate with a separate project in VB.NET. I have been able to successfully profile the native project in the past by attaching the project to a separate exe that references the native dll. I'm now trying to profile the native project by connecting to dllhost.exe. This configuration works, since I'm able to debug through dllhost, but if I try and profile the code (or just attach the profiler to dllhost while I'm debugging), the profiler stops and I get the following output:
PRF0010: Launch Aborted - Unable to start vsperfmon.exe
Error VSP1712: Invalid File: C:\...\MyProj110609.vsp
PRF0025: No data was collected.
I know the profiler works since I can get results using a different configuration. I also know the debug configuration works. Any idea on what's going wrong?
After some research, I found that the only way to do it with dllhost was to use the command line profiler. Go to the VS 2010 command prompt, and type in
VSPerfCmd /start:sample /output:c:\TestFile.vsp
VSPerfCmd /attach:[PID]
where c:\TestFile.vsp is the name and path of the output file, and [PID] is the profile ID of dllhost. Run whatever you want to profile, and when you're done, type in
VSPerfCmd /detach:[PID]
VSPerfCmd /shutdown
and you'll have your performance report.

Resources