Installing Tomcat 7 and Configuring as Server in NetBeans

Lucas Jellema 10
0 0
Read Time:2 Minute, 16 Second

Tomcat 7 is a Servlet Container – a fairly light weight container, very convenient for development and testing. While not a full application server, Tomcat implements the functionality described in the Java Enterprise Edition Web profile specifications. Most notably, it supports version 3.0 of the Servlet API (application programming interface) and version 2.2 of JavaServer Pages, both part of the recently ratified JEE 6.

Installing Tomcat 7 is dead-easy and configuring Tomcat as Server in NetBeans to allow direct (re)deployment of web applications from within NetBeans is just as easy. Still, a brief blog article explaining the steps – for even easier lives for Java Web developers. And as testimonial to the ease of use the development teams behind Tomcat and NetBeans provide to the world of Java developers.

In a previous blog I described the installation of NetBeans (https://technology.amis.nl/blog/14661/first-experiences-and-getting-started-with-glassfish-3-1-and-netbeans-7-x-its-a-breeze).

Installation of Tomcat starts with downloading Tomcat, from the Apache site: http://tomcat.apache.org/download-70.cgi

Image

After downloading the zip-file, I extracted it to c:\java (the location is of your own choosing though).

Image

Next I turn to NetBeans to configure Tomcat 7 as a new server.

Open the Tools menu and select the option Servers:

Image

The list of currently configured servers appears. Underneath is the big Add Server button. Press that button.

Image

Select the type of Server to add and provide a name for it – just for reference within NetBeans.

Image

Press Next.

Image

Provide the location where this server instance is installed – the target directory for the extraction of Tomcat 7. Also provide credentials for a Tomcat Administrator account ( in my case I used admin/admin).

Press Finish.

The newly configured Server is presented:

Image

Press Close.

Now the Tomcat 7 Server can be started (and stopped, deployed to etc.) from within NetBeans. Open the Services Window (from the Window menu – option Services or using Ctrl-5).

Image

The Tomcat output console appears in NetBeans:

Image

After a few seconds, Tomcat is running. The home page can be accessed at http://server:port – in my case localhost and port 8085:

Image

Tomcat is now ready to have applications deployed to it – for example from within NetBeans.

Note: in order for the admin user to also access the management console at http://localhost:8085/manager/html it is imperative that this user is granted the manager-gui role. This can be done by editing the tomcat-users.xml file in the conf directory of the Tomcat installation and adding this role. The entry for user admin would then become:

<user password=”admin” roles=”manager-script,admin,manager-gui” username=”admin”/>

About Post Author

Lucas Jellema

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Kubernetes & Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press book Oracle SOA Suite 12c Handbook. Frequent presenter on user groups and community events and conferences such as JavaOne, Oracle Code, CodeOne, NLJUG JFall and Oracle OpenWorld.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

10 thoughts on “Installing Tomcat 7 and Configuring as Server in NetBeans

  1. catlina base is not present in configuration folder error prompted again and again still i following the same steps what should i do to resolve this problem ???

Comments are closed.

Next Post

Running CometD 2 examples - locally on Tomcat using Maven and NetBeans

Push technologies is an area of interest to me. I have been looking into frameworks, servers and libraries such as Atmosphere, ADF ADS, CometD 2, Kaazing, jWebSockets, Grizzly and others. In my experience, even though there is a lot of information to be found through Google, it is not simple […]
%d bloggers like this: