Getting started with Apache Tomcat

Not sure what motivated my investigation of Apache Tomcat last May, nor my ultimate implementation within Eclipse. But I recently stumbled across my notes and now seek to “put together the pieces,” so to speak.

In a sentence, Apache Tomcat is an open source web server. A web server, in a sentence, is a program that serves web pages to users using internet protocols. The only other web server I am very familiar with is Windows Internet Information Server (IIS).

Interestingly, I can’t tell you much at all about the web server which is serving you this page. For better or for worse, GoDaddy hosting does most of the thinking for me.

Perhaps that’s why I wanted to see what Apache Tomcat is all about? To learn about some alternatives to Windows/IIS? But now that I reflect on it, my thought is it would have made more sense for me to probe GoDaddy’s hosting management tools for this perspective.

Step by Step Guide to Setup and Install Apache Tomcat Server in Eclipse Development Environment (IDE)

Especially after I encountered some complications. For instance, at Step 3 I learned I needed “Eclipse For Java EE Developers” package. I had “Eclipse for Java Developers,” which did not have the features I needed enabled. (I downloaded that here: http://stackoverflow.com/questions/14229747/servers-tab-not-visible-in-eclipse-v3-7-2.)

Next, I ran into this problem:
http://stackoverflow.com/questions/17868232/how-to-use-tomcat-8-in-eclipse. At Step 3, Tomcat v8.0 Server was not available to me. So, I used Tomcat v7.0 Server. Still, server wouldn’t start. Incomplete installation, it said. But even before seeing the server would not start I sensed there were problems; at Step 5, I saw the Ports section did not display in Server Overview. I followed the Stack Overflow user wener’s solution, which seemed promising but ultimately didn’t help. Then I decided to delete Apache 8, install Apache 7.

Didn’t work.

Then-I’m not sure why-I decided to place the (deleted) Apache 8 directory back in My Documents (was in Recycle Bin). Then, suddenly, ports displayed in server overview.

Server started OK. Browsed localhost: http://localhost:8080/

Errors.

Several ports (8005, 8080, 8009) required by Tomcat v7.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).

I scratched my head, dinked around. Suddenly it worked. I was trying to run from main toolbar-I needed to right-click within servlet >> Run as >> Run on Server.

New error.

Server Tomcat v7.0 Server at localhost failed to start.

Console hinted: Invalid byte tag in constant pool: 15

Could be related to a warning I see in eclipse:
The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files

Apparently, this is a problem with Tomcat 7-Doesn’t work with JDK 8 (here:
http://stackoverflow.com/questions/23484098/org-apache-tomcat-util-bcel-classfile-classformatexception-invalid-byte-tag-in).

Mama mia. So I installed jdk 1.7 (here:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html).

Then Windows >> Preferences >> Java >> Installed JREs >> Add >> Standard VM >> JRE Home = C:\Program Files\Java\jdk1.7.0_79 >> Finish

Check that one.

Run as >> Run on Server >> Yay worked!

So…Now what do i want to do.
Copped this link: http://www.journaldev.com/1854/java-web-application-tutorial-for-beginners. Will experiment another time. Need a break.