status for my spring boot web service in services.msc was not running, but actually is running behind the background (port was in use) - spring-boot

I have my spring boot web service program, I use winsw to wrap it into windows service to my server.
However something is strange, deployment was fine (installed it using my account which have admin access) at day 1, and I can see all the log for my web service transaction. But once on day 2, in service.msc window (running by administrate mode, and my account have admin access), the status for my web service was not running and if I try to start it again it failed due to org.springframework.boot.web.server.PortInUseException: Port 443 is already in use (Yes, my web service is using port 443).
But my web service was running fine, all the transaction that return response, exccept I cannot see any logs that suppose written into the file. That makes me every day that if I want to see the logs or deployment the new version to the server, first I need to use netstat -a -o to find the PID for my process, then use taskkill /PID [PID] /F to kill the process then I can do my new version deployment or run the transaction again to see today's log.
Is it something I forgot to configuration?

Related

Websphere nodeagent and server1 stops everyday

I have a IBM WebSphere 8.5.5.13 ND on Windows 2016 standard edition with JDK 1.7 enabled. I see that, node agent and server1 (application server) are getting stopped everyday but the deployment manager is still up and running (i.e. admin console can be accessed). So, I have to start nodeagent and the associated server manually everyday. Investigation done so far
Checked if the windows servers are getting restarted everyday? No they are not
Checked nodeagent start and stop server logs but there are no entries to see, some command was issued for stopping
Checked application server profile (server1) logs but nothing is there.
FYI, I don't have clustering done on WAS but it is planned for the future.
I don't no where else I can look for the reason the node agent and server1 is getting stopped everyday.
okay, this is what I found out. In my case I have
Dmgr01 - registered under windows service
Node agent - not registered under windows service
application server - no need or never register application server if you have deployment manager
Since my node agent was not registered under windows service, whenever I log-off or my session is killed due to in-activity, the default behavior is that, all running processes (jave.exe) associated with WebSphere will be crashed and there will not be any trace of it. This is why, I was unable to find the any logs.
I registered my node agent as windows service and everything worked.

How to Run WAS Liberty Core server as a Background Service in Windows

We have installed WAS Liberty Core 8.5.5 to run Maximo anywhere mobile applications.
If we start the server from CMD then we are able to access worklight console and maximo anywhere apps.
Command we are using to start the server.
server start server1
But once we closed the CMD window the server stops automatically.
Any workaround to run the server as a background Service ?
Also we need info on how to add WAS Liberty server to Windows startup service so that it will start automatically on system restart.
Thanks,
Ajay
You can run Liberty as a Windows service:
https://www.ibm.com/support/knowledgecenter/en/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/twlp_setup_new_server_winserv.html
bin\server registerWinService serverName
bin\server startWinService serverName
bin\server stopWinService serverName
Of course "net stop/net start" or services.msc can be used instead of startWinService/stopWinService
The feature to setup a proper windows service is not available in Websphere Liberty 8.5.5.x.
You can use sc.exe to create a service linked to the server executable, but it won't behave correctly i.e. it won't respond correctly to the commands from the services application. As an example, you will be able to start the service and the server will run, but then you will see an error saying the service did not respond in a timely fashion.
According to this question the proper functionality, as described in the other answer, only became available around version 17.0.0.1.
Hope that helps,
John

Glassfish 4.1.1, domain installed as a service does not restart as a service

