This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Request Resource not available.

 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am tryin the first project in hfsj.

My Java & web.xml file is






The error I am getting in the log file is



This is what i am typing in the browser
http://localhost:8080/ch1/Serv1


I have tried changing the encoding to ISO-8851-1,but hasn't worked.
Any idea what else i can try ?

Thanks!

Not sure what I am missing...

Thanks.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2337
87
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mohammad,

How does your directory structure look like? What version of tomcat are you using?

Some general remarks that do not necessarily have to solve your problem:
- Use a package structure for your java files (you are using the default package)
- Close the <html>-tag with </html>

Regards,
Frits
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for responding.

I am using Tomcat 5.5.
My deployment directory structure is

C:/Program Files(x86) /Apache Software Foundation/Tomcat 5.5/webapps/ch1/WEB-INF/classes/Ch1Servlet.class
|
|------web.xml



 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2337
87
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is the web.xml under the WEB-INF directory?
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it is .
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2337
87
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, I don't see any obvious mistake.

Let us try to create a war file by following the next instructions (from the David Bridgewater book):

From a command window:
  • Set the classpath to include the servlet.jar of tomcat:

  • set classpath=.;C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar

  • Compile your Servlet:

  • javac webcert\ch03\ex0304\MicroPaymentServlet.java -d ..\classes

  • Create a war file:

  • jar cvf0 ex0304.war .

  • Copy the war file to tomcat webapps folder:

  • copy ex0304.war C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\

  • Start tomcat

  • C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\tomcat5.exe


    Regards,
    Frits
     
    Nabila Mohammad
    Ranch Hand
    Posts: 664
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Sorry for the delay in response. Got a little busy.

    I am trying to create a WAR File , but i guess i am doing something wrong. it keeps telling me "it requires manifest or input files to specified" . Do i have to create a MANIFEST file? If so , how do i do it.
    Tried researching over it but didn't really understand it
     
    Frits Walraven
    Creator of Enthuware JWS+ V6
    Saloon Keeper
    Pie
    Posts: 2337
    87
    Android Chrome Eclipse IDE
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Try to follow the document I posted in this thread: HowToCreateWebApplicationWithoutAnIDE

    If you get stuck, tell me where the problem is

    Regards,
    Frits
     
    Frits Walraven
    Creator of Enthuware JWS+ V6
    Saloon Keeper
    Pie
    Posts: 2337
    87
    Android Chrome Eclipse IDE
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    it keeps telling me "it requires manifest or input files to specified" . Do i have to create a MANIFEST file? If so , how do i do it.

    ok, I see what the problem is, did you miss the "." in jar cvf0 ex0304.war .
    The jar command expects a directory

    Regards,
    Frits
     
    Piotr Nowicki
    Ranch Hand
    Posts: 611
    1
    IntelliJ IDE Java Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Guys!

    By the way - there is a <url-pattern> element and not <servlet-pattern> which you used in the first post.

    Or maybe it's some really old stuff? :-)

    Cheers!
     
    Nabila Mohammad
    Ranch Hand
    Posts: 664
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator


    SO my directory structure is ;

    C:/Program Files(x86) /Apache Software Foundation/Tomcat 5.5/webapps/ch1/WEB-INF/classes/Ch1Servlet.class
    |
    |------web.xml
    (web.xml file is in the webapps folder)


    I am using "jar cvf0 ch1.war" at the command prompt from with in the webapps folder s well as ch1 folder.
    I am getting the same error in both


     
    Frits Walraven
    Creator of Enthuware JWS+ V6
    Saloon Keeper
    Pie
    Posts: 2337
    87
    Android Chrome Eclipse IDE
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    "jar cvf0 ch1.war"

    should be "jar cvf0 ch1.war ."
     
    Nabila Mohammad
    Ranch Hand
    Posts: 664
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks Pedro for pointing out that mistake . It's finally working !

    Thanks Frits for all your help and sticking by.

    Take care!



     
    Piotr Nowicki
    Ranch Hand
    Posts: 611
    1
    IntelliJ IDE Java Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Glad it worked!
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic