wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Request Resource not available. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Request Resource not available." Watch "Request Resource not available." New topic
Author

Request Resource not available.

Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
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.

The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1700
    
  25

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

Joined: Nov 05, 2007
Posts: 661
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
Bartender

Joined: Apr 07, 2010
Posts: 1700
    
  25

is the web.xml under the WEB-INF directory?
Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
Yes it is .
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1700
    
  25

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

    Joined: Nov 05, 2007
    Posts: 661
    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
    Bartender

    Joined: Apr 07, 2010
    Posts: 1700
        
      25

    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
    Bartender

    Joined: Apr 07, 2010
    Posts: 1700
        
      25

    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

    Joined: Jul 13, 2010
    Posts: 610

    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!


    OCP Java SE 6 Programmer, OCM Java SE 6 Developer, OCE Java EE 6 JSPSD, OCE Java EE 6 EJBD, OCE Java EE 6 JPAD, Spring 3.0 Core Professional.
    Nabila Mohammad
    Ranch Hand

    Joined: Nov 05, 2007
    Posts: 661


    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
    Bartender

    Joined: Apr 07, 2010
    Posts: 1700
        
      25

    "jar cvf0 ch1.war"

    should be "jar cvf0 ch1.war ."
    Nabila Mohammad
    Ranch Hand

    Joined: Nov 05, 2007
    Posts: 661
    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

    Joined: Jul 13, 2010
    Posts: 610

    Glad it worked!
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Request Resource not available.