Starting stopping JBOSS jboss-eap-6.3.2 manually? - jboss

I have JBOSS jboss-eap-6.3.2 installed, and I want to manually start/stop it. In bin directory I see the following script standalone.sh. There is no stop script in there.
How do I manually start / stop the JBOSS server?
One more things: does standalone.sh start the admin console of JBOSS as well?

standalone.sh starts everything.
If you started standalone.sh in interactive mode hit CTRL+C
More about starting and stopping you find in the documentation:
https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.4/html/Administration_and_Configuration_Guide/sect-Start_and_Stop_JBoss_EAP_6.html

Related

How can I launch postgres server headless (without terminal) on Windows?

Using Postgres 9.5 and the libpqxx c++ bindings, I want to launch a copy of postgres that is not installed on the users machine, but is instead packaged up in my application directory.
Currently, I am using pg_ctl.exe to start and stop the server, however when we do this, pg_ctl.exe seems to launch postgres.exe in a new terminal window.
I want it to launch postgres.exe in a headless state, but can't work out how.
I have tried enabling/disabling the logging collector, setting the logging method to a csv file (instead of stdout/stderr), and a couple of other logging related things, but I don't think the issue is the logging.
I have also tried running postgres.exe manually (without pg_ctl) and can get that to run headless by spawning it as a background process and redirecting the logs, but I would prefer to use the "pg_ctl start" api for the "wait for startup" (-w), and "timeout" (-t) options that it provides.
I believe you won't be able to do that with pg_ctl.
It is perfectly fine to start PostgreSQL directly through the server executable postgres.exe. Alternatively, you can use pg_ctl register to create a service and start the service.
In my use case, I was able to resolve the issue by running pg_ctl.exe using
CreateProcess, and providing the dwCreationFlags CREATE_NEW_PROCESS_GROUP | CREATE_NO_WINDOW.
I was originally using CREATE_NEW_PROCESS_GROUP | DETACHED_PROCESS, but DETACHED_PROCESS still allowed a postgres terminal to appear. This is because DETACHED_PROCESS will spawn the pg_ctl without a console, but any process that inherits stdin/stdout from pg_ctl will try to use it's console, and since there isn't one, one will be spawned. CREATE_NO_WINDOW however will launch the process with a conhost.exe, however the console will have no window. When the executables spawned by pg_ctl try to write to the terminal, they will successfully write to the console created by the conhost.exe which has no window.
I am now able to run pg_ctl from code with no console appearing.

WebStorm - run default configuration after starting the `Mongod` tool?

Currently I have a tool setup that will launch Mongod, following the advice of this post.
However, the issue is that when I have my configuration setup to run this Mongod tool before launching, it won't run my node script since there's no "successful completion" by Mongod.
Is there any way around this? In other words, can I have mongod start alongside my configuration but not block my script from running until it "completes"?

Jboss EAP 6 CLI Script with commands that require reload

I'm working on a cli script for JBoss EAP 6 (just a bunch of commands in a .bat file).
Now I'm running into issues with commands that rely on each other, where the former sets the server to a "reload-required" state.
For example:
first command: remove default-datasource ExampleDS. Outcome: success, server in state "reload required"
second command: remove h2-driver (required by default datasource). Outcome: failed, since server has not been restarted yet.
I've tried to place a reload command in between, but it seems as if the server is not completely up when the second command gets executed. Outcome still is failed, although if I try it a few seconds later, it works.
/subsystem=datasources/data-source=ExampleDS:remove
reload
/subsystem=datasources/jdbc-driver=h2:remove
Any suggestions how to make the CLI wait until JBoss is completely up again?
Try batching those commands together and doing a reload after you run the batch. For example:
batch
/subsystem=datasources/data-source=ExampleDS:remove
/subsystem=datasources/jdbc-driver=h2:remove
:reload
run-batch
Another option is to run the server to start the server in admin-only mode while configuring it. You should need the reload command in that case, but if you do make sure you use :reload(admin-only=true) until you're done configuring the server.
%JBOSS_HOME%\bin\standalone.bat --admin-only
rem Wait until server is started, then execute the CLI commands
%JBOSS_HOME%\bin\jboss-cli.bat -c --commands="/subsystem=datasources/data-source=ExampleDS:remove,/subsystem=datasources/jdbc-driver=h2:remove"

