This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Http Server 404 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Http Server 404" Watch "Http Server 404" New topic
Author

Http Server 404

Komal Amaresh
Ranch Hand

Joined: Oct 06, 2008
Posts: 67
Hi

I've been trying to run a simple servlet for 2 days but couldn't neither in the eclipse ide nor through the command prompt by creating a war file.
Its been a year since i have touched java, and now at this stage i feel despicable.
the servlet is getting compiled as i set the classpath on the command prompt making servlet-api.jar availabe. I'am creating the WEB-INF folder inside which i placed the web.xml and classes folder. Inside the classes folder i'am placing the class file. All these inside a folder named project1. finally creating the war file using the path
jar -cvf one.war project1
.
I'm placing the war file in the webapps folder of tomcat5.5 which im using.
Im able to start tomcat properly on the command prompt. my project is being displayed in the apps of the tomcat mager page. once i click it it displays
Http error 404
The requested resource is not available


I just am not able to resolve it.

please help me.

thanks and regards
komal
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

It sounds as if you have not placed the servlet in a package. Do so.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Soumya Babu
Greenhorn

Joined: Jun 29, 2012
Posts: 5
i am facing the same prob

Login.jsp






Welcome.jsp





LoginAction.java



web.xml



struts.xml



ApplicationResources.properties





When i click submit i am getting The requested resource () is not available.whT MIGHT BE the possible reasons?



Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Soumya Babu wrote: <servlet-class>org.poc/HelloWorld.java</servlet-class>

That's not a proper class name. Class names consist of the package name followed by a dot and the simple class name; .java is not part of it. In your case, the class name is org.poc.HelloWorld.

And can you please UseCodeTags next time?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Soumya Babu
Greenhorn

Joined: Jun 29, 2012
Posts: 5
done with code tags...
Soumya Babu
Greenhorn

Joined: Jun 29, 2012
Posts: 5
changing classname also did not work
Sandy Chatterjee
Ranch Hand

Joined: Jun 27, 2012
Posts: 55

<package name="org.poc" extends="struts-default">


Change it to a singe package( From 'org.poc' to 'poc').
From
<package name="org.poc" extends="struts-default">
to

and from
<servlet-class>org.poc/HelloWorld.java</servlet-class>

to


Take up one idea. Make that one idea your life; dream of it; think of it; live on that idea. Let the brain, the body, muscles, nerves, every part of your body be full of that idea, and just leave every other idea alone. This is the way to success.
Soumya Babu
Greenhorn

Joined: Jun 29, 2012
Posts: 5
Still it did not work..:'(

I have made slight differences in the code..
 
 
subject: Http Server 404
 
Similar Threads
Using a different context directory than the default webapps in Tomcat 5
Cannot get Servlets Demystified Problem
Tomcat 5.0.28 won't play with my servlet =(
Not able to run servlet-HTTP status404
Problem In Deploying servlets in JBoss4.2.2GA