Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Http Server 404

 
Komal Amaresh
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds as if you have not placed the servlet in a package. Do so.
 
Soumya Babu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Soumya Babu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
done with code tags...
 
Soumya Babu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
changing classname also did not work
 
Sandy Chatterjee
Ranch Hand
Posts: 55
Hibernate Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
 
Soumya Babu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still it did not work..:'(

I have made slight differences in the code..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic