File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Problem invoking a servlet directly from FireFox browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Problem invoking a servlet directly from FireFox browser" Watch "Problem invoking a servlet directly from FireFox browser" New topic
Author

Problem invoking a servlet directly from FireFox browser

Harry Henriques
Ranch Hand

Joined: Jun 17, 2009
Posts: 206
Hello,

I am using Eclipse Helios and Tomcat 7 and Ubuntu Lucid Lynx. When developing the web.xml, I started with the web.xml file supplied with Tomcat 7. I have been able to successfully run this web app independently from Eclipse Helios (directly from /var/lib/tomcat7/webapps/HearingImpaired). This example is taken directly from the Head First Servlets & JSPs textbook. I have been working on this problem for more than 2 hours. I don't see anything wrong with my web.xml file (Do you?).



HearingImpaired is the name of the Dynamic Web Project in Eclipse Helios.

I'm trying to invoke the web app in the FireFox browser with the following URL http://localhost:8080/HearingImpaired/InvokingTest.do The error message is 404. The browser cannot find the resource. Thanks for your assistance.

Harry
Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 802

Check whether Tomcat is properly started or not


SCJP 5.0 - JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - JavaSE7 - JavaEE6 -Generics FAQ - JLS - JVM Spec - Java FAQs - Smart Questions
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1731
    
  25

Hi Harry,

This problem is mostly caused by a problem in your directory structure.

Have a try on the following instructions: How to create a web-application without an IDE

Regards,
Frits
Harry Henriques
Ranch Hand

Joined: Jun 17, 2009
Posts: 206
Thanks for the replies.

Unfortunately, Tomcat 7 is up and running in my Eclipse Helios IDE, and I an even invoke a form.html in another Dynamic Web Project in the same workspace.

I am able to create a directory structure in Ubuntu that enables me to independently invoke my web-app outside of the Eclipse Helios IDE using Tomcat 7.

My problem is that I cannot invoke my web-app inside of Eclipse Helios IDE while Tomcat 7 is up and running.

Any more suggestions?

Harry
Harry Henriques
Ranch Hand

Joined: Jun 17, 2009
Posts: 206
Here is the rest of the code:





Harry Henriques
Ranch Hand

Joined: Jun 17, 2009
Posts: 206
[SOLVED]

Setup Eclipse and Tomcat to play nice together

This is nice to do, but not necessarily the solution to my problem.

CHANGE THE BUILD PATH IN ECLIPSE HELIOS

1. Right click on the Project and choose Properties

2. Choose Java Build Path in the Left Panel. Click the Source Tab in the Right Panel.

3. Change the Default Output Folder in the textbox at the bottom of the page: YourProjectName/WebContent/WEB-INF/classes

4. Click OK.

THIS IS WHAT SOLVED MY PROBLEM - Configure Tomcat 7

1. Open the Server View, if it's not displayed already, then Window -> Show View -> Other -> Server -> Servers

2. In Server View, right click on: Tomcat v7.0 at localhost [Stopped]

3. Choose Add and Remove ... from ListView

4. Choose the project that was created (i.e. HearingImpaired) from Available projects and ADD the project to Configured projects. Click OK.

5. Restart/Start Tomcat 7 container.

STEP 4 OF PART 2 DID THE TRICK !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem invoking a servlet directly from FireFox browser