• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Http Server 404

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds as if you have not placed the servlet in a package. Do so.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?



 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
done with code tags...
 
Soumya Babu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
changing classname also did not work
 
Ranch Hand
Posts: 55
Mac Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Still it did not work..:'(

I have made slight differences in the code..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic