I am using Wildfly 9 under both Ubuntu an Windows servers. Sometimes, I need to restart the servers but after I stop the server, I cannot start it again. There is a red message box saying Server start failed. The detailed message is:
WFLYCTL0158: Operation handler failed: java.lang.IllegalStateException
I cannot stop Wildfly because there is a bug on Windows preventing the user from stopping Wildfly server through Services. The process stucks at Stopping but it never stops the Wildfly service. I have to restart Windows itself to make it work again.
Anyone facing this problem? How can I overcome this?
Here is how I got around the "stopping" issue.
To kill the windows service without having to reboot windows, create a batch file call it killwindowsservice.bat or whatever. Put the following in it.
set SERVICE=%1
echo Killing Service %SERVICE%
FOR /F "tokens=3" %%A IN ('sc queryex %SERVICE% ^| findstr PID') DO (SET pid=%%A)
IF "!pid!" NEQ "0" (
taskkill /f /t /pid !pid!
)
Just call your script with the name of the windows service. So for me I call my Windows Services the name of my application server instance. So for eaxmple "Server01".
So for me I would call it like:
killwindowsservice.bat Server01
And the script will kill the windows service.
The Windows service scripts that come with Wildfly 8.x+ DO NOT work on Windows 2012/2012 R2. I have not gotten them to work. I went and grabbed the jbosssvc.exe from a previous version of JBoss and customized the Windows Service scripts that come with it. And they work perfectly. I'm using these scripts on 12 Wildfly servers now without a problem.
This is how I manage Wildfly on Windows:
Open Task Manager
Eanble Command Line column under Details tab
Find Wildfly process (the path will tell you correct instance)
Kill the process
Then the server starts through admin console. You can also kill Wildfly master process and start over.
Related
I've been using http://commons.apache.org/proper/commons-daemon/ to create a windows service for the Wildfly startup (using exe mode as proposed in some blogs). The problem is, that the service is immediately marked as running. I have some other services that are only allowed to start once Wildfly is up and running. Making these services depend on the Wildfly service won't work, because the startup takes between 20-60 sec.
Is there a way to make procrun wait for a return value or at least for a fixed time, before the service is marked as running?
I don't use that service wrapper but the one that ships with wildfly (in the docs\contrib\scripts\service folder. (See http://www.mastertheboss.com/jboss-server/jboss-configuration/run-jboss-as-service-howto for details).
But I suspect the problem is one I see as well. wildfly starting is a quick process process - 1 or 2 seconds - but what then takes the time is deploying your ear or war files so it can actually do something useful. You can tell when that's happened by the
myEar.ear.deployed file turning up. With the wildfly service wrapper, everything is done in the service.bat script, and starting the wildfly service basically means running the code at the :commandStart label.
:cmdStart
if /I "%~1"=="/name" (
if not "%~2"=="" (
set SHORTNAME="%~2"
)
)
%PRUNSRV% start %SHORTNAME%
echo Service %SHORTNAME% starting...
goto cmdEnd
after the echo of Service starting, you could put in a sleep for 30 s
timeout /t 30 /nobreak
or you could try looking for the .deployed file and looping until its there or a .failed file is there. (A simple timeout is easier!)
Can someone please give detailed way to monitor JBOSS app server ?
The production application running on JBOSS server starts working fine after restarting the server. How do I identify what is the cause behind it?
To see what is "hung", try getting a thread dump from your JBoss instance by running it in the foreground from a command shell. Then on Linux, send a kill -3 [PID] to JBoss to dump its thread state to stdout. On Windows, you would type Control-Break in the CMD shell running JBoss. Alternatively, use a monitoring tool like VisualVM.
as mentioned from the title i have a problem stopping the wildfly windows service.
When i tried to stop the wildfly service via the server manager - services window the status of the wildfly service doens't change to stop from stop pending. But wildfly isn't running anymore (my web service is not reachable and also the server log says that wildfly was successfully stopped). to start the service again i have to restart the windows server.
i've tested this with different scenarios:
Windows Server 2008 R2 Datacenter + Wildfly 9
Windwos Server 2012 Datacenter + Wildfly 10
Windows 7 + Wildfly 10
I also tried to make changes in the service.bat like Chris French mentioned on https://developer.jboss.org/thread/238135?tstart=0 but there is no change.
Interessting is that the problem doens't exists on any of the scenarios when i added the service without adding any deployments to wildfly (so just the blank server). What means that i am able to start and stop the wildfly service successfully from the server manager services window when the wildfly server is "blank" and without any changes (for e.g. in standalone.xml).
So i think the problem must be my java ee project which contains a web service and a simple persistent project to access different my sql databases. In the standalone.xml i just added the mysql driver and the databases and i do some edits in the interface section (ip adress changes).
Any Ideas? Do i have to made changes in different config files (for e.g. the service.bat) when im deploying something to wildfly?
Sorry for my english and thanks a lot!
When installing the WildFly service, make sure you have the following parameters specified:
In WildFly 8: /user <username> /password <password>
in WildFly 10: /jbossuser <username> /jbosspass <password>
In the services.bat the documentation reads:
/user: username for the shutdown command
/password: password for the shutdown command
According to my experience, without these parameters, WildFly will move to status "stopping", but will not stop.
That works for me:
1. Always run the CMD as admin first.
2. If your JBOSS_HOME environment is not set, get sure that you navigate to WildFly home directory before you execute the script.
For example: cd "C:\Program Files\wildfly
It's matter, because the service.bat takes your current dir (%CD%) as JBOSS_HOME, if it's not set.
3. You’ve to install the service with a special parameter. /controller
It’s important that you tell wildfly service on which port your wildfly admin console is running.
Take a look in standalone.xml, search for “management-http”, get sure that you use the same port in parameter.
Example: (Default port is 9990)
./bin/service/service.bat install /controller localhost:9990
Done. Now start the service and wait until you can reach the wildfly console page.
After try to stop or restart the service in service.msc or with service.bat (service.bat start/stop/restart).
I had similar issue but it turned out I needed a JAVA_HOME in standalone.conf.bat under bin folder. Simply uncomment the line that sets the JAVA_HOME variable and update its value with the desired path.
set "JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121"
Above solution worked for me.
I had the "stopping" problem, when JAVA_HOME was set directly in jboss_cli.bat, pointing to the older jdk version previously installed on my machine. Check jboss_cli.bat for correct path of JAVA_HOME or simply use the JAVA_HOME environment variable (you might have to delete set JAVA_HOME line in jboss_cli.bat).
When I try to stop the Microsoft FTP Service using the net stop ftpsvc command in a Windows 7 32bit (IIS 7.5) machine it just says stopping and ....... and hangs. It remains there indefinitely, I can't stop or start it.
When I look at the processes through task manager I can see svchost ftpsvc running, I try to kill it using teh task manager (from the Process Details page) nothing happens. I try to kill it using taskkill and the PID through an administrative command prompt and it says process terminated but i can see if running in task manager process details. I try to kill it using process explorer and nothing happens.
This happens is a user is downloading a file and then I try to do a net stop ftpsvc in between.
There are no child processes. Any idea what's going on and if there's some way to kill this process without rebooting?
Did you try force-kill?
Run this from command line:
sc queryex ftpsvc
Then you will get Process Id which can be used to taskkill with f switch:
taskkill /f /pid [PID]
Go to the process details section of task manager and kill the process. We have a message query service that often refuses to stop. Then refresh the services page and start it again.
Second part: The file will be partially uploaded or downloaded. It is the client applications responsibility to do those checks. There will be no locks on ftp.
I'm struggling with the start of jboss as a service. I have a batch file i.e test.exe where i have written a script to start a Jboss as a service..
cd "C:\Program Files (x86)\empl\jboss7\bin"
service install
ECHO "Jboss Starting......."
service start
TIMEOUT /T 20
ECHO "Jboss Started
and even i tried NET START "JBAS70SVC" where JBAS70SVC is service name .
I'm able to install service but when i check status of my service in SERVICES folder of windows 7 its not started
When i reboot my system then i can see status "STARTED" and my application runs.
how can i start my service without rebooting the system ?
SC START Service
See SC /?
I need to add these chars to reach min post requirements :)