Can't stop or restart JBoss AS 4.2.3 as a service in Fedora

i have a little issue with a Jboss AS 4.2.3 . I'm developing an application in Seam so i'm using Jboss as server. In the client company they have a Jboss AS 4.2.3 installed on Fedora and configured as a service, so it starts automatically on boot machine with PostgreSQL. So, if i run chkconfig --list i can see Jboss here as a service.
But the problem is when i try to restart, stop or start this service (i have root permissions) using this command:
service jboss stop/restart
But i don't know what happens that looks like it doesn't find the Jboss AS instance that's running because i get this message:
JOBSS_CMD_START = cd /opt/java/jboss/bin; /opt/java/jboss/bin/run.sh -c default
No JBossas is currently running
But it's running because if i enter localhost:8080 on a browser it loads the Jboss page. The server admin of the company doesn't know also why the service can't restart or stop or start and only i know that he followed this tutorial to install and configure JBoss AS:
thewiki4opentech.org/index.php/How_to_install_JBoss_AS_in_CentOS_/RedHat/_Fedora
Also, i tried with
/etc/init.d/jboss stop
And i get the same output. If i use
/opt/java/jboss/bin/start.sh -c default
It tries to start a second instance of Jboss AS but it gives me errors because is trying to use the same ports as already started Jboss instance.
And it's difficult to me because i'm connecting remotely using Teamviewer and i want to deploy an EAR but i can't because i can't restart the service to extract the ear. So i wanna ask you for help if you know why the Jboss AS that's running can't be stopped or started using service jboss stop.
As aditional info, i'm using the config to access Jboss apps from other machines (using 0.0.0.0) and the server has a static IP. The config of my hosts file is this:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.1.106 entertechserver.localdomain entertechserver
#::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Regards.
Well, i think that i found the answer. The server admin copy the script run.sh to /etc/init.d/ but we saw that there's another script named jboss_init_redhat.sh that i think is optimized for redhat/fedora systems, so we used this script to copy to /etc/init.d/ and it works!! Now when i stop it gives me the next output:
JBOSS_CMD_START = cd /opt/java/jboss/bin; /opt/java/jboss/bin/run.sh -c default -b 0.0.0.0
waiting for processes to stop
Really i haven't seen the difference between both scripts yet but it will be intersting to take a look.
Regards.

Kill all instances of jboss on win xp

I want to kill all instances of jboss running on win xp
How can I do the same ?
The smartest way to do this is (if you are using windows) install each jboss instance as a service, and then use net stop "Service Name". This can be easily automated via .bat file because you can just string all the net stop's together. More info on net stop: http://technet.microsoft.com/en-us/library/bb490715.aspx
You can also use the taskkill feature if you know there are no other java.exe's out there.
taskkill /F /IM java.exe /T
Otherwise use the shutdown port for each running instance. For AS7 you will use
%JBOSS_HOME%/jboss-cli.bat --connect command=:shutdown
Or other versions of JBoss have arguments to the bat file you can use.
%JBOSS_HOME%/./shutdown.bat
Run jboss.bat stop.
Or kill java.exe, but be carelfull not to close some other application.
Anyway, I doubt you have more than one instance.
You've got to open Task Manager (or Process Explorer) and terminate the Java virtual machines.
Could you try to Stop the JBOSS service from Administrative Tools->Services application ?
<JBOSS_HOME>/bin/jboss-cli.sh --connect --command=:shutdown
Follow these steps to avoid getting Address localhost:1099 is already in use error.
First way:
Goto Task Manager and select Processes tab.
Find the process named Java(TM) Platform SE binary and this represents java.exe
Select this process and kill it.
Now you are good to go with the JBOSS server. Start it.
Second way:
Go to bin folder in the JBoss location
E.g. (In my PC) - Windows 8, 8.1 and 10
D:\Servers\jboss-4.2.3.GA\bin
Press Shift key in the keyboard and right click
Select Open Command Window Here
Then type, shutdown.bat -S and enter
It will take some to down the server and then you are good to go.