Two ways for move war file from Netbeans to Tomcat 8.

In last post we create in Netbeans WebApp application(jsp website). But if you want to run this application in tomcat without use Netbeans IDE, do these things describing below.

First open Netbeans IDE and right click on project name and choose Clear and Build.

w3Go to dist folder with your project files in NetbeansProjects catalogue. In my system it is in My Documents folder. Copy WebApps.war file.

w4Go to the webapps folder in your tomcat instalation folder and paste this file in it.

w5Then open console and go to tomcat 8  installation catalogue and write startup command. Type Enter.

w6The Tomcat 8 server is running.

w7Open browser and type in address field http://locahost:9090/WebApp.

w8The application is running. If you want stop server, write in console in tomcat installation folder shutdown command.

w9Another way for move application from Netbeans IDE is Manager App in tomcat.

So delete from webapps WebApp.war file and from D:\tomcat8\conf\Catalina\localhost WebApp.xml file – configuration file of WebApp application.

Run tomcat 8 from console as before,

w10

open browser and type in it address:

http://locahost:9090/

w1Click the Manager App button.

The server ask You for user and password, so write in it user as tomcat and password as tomcat. These atat are configured in tomcat-users.xml file in conf tomcat folder.

w2Click the OK button.

You see list of all applications and tools.

w12Go to WAR file to deploy section and browse WebApp.war file from C:\Users\admin\Documents\NetBeansProjects\WebApp\dist.

w13Click the Deploy button to move application war file into tomcat webapps folder.

w14

Click on WebApp link to your application. The application will be display.

w8In webapps folder in tomcat you see WebApp.war file and unpacked webapp catalogue for this application, but D:\tomcat8\conf\Catalina\localhost folder will be empty.

So if you copy war file from Netbeans and paste it into webapps folder, in tomcat will be creating in D:\tomcat8\conf\Catalina\localhost configuration file: WebApp.xml,

but if you browse war file from Manager App in tomcat and deploy this application, in webapps folder in tomcat will be unpacked war archive as webapp catalogue.