Trying to do:
asadmin create-service
And getting:
Error while trying to install Glassfish as a Windows Service.
The return value was: 8.
STDERR:
STDOUT: WMI.WmiException: UnknownFailure
at WMI.WmiRoot.BaseHanderl.CheckError(ManagementBaseObject result)
at WMI.WmiRoot.ClassHandler.Invoke(Object proxy, MethodInfo method, Object[] ags)
at WMI.Win32ServicesProxy.Create(String, String, STring, ServiceType, ErrorControl, StartMode, Boolean, String[])
at winsw.WrapperService.Run(String[] args)
at winsw.WrapperService.Main(String[] arges
Command create-service failed
Trying to create glassfish as a service to start glassfish at windows boot (with a WAR file in the auto-deploy folder to start the application ASAP.)
I got the same error because Glassfish v3 was already installed as a Windows Service with the same default Display Name for the service: "Domain1 Glassfish Server".
The create-service command allows you specify a Service Name, but not the Service Display Name. Even though I supplied a new name when using create-service, it was trying to add the duplicate Display Name.
SOLUTION:
Use the Windows SC tool to change the Display Name of the existing Glassfish Service to something else before creating the new Windows Service:
sc config Domain1 DisplayName= "Domain1 GlassfishInstance1"
Then the create-service command will work for your new Glassfish Instance.
asadmin> create-service --name GlassfishInstance2"
The new Service will have the default Display Name of Domain1 Glassfish Server.
I also changed that with the SC tool afterward (optional)
sc config GlassfishInstance2 DisplayName= "Domain1 GlassfishInstance2"
do you have more than one domain in your domain directory? if so you must specify the name of the domain as noted in the asadmin create-service documentation
I got the same error when I had a service of the same name existing already. The service wasn't actually used any more and the domain had been deleted.
C:\sc delete domainName
removed the service and afterwards I could call asadmin create-service domainName
Related
I have a problem setting up some critical paths when I run Wildfly 20 as a service.
When I install (in "VM1") Wildfly in /home/myuser/ instead of /opt and NOT as a service and run it with the following, I am able to use the Admin console's "Test Connection" to connect to a Sybase SQL Anywhere database using the sajdbc4 driver.
cd ~/wildfly-20.0.1.Final/bin
export LD_LIBRARY_PATH=/home/myuser/wildfly-20.0.1.Final/modules/system/layers/base/com/sybase/main
export CLASSPATH=.:/home/myuser/wildfly-20.0.1.Final/modules/system/layers/base/com/sybase/main/sajdbc4.jar
./standalone.sh
LD_LIBRARY_PATH sets the path to the driver support files.
On the other hand, when I install Wildfly (in "VM2") exactly the same way as before except for installing into /opt and the extra steps to run Wildfly as a service as below, the Admin console's "Test Connection" fails with:
cd ~/wildfly-20.0.1.Final/bin
export LD_LIBRARY_PATH=/opt/wildfly-20.0.1.Final/modules/system/layers/base/com/sybase/main
export CLASSPATH=.:/opt/wildfly-20.0.1.Final/modules/system/layers/base/com/sybase/main/sajdbc4.jar
sudo systemctl start wildfly
2020-08-28 13:13:41,341 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183:
Service status report WFLYCTL0184: New missing/unsatisfied dependencies: service jboss.jdbc-driver.sajdbc4_jar (missing) dependents: [service jboss.driver-demander.java:jboss/datasources/TestDB, service org.wildfly.data-source.TestDB]
I can run a simple Java test app on the "VM02" system that connects and dumps a database table with:
cd $HOME/Desktop
export LD_LIBRARY_PATH=/opt/wildfly-20.0.1.Final/modules/system/layers/base/com/sybase/main
export CLASSPATH=.:/opt/wildfly-20.0.1.Final/modules/system/layers/base/com/sybase/main/sajdbc4.jar
java sajdbc4DriverTest.java
This suggest ti me that all of the driver files are present at and the LD_LIBRARY_PATH location. Note that the launch of Wildlfly as a service uses the same paths.
Can anyone explain why Wildfly is ignoring the two paths I set prior to starting the service?
Thank you in advance.
Service environment variables are not set this way. And even if they were, the use of sudo changes to a new user with new environment variables.
Instead, if you installed Wildfly as documented in wildfly-20.0.1.Final/docs/contrib/scripts/systemd, add your environment variables in /etc/wildfly/wildfly.conf. Something more like:
# The configuration you want to run
WILDFLY_CONFIG=standalone.xml
# The mode you want to run
WILDFLY_MODE=standalone
# The address to bind to
WILDFLY_BIND=0.0.0.0
# Add Sybase native library dir
LD_LIBRARY_PATH=/opt/wildfly-20.0.1.Final/modules/system/layers/base/com/sybase/main
I don't feel that you need to set CLASSPATH but I don't think it'll hurt either.
I installed JBoss EAP-7.1.0 through windows installer and then configured it as a service. But now I couldn't start the service, i tried through the windows task manager but it shows Access denied. (see the screenshot below)
How to start the service with admin privilege?
Do the following steps:
Launch Command prompt as Administrator
Type in sc start JBossEAP7
I am attempting to deploy a war file (Oracle's APEX Listener) to a GlassFish 3.1.2.2 server deployed on an RHEL server (I am also seeing the same issues on an Ubuntu server at home).
I used the following command to create the domain:
$GLASSFISH_HOME/bin/asadmin create-domain --portbase 8100 myDomain
[I am also creating multiple domains on the same GlassFish server (one GF instance with multiple domains) using values of 8200, 8300, and 8400 for the portbase value and using different domain names.]
I then start the domain using:
$GLASSFISH_HOME/bin/asadmin start-domain myDomain
Next, I attempt to deploy the APEX.WAR file using:
$GLASSFISH_HOME/bin/asadmin deploy --contextroot apex apex.war
But, I get the following error:
Remote server does not listen for requests on [localhost:4848]. Is the server up? Unable to get remote commands. Closest matching local
command(s):
help Command deploy failed.
I have also used the following commands with the same result:
$GLASSFISH_HOME/bin/asadmin deploy apex.war
$GLASSFISH_HOME/bin/asadmin deploy --target myDomain apex.war
$GLASSFISH_HOME/bin/asadmin deploy --target domain apex.war
And I get the same error each time.
I can deploy the file using the admin gui, but this is for a customer installation and I would really like to do as much as possible from the bash shell script I have created.
I am also installing the Java 1.7.0_45 JDK and modifying the $GLASSFISH_HOME/config/asenv.conf file to include AS_JAVA=
The error is actually correct because the admin port is 8148. But, how do I get GlassFish to "know" to use 8148 instead of 4848.
I have also tried this by:
$GLASSFISH_HOME/bin/asadmin create-domain --adminport 8148
--domainproperties http.ssl.port=8152
but this gets the same results as above.
Thanks for reading this tome of a post and any info on how to fix this would be greatly appreciated!
/dave
You can specify the port to which asadmin should connect as a parameter like this:
asadmin --port 4949 start-domain
If this isn't enough you can even specify the hostname with --host.
Have a look at the official documentation to see all possible parameters.
i get the same error ,you should do like this:
$GLASSFISH_HOME/bin/asadmin --port 8148 deploy apex.war
and input username and password the default user is admin and password is adminadmin
good luck for you!
In Windows Server 2008 R2, I can run JBoss successfully from the command line specifying options suchs as "-b 0.0.0.0". However, I want to run JBoss as a Windows service. I understand that I run /Path/To/JBoss/bin/service.bat install from the command line and this basically runs the start.bat whenever the computer starts. How do I configure the service to start with the command line arguments of -b 0.0.0.0?
Possible duplicate of How can I bind a JBoss AS 6 running as service to 0.0.0.0?
You could just hardcode -b 0.0.0.0 inside run.bat.
BTW, consider using Java Service Wrapper or YAJSW as RunJBossAsAServiceOnWindows wiki suggests. It allows to specify various service params in config.
I am running a service called prunner on windows server 2012. I used the command sc to change the username and the password of the service:
sc.exe config myService obj= "sqa265\hero" password= "hero1"
The output of the command is saying that it have succeed but when I go to task manager in order to start the service I get: logon failure!!!
I tried to run the sc command under the user hero and under the user administrator but I still get the same error. But the very strange thing is that if I do the same thing manually via the task manager and service control pane I success and the service go to the state:running!!! But I need to automate this thing, so please any help?
You need to give the account "sqa265\hero" the SeServiceLogonRight permission. As you have noticed setting the credentials up through the control panel works, but what you might not have noticed is that if you tried to use the command line after using the control panel.
You can test this by setting the service back to the Local System account in the control panel, and then running your command-line again.
To fix this from a script, you can use the NTRights utility outlined in this MS knowledgebase article:
http://support.microsoft.com/kb/315276
After you install NTRights, you can run it like this:
NTRights.exe +r SeServiceLogonRight -u "sqa265\hero"
Combined with the sc config commandline you already have, the service should run with those credentials.
Further reading:
http://www.techrepublic.com/article/set-user-rights-using-the-ntrights-utility/5032903