Results 1 to 18 of 18
  1. #1
    DeViLHuNTeR is offline Member
    Join Date
    Mar 2011
    Posts
    9
    Rep Power
    0

    Default HTTP Status 404-The requested resource is not available.

    HTTP Status 404 - /s/

    type Status report

    message /s/

    description The requested resource (/s/) is not available.

    HTTP Status 404 - /host-manager/

    type Status report

    message /host-manager/

    description The requested resource (/host-manager/) is not available.


    This is where i got stuck..

  2. #2
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    I think If you won't explain about your task, nobody can't help you. Do you have any code?
    Skype: petrarsentev
    http://TrackStudio.com

  3. #3
    DeViLHuNTeR is offline Member
    Join Date
    Mar 2011
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by Petr View Post
    I think If you won't explain about your task, nobody can't help you. Do you have any code?
    Thnx for replying..



    heres code::


    AddEmpServlet::


    package com.servlets;

    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;

    public class AddEmpServlet extends HttpServlet
    {

    public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    {

    res.setContentType("text/html");
    PrintWriter out=res.getWriter();

    String uname=req.getParameter("uname");
    String pass=req.getParameter("pass");

    out.println("<html><body>");
    out.println("<center> Mysite </center>");
    out.println("<a href='addEmp?uname="+uname+"'>AddEmp</a><br/>");
    out.println("Welcome: "+uname);
    out.println("<center><forn action='addEmp'>");
    out.println("Emp No:<input type=text name=emp no/>");
    out.println("<input type=submit value=AddEmp/>");
    out.println("</form></body></html>");
    }
    };



    LoginServlet::



    package com.servlets;

    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;

    public class LoginServlet extends HttpServlet
    {
    public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException{
    String uname=req.getParameter("uname");
    String pass=req.getParameter("pass");

    System.out.println("uname" +uname);
    res.setContentType("text/html");

    PrintWriter out=res.getWriter();

    out.println("<html><body>");
    out.println("<center> Mysite </center>");
    out.println("<a href='addEmp?uname="+uname+"'>AddEmp</a><br/>");
    out.println("<a href='ViewEmp?uname="+uname+"'>ViewEmp</a>");
    out.println("Welcome: "+uname);
    out.println("</body></html>");
    }
    };


    xml::

    <web-app>
    <servlet>
    <servlet-name>LS</servlet-name>
    <servlet-class>com.servlets.LoginServlet</servlet-class>
    </servlet>

    <servlet>
    <servlet-name>AS</servlet-name>
    <servlet-class>com.servlets.AddEmpServlet</servlet-class>
    </servlet>

    <servlet-mapping>
    <servlet-name>LS</servlet-name>
    <url-pattern>/LoginServlet</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
    <servlet-name>AS</servlet-name>
    <url-pattern>/AddEmpServlet</url-pattern>
    </servlet-mapping>
    </web-app>


    One login.html File::

    Dir Structure::




    │ AddEmpServlet.java
    │ Login.html
    │ LoginServlet.java

    └───WEB-INF
    │ web.xml

    └───Classes
    └───com
    └───servlets
    AddEmpServlet.class
    LoginServlet.class


    Got error when tried to access "http://localhost:8080/B/login.html"
    Last edited by DeViLHuNTeR; 03-07-2011 at 06:16 PM.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,945
    Rep Power
    19

    Default

    You don't deply the java files for starters.

    Where is this being started?
    In Tomcat?

    Is the app called B?

  5. #5
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    Yeah Tolls pointed correct. What Is server do you use?
    if you use tomcat you need located all classes in webapp folder.
    Skype: petrarsentev
    http://TrackStudio.com

  6. #6
    DeViLHuNTeR is offline Member
    Join Date
    Mar 2011
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by Tolls View Post
    You don't deply the java files for starters.

    Where is this being started?
    In Tomcat?

    Is the app called B?
    Quote Originally Posted by Petr View Post
    Yeah Tolls pointed correct. What Is server do you use?
    if you use tomcat you need located all classes in webapp folder.
    Yep.. using tomcat & deployed B (current working root folder) accordingly

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,945
    Rep Power
    19

    Default

    And what happens when you go to localhost:8080/B
    ?

  8. #8
    DeViLHuNTeR is offline Member
    Join Date
    Mar 2011
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by Tolls View Post
    And what happens when you go to localhost:8080/B
    ?
    HTTP Status 404 -

    type Status report

    message

    description The requested resource () is not available.

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,945
    Rep Power
    19

    Default

    How are you starting Tomcat?
    What does your webapps folder look like?

  10. #10
    DeViLHuNTeR is offline Member
    Join Date
    Mar 2011
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by Tolls View Post
    How are you starting Tomcat?
    C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\tomcat6

    Server started

    & accessed app., as

    Start->allprgms->apachetomcat->manager->B(deployed folder)


    What does your webapps folder look like?

    C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\B>tree/f

    C:.
    │ AddEmpServlet.java
    │ Login.html
    │ LoginServlet.java

    └───WEB-INF
    │ web.xml

    └───Classes
    └com
    └──servlets
    AddEmpServlet.class
    LoginServlet.class

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,945
    Rep Power
    19

    Default

    I don't think I've ever started up Tomcat via the Program Files...I usually have tomcat stuck in its own directory, not installed as an app. I wonder if that could have something to do with it?

    The structure looks fine, though I still question why your Java files are in there. Not that that will prevent it from starting up properly.

    I'm afraid I'm at a loss.

  12. #12
    DeViLHuNTeR is offline Member
    Join Date
    Mar 2011
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by Tolls View Post
    I don't think I've ever started up Tomcat via the Program Files...I usually have tomcat stuck in its own directory, not installed as an app. I wonder if that could have something to do with it?

    The structure looks fine, though I still question why your Java files are in there. Not that that will prevent it from starting up properly.

    I'm afraid I'm at a loss.

    Hmm.. let me try ur way starting of server..

    & Doesn't matter much if source files are into my working dir, i guess...

  13. #13
    DeViLHuNTeR is offline Member
    Join Date
    Mar 2011
    Posts
    9
    Rep Power
    0

    Default

    Login.html is working but again error as


    HTTP Status 500 -

    type: Exception report

    message

    description: The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    javax.servlet.ServletException: Wrapper cannot find servlet class com.servlets.LoginServlet or a class it depends on
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:856)
    org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:744)
    org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
    org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80)
    org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
    java.lang.Thread.run(Unknown Source)
    root cause

    java.lang.ClassNotFoundException: com.servlets.LoginServlet
    org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1332)
    org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1181)
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:856)
    org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:744)
    org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
    org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80)
    org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
    java.lang.Thread.run(Unknown Source)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
    Last edited by DeViLHuNTeR; 03-10-2011 at 05:25 AM.

  14. #14
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,945
    Rep Power
    19

    Default

    That implies your webapp is missing that class file.
    Check package names, and class names, and ensure they match between your class structure and the values in your web.xml.

  15. #15
    DeViLHuNTeR is offline Member
    Join Date
    Mar 2011
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by Tolls View Post
    That implies your webapp is missing that class file.
    Check package names, and class names, and ensure they match between your class structure and the values in your web.xml.

    Ha.. i've checked, everythn's fine... bt still no output

  16. #16
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,945
    Rep Power
    19

    Default

    It'll be something like that.
    Since it can see the Login.html then the webapp is there.
    That means that LoginServlet is missing, or has a different name, or something like that.

    Since I have no access to your machine that's all I can say.

  17. #17
    DeViLHuNTeR is offline Member
    Join Date
    Mar 2011
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by Tolls View Post
    It'll be something like that.
    Since it can see the Login.html then the webapp is there.
    That means that LoginServlet is missing, or has a different name, or something like that.

    Since I have no access to your machine that's all I can say.
    k k.. i vl sort it out & thanks a lot buddy...

  18. #18
    vaibhavspawar is offline Member
    Join Date
    Jun 2010
    Posts
    17
    Rep Power
    0

    Default

    Dear DevilHunter,
    Do you have your 'classes' folder inside your 'WEB-INF' folder? Sorry, but I didn't get it from your structure. Cuz that's the actual structure required from where the '.class' files are accessed.

    All the best. :)

Similar Threads

  1. HTTP Status 500 -
    By gardiann in forum Java Servlet
    Replies: 2
    Last Post: 12-26-2010, 12:49 PM
  2. The requested resource () is not available. Error
    By shyameni in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 03-17-2010, 09:22 AM
  3. Replies: 7
    Last Post: 11-11-2009, 08:29 PM
  4. The requested resource is not available.
    By ravichandra.t in forum Java Servlet
    Replies: 0
    Last Post: 07-29-2009, 02:18 PM
  5. The requested resource (/Test.war/index.jsp) is not available.
    By rameshraj in forum JavaServer Faces (JSF)
    Replies: 1
    Last Post: 04-05-2009, 11:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •