I have Jboss 4.2.3 installed and Windows Service,Log on AS is set to Local System for that service. When I deploying a small war project which is suppose to launch notepad.exe, jboss server runs the command but does not launch notepad.exe
When I run the JBoss 4.2.3 from command line with command run.bat -b 0.0.0.0 it launches notepad.exe from war project file Also when I change Log on AS for windows service to Current Windows User from which I am currently logged in and restart Jboss service it launches notepad.exe
I want to run Jboss service as Local System and have war file execute the exe, Can any one let me know how can I do that ?
Related
Starting with version 8.0, Red Hat Enterprise Linux (RHEL) no longer provides any version of the Apache Tomcat JAVA webserver/servlet as part of the RHEL distribution.[1]
Therefore, we have to install Tomcat via WAR file in the RHEL systems. The problem which arises is that it becomes difficult to start, stop or restart the Tomcat service as there is to service file installed, through which we could have easily used the command service tomcat start to start the service.
But there is a way through which we can create this service manually by writing a Systemd script. By placing this script in the /etc/systemd/system/ directory, we can use the service commands for managing the Tomcat Service.
Please share the Tomcat Service Creation Script.
This the Service Creation File. Copy and paste this file in the /etc/systemd/system/ directory.
The name of the file should be tomcat.service
[Unit]
Description=Apache Tomcat Web Application Container
Wants=network.target
After=network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-0.el8_2.x86_64/jre
Environment=CATALINA_PID={{ tomcat_dir }}/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME={{ tomcat_dir }}/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1G -Djava.net.preferIPv4Stack=true'
Environment='JAVA_OPTS=-Djava.awt.headless=true'
ExecStart={{ tomcat_dir }}/tomcat/bin/startup.sh
ExecStop={{ tomcat_dir }}/tomcat/bin/shutdown.sh
SuccessExitStatus=143
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target
Now you can easily manage the Tomcat Service with the Systemd Commands, even in RHEL8.
I need to deploy my spring boot rest api to my VPS server, to do so I installed JAVA and MAVEN. I ran it using sudo java -jar myfile.jar it is working but the problem is that after sometimes it stops and my webservice send me error 503.
I would like to know how to deploy it and run without it stopping.
PS : There is no page ".html" to be accessed that's the reason I want to deploy as JAR
I have a working WebService. I can deploy and run it from eclipse on a Tomcat Server. Now i want to run it from the command line.
The problem is that when i run the Tomcat server i can't add my web service as i do on eclipse to the server.
I tried to launch the Tomcat server like this in the command line :
tomcat
I can only add the arguments start or stop. How could i add my WebService like a do in eclipse ?
I think it could be possible with a file or something but i can't find anything that relate to my project.
Is this possible to do such a thing ?
You put your WAR file in the webapps directory of the Tomcat server and run the command line tomcat start
Using Apache Tomcat - Maven deploy plugin is my suggest:
http://tomcat.apache.org/maven-plugin-trunk/tomcat7-maven-plugin/deploy-mojo.html
From command line:
mvn tomcat7:deploy
(Tomcat 8 also use the above command)
1) Create a war File and Place it in the webapps folder of your tomcat.
2) To start the server, go the bin folder and execute startup.sh
./startup.sh
3) To stop the server, go the bin folder and execute shutdown.sh
./shutdown.sh
I am trying to run a jar (spring app) as a Windows service. I am using nssm to do so.
When I run the jar file with java -jar myjar.jar everything works fine. My webapp responds when I enter localhost:8080 where it runs.
After I run
nssm install MyService java -jar myjar.jar
nssm start MyService
I get in the console: MyService: START: The operation completed successfully
My application is usually logging to file as well, but it does not do so when running as a service. It seems like the application is not starting at all. When I try to access localhost:8080, nothing is responding.
Why isn't my app running when I start it as a service with nssm?
I have a simple JSP page that creates a directory on centOS server root
<% File f= new File("/test/testdir");
if(f.mkdir()){
%>
generated a .WAR file and deployed on server. when i run this code. the created directory
testdir have following attributes.
it should have tomcat as a owner. tomcat is a user on my server and tomcat is the member of tgroup group.
i need that the directory should have owner as tomcat and group as a tgroup
Maybe you are running tomcat with the user root. Change the user you are using to run tomcat process.
Your Tomcat process is running as root (which is not a good thing). Since you already have a separate tomcat user setup, complete the process of always running Tomcat as that user:
Assuming:
Install directory is /opt/tomcat (replace with your value)
Startup script is /etc/init.d/tomcat (modify to reflect your startup
script)
sudo /etc/init.d/tomcat stop
sudo chown -R tomcat:tgroup /opt/tomcat
sudo -u tomcat /etc/init.d/tomcat start
You may choose to hard code the user to run as in your startup script, which would be beneficial if you are setting Tomcat up to run on boot.