Results 1 to 10 of 10
  1. #1
    pjava is offline Member
    Join Date
    Dec 2010
    Posts
    7
    Rep Power
    0

    Default Helios do not start tomcat 7

    Good Morning for all. I instaled Tomcat 7 into My Eclipse Helios. I add my Dynamic Web Project to Tomcat. I started Tomcat by eclipse and when I run in the browser it not work. But in the eclipse, It is started. What should I do?

  2. #2
    peace76 is offline Member
    Join Date
    Apr 2010
    Posts
    18
    Rep Power
    0

    Default

    what happens when you type. http://localhost:8080/ ?

  3. #3
    pjava is offline Member
    Join Date
    Dec 2010
    Posts
    7
    Rep Power
    0

    Default

    nothing. nothing appears in the browser. Before, I instaled Tomcat by installer and when I type: http://localhost:8080, the Tomcat Page appears. But, if I start tomcat by Eclipse, nothing appears by browser. I uninstalled Tomcat, and I unzip the zip file(Tomcat), but do not Installed, I copy and paste into windows 7. Atached in Eclipse Helios and started. Ok(only Eclipse), because in the browser do not work.

  4. #4
    peace76 is offline Member
    Join Date
    Apr 2010
    Posts
    18
    Rep Power
    0

    Default

    Okay, looks to me as it is a problem with Ecplise. Im not familjar with that IDE. in Netscape I know it is possible to select what container to use.

    Install Tomcat again. And if it works when you type localhost:8080 but not when you start it in Eclipse look at the setup in the IDE.

    Dont know if it helps much. This is not my field of expertice =)

    /peace

  5. #5
    pjava is offline Member
    Join Date
    Dec 2010
    Posts
    7
    Rep Power
    0

    Default

    My folder's tree is:
    Apache Tomcat >> WebApps >> Beer-v1 >> WEB-INF >> classes >> com >> Example >> web

    In the Beer-v1 I put my Form.html
    In the WEB-INF I put my web.xml
    In the folder web I put my BeerSelect.class(My Servlet)

    Below the source code of Html, Servlet and xml:
    XML Code:
    <html>
      <body>
        <h1 align="center">Página de Seleção de Cerveja</h1>
        <form method="POST"
         action="SetectdBeer.do">
         Selecione as características da cerveja<p>
         Color:
           <select name="color" size="1">
             <option value="light"> light </option>
             <option value="amber"> amber </option>
             <option value="brown"> brown </option>
             <option value="dark"> dark </option>
           </select>
           <br><br>
         <center>
           <input type="SUBMIT">
         </center>
        </form>
      </body>
    </html>
    below is my web.xml
    XML Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                          http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      version="3.0">
    
    <servlet>
      <servlet-name>Ch3 Beer</servlet-name>
      <servlet-class>com.example.web.BeerSelect</servlet-class>
    </servlet>
    
    <servlet-mapping>
      <servlet-name>Ch3 Beer</servlet-name>
      <url-pattern>/SelectBeer.do</url-pattern>
    </servlet-mapping>
    </web-app>
    below is my servlet.java
    XML Code:
    package com.example.web;
    
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    /**
     * Servlet implementation class BeerSelect
     */
    public class BeerSelect extends HttpServlet {
    	private static final long serialVersionUID = 1L;
           
        /**
         * @see HttpServlet#HttpServlet()
         */
        public BeerSelect() {
            super();
            // TODO Auto-generated constructor stub
        }
    
    	/**
    	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
    	 */
    	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    		// TODO Auto-generated method stub
    	}
    
    	/**
    	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
    	 */
    	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    		// TODO Auto-generated method stub
    		response.setContentType("text/html");
    		PrintWriter out = response.getWriter();
    		out.println("Beer Selection Advise<br>");
    		String c = request.getParameter("color");
    		out.println("<br>Got beer color " + c);
    }
    
    }

  6. #6
    pjava is offline Member
    Join Date
    Dec 2010
    Posts
    7
    Rep Power
    0

    Default

    One question, only. In My computer there are two folder in the path:
    C:\Program Files\java\jre6 and C:\Program Files\Java\jdk1.6.0_21. I had choose this:C:\Program Files\java\jre6, but this path can be with a problem, okay or not? This is only question.

  7. #7
    peace76 is offline Member
    Join Date
    Apr 2010
    Posts
    18
    Rep Power
    0

    Default

    Quote Originally Posted by pjava View Post
    One question, only. In My computer there are two folder in the path:
    C:\Program Files\java\jre6 and C:\Program Files\Java\jdk1.6.0_21. I had choose this:C:\Program Files\java\jre6, but this path can be with a problem, okay or not? This is only question.


    Jre6 is for display only.

    jdk is for development.

    You have not set Form.html as welcome page ? Try renam it to index.html.

    Else the setup looks okay to me.

  8. #8
    pjava is offline Member
    Join Date
    Dec 2010
    Posts
    7
    Rep Power
    0

    Default

    My Enviroment variable JAVA_HOME must be apoitment to:
    C:\Sun\SDK or C:\Program Files\Java\jdk1.6.0_21?
    The User Variable PATH=C:\Sun\SDK. Is correct?

    When I installed JavaEE, this folder were created:C:\Sun\SDK.

  9. #9
    pjava is offline Member
    Join Date
    Dec 2010
    Posts
    7
    Rep Power
    0

    Default

    If I start Tomcat by Windows, but not Eclipse, I can call the Form.html, but I don't can the Servlet. Appear this error:
    HTTP Status 404 - /Beer-v1/SetectdBeer.do

    type Status report

    message /Beer-v1/SetectdBeer.do

    description The requested resource (/Beer-v1/SetectdBeer.do) is not available.
    Apache Tomcat/6.0.29

    If only I could run out without Eclipse, already solved my problem immediately.
    The full code, is above.

  10. #10
    peace76 is offline Member
    Join Date
    Apr 2010
    Posts
    18
    Rep Power
    0

    Default

    You have miss-spelled this

    Java Code:
     <form method="POST"  action="SetectdBeer.do">
    should be

    Java Code:
     <form method="POST"  action="SelectdBeer.do">

    Can you see the difference ?

Similar Threads

  1. Hibernate perspective in Eclipse Helios
    By redforce.bala in forum Eclipse
    Replies: 0
    Last Post: 10-01-2010, 08:55 AM
  2. Problem with running eclipse-jee-helios-win32-x86_64
    By rohit_mali55@yahoo.in in forum Eclipse
    Replies: 2
    Last Post: 09-09-2010, 04:48 PM
  3. Unable to start tomcat
    By icai in forum Eclipse
    Replies: 7
    Last Post: 03-23-2010, 12:08 PM
  4. Tomcat In Eclipse - Sysdeo Tomcat Plug-in
    By JavaForums in forum Eclipse
    Replies: 1
    Last Post: 02-13-2008, 11:33 AM
  5. Start a servlet when Tomcat Starts
    By sandeepkk2005 in forum Advanced Java
    Replies: 1
    Last Post: 12-03-2007, 03:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •