Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-02-2007, 02:13 PM
Member
 
Join Date: Jul 2007
Posts: 51
mary is on a distinguished road
404 Not Found
When I try to run the servlet the server return to me and exception
I created servlet "HelloWorld" and saved it under webapps>ROOT>utils>WEB-INF>classes.
I created the web.xml file to map it, and I saved it under webapps>ROOT>utils>WEB-INF.

when I click http://localhost:8080/utils/hello to run servlet, appears:
404 Not Found /utils/hello was not found on this server.

what's the problem?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-03-2007, 11:04 AM
Member
 
Join Date: Aug 2007
Posts: 47
henry_78 is on a distinguished road
Hi,
It could be your web.xml file. U have to do the right mapping between the page and the .class file.
Try to show us your web.xml please.
Bye.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-05-2007, 05:01 AM
Member
 
Join Date: Jul 2007
Posts: 51
mary is on a distinguished road
I created the web.xml file to map it, the web.xml look likes below and saved it under webapps>ROOT>utils>WEB-INF.
Code:
<web-app xmlns="http://sor.com/ns/resin"> <servlet servlet-name="hello" servlet-class="Hello"/> <servlet-mapping url-pattern="/hello" servlet-name="hello"/> </web-app>
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 11-05-2007, 08:12 PM
Member
 
Join Date: Nov 2007
Posts: 2
goodguy052 is on a distinguished road
take the utils directory from root and place it under webapps directory. so, now new path is tomcat>webapps>utlis>WEB-INF>
make new dir classes under WEB-INF and place the class Hello in classes.

make web.xml as follows and place it under WEB-INF:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet>
<servlet-name>hello</servlet-name>
<servlet-class>Hello</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>hello</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>

</web-app>

This will work

and type the following url in browsers address bar:
http://localhost:8080/utils/hello
to run servlet

Last edited by goodguy052 : 11-05-2007 at 08:14 PM. Reason: forgot to add some more info
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 11-06-2007, 09:30 PM
Member
 
Join Date: Nov 2007
Posts: 2
kavitanikam is on a distinguished road
better way u can use this structure
In webapps create MyApps in that create WEB-INF in this u can copy that web.xml file.
In WEB-INF create classes folder.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 11-07-2007, 11:15 AM
Member
 
Join Date: Nov 2007
Posts: 7
bar311 is on a distinguished road
since it is a servlet... i think the url should be http://localhost:8080/utils/servlet/hello
if you are using tomcat
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Class not found Exception surendra Java Servlet 4 01-11-2008 07:23 AM
could not be found in the registry alam99 Eclipse 0 01-08-2008 09:21 AM
ConnectException not found tamayo New To Java 1 07-23-2007 09:23 AM
Hibernate table not found orchid Database 2 05-06-2007 08:44 AM
struts No Collection Found orchid Web Frameworks 2 04-25-2007 08:56 PM


All times are GMT +3. The time now is 10:11 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org