Marco Dinatsoli
Marco Dinatsoli

Reputation: 10570

how to run webapps on tomcat automatically

i have deployed a java server using my eclipse.

I extract the war file.

i installed the apache-tomcat-7.0.47 on my windows server 2003

i installed the Apache Tomcat 7 service on my windows server 2003 and made it run automatically.

i want to run the war file on my windows server 2003

what i have tried

i put the war file on my webapps on the apache-tomcat folder and then run the startup.bat which locates on the bin folder.

i test the server and it works perfectly

my problem

when i log of from my windows server. the war file stop working.

my question

how can i keep the server working ever when i log of. note that i installed the service and restart the server many times.

Upvotes: 1

Views: 711

Answers (3)

Marco Dinatsoli
Marco Dinatsoli

Reputation: 10570

After reading aksappy's answer. I discovered that the jvm is making that problem. i went to the bin folder of the apache-tomcat and run the tomcat7w.exe and then I went to the shutdown tab and changed the jvm to java.

this is the facinate solution that helped me

Upvotes: 1

aksappy
aksappy

Reputation: 3400

One way to do this is to use a Java Server Wrapper or http://support.microsoft.com/kb/137890

SO Link

There seems to be a way in java itself to do this, add -Xrs to your java.exe call in server startup (bat file I suppose), from Oracle Documentation . Beware of the consequences in using this!

-Xrs Reduces use of operating-system signals by the Java VM.

In an earlier release, the Shutdown Hooks facility was added to enable orderly shutdown of a Java application. The intent was to enable user cleanup code (such as closing database connections) to run at shutdown, even if the Java VM terminates abruptly.

The Java VM watches for console control events to implement shutdown hooks for unexpected Java VM termination. Specifically, the Java VM registers a console control handler which begins shutdown-hook processing and returns TRUE for CTRL_C_EVENT, CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT, and CTRL_SHUTDOWN_EVENT.

The JVM uses a similar mechanism to implement the feature of dumping thread stacks for debugging purposes. The JVM uses CTRL_BREAK_EVENT to perform thread dumps.

If the Java VM is run as a service (for example, the servlet engine for a web server), then it can receive CTRL_LOGOFF_EVENT but should not initiate shutdown because the operating system will not actually terminate the process. To avoid possible interference such as this, the -Xrs command-line option was added beginning with J2SE 1.3.1. When the -Xrs option is used on the Java VM, the Java VM does not install a console control handler, implying that it does not watch for or process CTRL_C_EVENT, CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT, or CTRL_SHUTDOWN_EVENT.

There are two consequences of specifying -Xrs:

Ctrl-Break thread dumps are not available.

User code is responsible for causing shutdown hooks to run, for example by calling System.exit() when the Java VM is to be terminated.

Upvotes: 3

vinay Maneti
vinay Maneti

Reputation: 1451

You can set the “deployIgnore” attribute for your web application in server.xml ; this attribute will ignore the war file name from deployment. Later you can deployment the application manually

Upvotes: 0

Related Questions