Skip to main content

Setting up Eclipse and Tomcat Page

r-onlineinformation.blogspot.com 

Setting up Eclipse and Tomcat Page

Setting up Eclipse and Tomcat

NOTE: Please do not download any softwares right now. All softwares are already copied into your desktop.
To create Servlet projects, you need to use a version of Eclipse with J2EE support built in. The default version of Eclipse which you get with Ubuntu does NOT include J2EE support, so you have to download a version of Eclipse with J2EE support. You can get it from the Eclipse download site: http://www.eclipse.org/downloads/    (choose according to your hardware configuration and OS)

Version: We are using Eclipse Juno (4.2) Enterprise Edition in the workshop.  We suggest you also use this version, although an older version should also work fine if you are already familiar with it and using it currently.
After downloading, extract the compressed archive on your local file system. Then eclipse can be started by double-clicking on the eclipse executable file.
Further, to run servlets, you need to use the tomcat server. Even the Eclipse version with J2EE does not include the tomcat server, so you have to download and set up tomcat. Details of how to do so are below.

Creating a Tomcat server and Linking from Eclipse

    1. Install Apache Tomcat (version 6 at least), either by
        • using a package manager on your linux installation,
        • Download from moodle
        • or download Apache Tomcat from http://jakarta.apache.org/tomcat and extract the compressed file containing Apache Tomcat on your local file system.
        • DO NOT use the system tomcat installation which is usually on /usr/share/tomcat, since it is not writable by you. If you do this you will run into trouble later.
    2. Add the Apache Tomcat runtimes to Eclipse.  To do so, open Eclipse and do the following:
    • Using the Preferences page, you can define the server runtime environment definitions for the Apache Tomcat server. To define these definitions, complete the following:
      1. From the Window menu, select Preferences.
      2. In the Preferences window, expand Server and then select Runtime Environments.
      3. On the Server Runtime Environments page, click Add. The New Server Runtime Environment wizard opens.
      4. On the New Server Runtime Environment page, expand Apache.
      5. Select one of the following supported Apache Tomcat servers:
        • Apache Tomcat v6.0
        • Apache Tomcat v7.0
      6. When you add a server runtime environment, by default a server is created and added as an entry in the Servers view. The Create a new local server check box is selected by default; do NOT change this setting.
      7. The Tomcat Server page opens when you click Next.
      8. In the Tomcat installation directory field, type or browse to the directory where you extracted the installation files of Apache Tomcat. For example, x:/apache-tomcat-6.0.13, where x is the installation directory of the Apache Tomcat server. Use a directory which is writable by you, NOT the /usr/share/tomcat directory.
      9. Click Finish.
  1. Configure and Test the Apache Tomcat server:
    1. Select Servers tab (look at the bottom right of the screen, along with other tabs such as Markers and Properties). Now right-click and select New > Server. The Define a New Server wizard opens.
    2. In the Select the server type list, select the Tomcat server defined in the previous step.
      1. Tip: If you did not specify the Tomcat install directory, the Define a New Server wizard will prompt you for this information.
    3. Start the Tomcat server. In the Servers view, right-click the Tomcat server and select Start.
    4. Test your setup of the Tomcat server.
      1. Open a Web browser.
      2. Type the Web addresshttp://localhost:8080/. If you see the Apache Tomcat start page, you have successfully set up your Tomcat server.
      3. If you  see a 404 error message, but at least the message comes from Tomcat. Reason for this issue is Eclipse forgets to copy the default apps (ROOT, examples, etc.) when it creates a Tomcat folder inside the Eclipse workspace.  To resolve this  follow bellow steps.
      4.  This is not mandatory
         (Ref to bellow steps: http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html)
      1. Go to  /webapps/ROOT, copy ROOT folder.
      2. Then go to your Eclipse workspace, go to the  .metadata  folder(press ctrl + h to see this hidden folder) , and search for "wtpwebapps". You should find something like your-eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps (or .../tmp1/wtpwebapps if you already had another server registered in Eclipse).
      3. Go to the wtpwebapps folder,  and paste ROOT (say "yes" if it asks for  merge/replace option).
      4. Then reload http://localhost:8080/ to see the Tomcat welcome page.

      reference: iitb.ac.in/moodle
 

Comments

Popular posts from this blog

Create Custom ScreenTips for Shapes (MSOffice-word-2007)

r-onlineinformation.blogspot.com Create Custom ScreenTips for Shapes Shape ScreenTips in Microsoft Office Visio are the boxed text that appears when you point to a shape. Some Visio shapes have built-in ScreenTips—usually the name of the shape (such as the name of a workflow step). However, you can edit existing ScreenTip text or create new ScreenTip text for shapes that don’t have a built-in ScreenTip. To create or edit a ScreenTip: 1. Select the shape. 2. On the Insert menu, click either Shape ScreenTip or Edit Shape ScreenTip, as applicable. 3. In the Shape ScreenTip dialog box, type or edit the ScreenTip text. 4. Click OK.

Tips for running queries on Oracle

r-onlineinformation.blogspot.com Tips for running queries on Oracle We encourage the use of PostgreSQL for the labs, to expose students to an excellent open source database.  However, if your syllabus forces you to use Oracle (and all participants at your remote centre are also from universities where they are forced to use Oracle), you can do assignments on Oracle.  Our model solutions will often give syntax errors on Oracle due to non-support for some SQL features in Oracle.  Below are some tips on how you can rewrite the queries to work on Oracle. Oracle SQL Tips: non-standard features, and limitations The following issues are for Oracle 10, and may or may not apply to later versions of Oracle. Oracle does not support the  as  clause, except as part of the "with" statement. In all other cases, just use the same syntax without the "as" keyword, and things should work. To use a single quote in a string, use two consecutive single qu...

Peer to Peer (P2P) Search Engine

r-onlineinformation.blogspot.com World Wide Web (WWW) is emerging as a source of online information at a very faster rate.It’ s content is considerably more diverse and certainly much larger than what is commonly understood. Information content in WWW is growing at a rate of 200% annually. The sheer volume of information available makes searching for specific information quite a daunting task. Search engines are efficient tools used for finding relevant information in the rapidly growing and highly dynamic web. There are quite a number of search engines available today. Every search engine consists of three major components: crawler, indexed repository and search software. The web crawler fetches web pages (documents) in a recursive manner according to a predefined importance metric for web pages. Some example metrics are back link count of the page, forward link count, location, page rank etc. The Indexer parses these pages to build an inverted index that is then used by the search s ...