I got a Glassfish 4.1.1 copy with two domains on Win2012R2 (no clusters, no instances). I've set a windows service for each of those.
Both services run regularly up until the moment when I restart either or both of them thru their admin web console (server (Admin Server) -> Restart). The following happens:
The domain-related service stops, but does not start again,
The allegedly stopped domain is perfectly functional (deployed apps and admin console are there) (!!!),
When I try to start the win service manually, I get Error 1067 (GF reports "something" is already listening on required ports and that's the domain itself that is now, somehow, NOT run as a service!),
I can start the service again only after I've stopped the domain thru server (Admin Server) -> Stop.
Why did I mention two domains? Because this does not happen when I have just one domain with its' service.
Domains do not share ports, only things in common are the JDK/JRE and general GF files.
Is this a bug in Glassfish or did I set something wrong?
This is a limitation, rather than a bug. The problem is that GlassFish has no way to tell whether or not it is running as a service (and, if it is, what the name of that service would be).
The restart command means that GlassFish is restarting itself, so Windows detects that the process it started has been terminated and shows the service as stopped, but GlassFish spawns a new JVM itself. It has no capability to tell Windows to start the service again.
Essentially, the behaviour you are seeing is expected.
After some more testing, I realized what was going on:
Glassfish is definitively capable of restarting its' own Windows service,
The thing that was happening is it takes GF a few seconds do this on its' own,
But, before GF domain could restart as a service, I clicked the URL to return to admin console, every time. That forced it to run as an ordinary executable.
It does seem like the restart happens faster with just one win service, but I won't claim that as an absolute truth without more testing, for which I have no time now.

IIS w3svc error

I am trying to start my website in IIS, whenever I try to start my website I get the following error
Cannot start service w3svc on computer
I tried to start "World wide web publishing service", but I was unable to start it as it said:
Error 1068: The dependency service or group failed to start
Meanwhile when I checked my log I found this error,
The World Wide Web Publishing Service service depends on the HTTP service which failed to start because of the following error:
The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
Please help me, I am badly caught with this error, I have spent a week researching this error but haven't found a solution yet.
Confirm that "Windows Management Instrumentation" is started and its start up type is set to automatic.
Also make sure the following dependency services are started for World Wide Web Publishing Service:
Windows Process Activation Service
Remote Procedure Call (RPC)
DCOM Server Process Launcher
RPC Endpoint Mapper.
Open regedit, navigate to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP]:
a) Double click on Start and change value data from 4(disabled) to 3(automatically).
b) Delete "NoRun" key if this key exists.
(warning: backup any IIS website configuration first). UN-install "Internet information Service" and "Windows process activation service(if it is already installed)" from "Turn windows feature on or off" and Restart your PC.
Type the below command in CMD and press enter:
net start http
Now it will notify you that service is already running.
Re-install Internet information Service from "Turn windows feature on or off".
Start IIS and my websites are started now, no more "w3svc service is not running error."
As for me - I just restarted the computer.
Make sure these 2 services running and their startup type is automatic.If they disabled and not running right click on them and go to properties and change from there.
Windows process activation service
Worldwide web publishing service.
Run cmd as administrator. Type iisreset. That's it.
Go to Task Manager --> Processes and manually stop the W3SVC process. After doing this the process should start normally when restarting IIS
In my case it was C:\Windows\System32\inetsrv\config\applicationHost.config which had an issue.
I had a "system.web" section in this file which was causing the problem. Removed the section and everything started working
I have got same issue on my server. Follow below steps -
Open command prompt (run as administrator)
type IISReset and enter.
It works and solved my problem.
I have had this problem after a windows update. Windows Process Activation Service is dependent service for W3SVC. First, make sure that Windows Process Activation Service is running. In my case, it was not running and when I tried to run it manually, I got below error.
Windows Process Activation Service Error 2: The system cannot find the file specified
The issue seems to be, that windows adds an incorrect parameter to the WAS service startup parameters. I fixed the issue using the following steps:
Start regedit (just type it into start) Navigate to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WAS\Parameters
Delete the NanoSetup variable. This variable is preventing WAS from starting
Start the WAS service using task manager
Now start the W3SVC service
You can now start your website in IIS again
I found above WPA service solution in this stack overflow thread.
In my case, IIS suddenly stopped working, and after that Windows process activation service was unable to restart.
The solution to fix this was:
Find WAS service in the services tab of windows task manager
In context menu choose Go to process
Kill process (its name will be svchost.exe)
Restart Windows process activation service
My Net.Tcp Port Sharing Service was disabled. I changed its startup to manual, started the service, and then IISRESET worked.
I also verified that the following dependent services were started in Services ([windows]+[r] services.msc):
World Wide Web Publishing Service
Windows Process Activation Service
Remote Procedure Call (RPC)
DCOM Server Process Launcher
RPC Endpoint Mapper
Net.Msmq Listener Adapter
Net.Pipe Listener Adapter
Net.Tcp Listener Adapter
Net.Tcp Port Sharing Service
I found this solution by going through all dependencies and child dependencies of the World Wide Web Publishing Service and making sure that each service was enabled and started.
To verify all services for yourself, do the following:
Open up Services (just search for it from the start menu in Windows 10)
Find the World Wide Web Publishing Service
Right click on the service and then click "Properties"
Click on the Dependencies tab
Go through each system component in the two boxes and verify that each service is started (in Services).
Repeat steps 3-5 for each of the dependencies' dependencies until you run out of child dependencies
Service Properties - Dependencies Tab
This is probably a rarer case, but...
If you are using a custom AppPool Identity configuration be sure to check the AppPool is running. It may be turned off because credentials are invalid (usually due to an expired password). Update your credentials and start the AppPool.
I am able to resolve this by simply executing the below command in PowerShell to kill/stop service and restart the IIS server
taskkill /F /FI "SERVICES eq w3svc"
I managed to solve after:
Ctrl+Shift+Esc = To open Task Manager
In the "Processes" tab locate the "IIS Worker Process" and
finish it!
Run on cmd as an administrator. Type iisreset.
I was getting this error. It turns out World Wide Web Publishing Service was disabled.
Click Start, type Services in the Search box, and then click Services.
Scroll until you find the World Wide Web Publishing Service that is stopped or disabled.
right-click the service, and then click Properties.
Click the Startup type list, and then click Automatic.
Click Apply, and then click OK.

Debugging Topshelf service that won't run under restrictive account

I have a Windows service written using Topshelf. I'm trying to configure it to run using a Windows account with restricted privileges rather than using LocalSystem. That's also necessary as I'd like to connect to a database using integrated authentication.
The service works when run as LocalSystem (albeit with a database connection string containing credentials) and running the console application as my limited account (using runas) also works.
However, when I try to start the service the service control manager times out waiting for a response:
The service did not respond to the start or control request in a timely fashion.
I also get the following in the Application Popup event log:
Application Error : The exception unknown software exception (0xc06d007e) occurred in the application at location 0x77e4bef7.
The first thing that the application does is writes to a log file but it doesn't reach that when I start the service. The logging works if I run via the console.
Any suggestions what I might be missing or what I might try next?
This problem seems to be related to the server (a domain controller) rather than TopShelf. A service built with the .NET service component also exhibits the same behaviour.
The service runs successfully on a different machine (in the same domain).
Unfortunately this doesn't help diagnose the problem but gives me an acceptable workaround.
Check the MSDN article Debugging windows services which describes how you debug windows services.
I've just started seeing this on a few of my services written in .net 2.0. They'll start fine when the server boots, but if I were to restart them throughout the day, they would not start, and give this error message.
They currently ran under a domain account which has admin rights on the box, but for kicks, I switched it to Local System, and the service started normally. I stopped it, changed it back to the domain account (reentering the password), and it started normally again as expected.
Don't know if this counts as a 'fix' so much, but that's what worked for me.

Resources