httpRequest resource not available

Discussion in 'Java' started by slowlearner, Jun 18, 2008.

  1. slowlearner

    slowlearner Guest

    I'm making a http requset to a file movie.txt which is located in the
    same folder as Hangman.html. But I just get this error from the server


    :<Sun Java System Application Server 9.1_02 - Error report
    HTTP Status 404 - Status report
    message description
    The requested resource () is not available

    Is the problem with my code or should I be putting movie.txt in a
    different location?

    my code is

    HTTPRequest.asyncGet("movies.txt", new ResponseTextHandler() {

    public void onCompletion(String responseText) {
    if (responseText.indexOf("Error")>0)
    {
    // ***** returns the resource not found 404 error here *****
    status.setText("OnCompletion:"+responseText);
    return;
    }
    else
    {
    words = responseText.split("\n");

    }
    startGame();
    }

    the responseText always returns the 404 resource not found error.

    I've put the file in the same folder as my hangman.html
    I'm using netbeans 6.1 and gwt1.5
    the movies.txt is definitely there in the war file next to the
    hangman.html file.

    the hangman.html file looks like this

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta name='gwt:module'
    content='org.hangman.Main=org.hangman.Main'>
    <title>Hangman</title>
    <style>
    body,td,a,div,.p{font-family:arial,sans-serif}
    div,td{color:#000000}
    a:link,.w a:link{color:#0000cc}
    a:visited{color:#551a8b}
    a:active{color:#ff0000}
    </style>

    </head>
    <body>
    <script language="javascript" src="org.hangman.Main/
    org.hangman.Main.nocache.js"></script>
    <iframe src="javascript:''" id="__gwr_historyFrame"
    style="width:0;height:0;border:0"></iframe>
    <h1>Hangman</h1>
    <div id="hangman"></div>
    </body>
    </html>

    All help appreciated
    slowlearner, Jun 18, 2008
    #1
    1. Advertising

  2. slowlearner wrote:
    > I'm making a http requset to a file movie.txt which is located in the
    > same folder as Hangman.html. But I just get this error from the server
    >
    >
    > :<Sun Java System Application Server 9.1_02 - Error report
    > HTTP Status 404 - Status report
    > message description
    > The requested resource () is not available
    >
    > Is the problem with my code or should I be putting movie.txt in a
    > different location?
    >
    > my code is
    >
    > HTTPRequest.asyncGet("movies.txt", new ResponseTextHandler() {


    JavaScript is not at all the same as Java.

    However, you talk both about move.txt and moves.txt, which is it?

    --
    Roger Lindsjö
    Roger Lindsjö, Jun 18, 2008
    #2
    1. Advertising

  3. slowlearner

    slowlearner Guest

    On 18 Jun, 21:51, Roger Lindsjö <> wrote:
    > slowlearner wrote:
    > > I'm making a http requset to a file movie.txt which is located in the
    > > same folder as Hangman.html. But I just get this error from the server

    >
    > > :<Sun Java System Application Server 9.1_02 - Error report
    > > HTTP Status 404 - Status report
    > > message description
    > > The requested resource () is not available

    >
    > > Is the problem with my code or should I be putting movie.txt in a
    > > different location?

    >
    > > my code is

    >
    > >         HTTPRequest.asyncGet("movies.txt", new ResponseTextHandler() {

    >
    > JavaScript is not at all the same as Java.
    >
    > However, you talk both about move.txt and moves.txt, which is it?
    >
    > --
    > Roger Lindsjö- Hide quoted text -
    >
    > - Show quoted text -


    It's movies.txt . Both in the Java and the actual file on the server
    match. It's just not seeing it for some reason. My guess is it's
    looking somewhere else for it but I cant figure out where. I've tried
    placing movies.txt in every folder on the site but it still doesn't
    find it.

    Thanks for the suggestion though. I have a wireless keyboard and pad
    which does sometimes miss keystrokes. So for a moment I thought you
    might have solved the mystery. Thanks for trying

    m.cranna
    slowlearner, Jun 18, 2008
    #3
  4. slowlearner

    Arne Vajhøj Guest

    Roger Lindsjö wrote:
    > slowlearner wrote:
    >> I'm making a http requset to a file movie.txt which is located in the
    >> same folder as Hangman.html. But I just get this error from the server
    >>
    >> :<Sun Java System Application Server 9.1_02 - Error report
    >> HTTP Status 404 - Status report
    >> message description
    >> The requested resource () is not available
    >>
    >> Is the problem with my code or should I be putting movie.txt in a
    >> different location?
    >>
    >> my code is
    >>
    >> HTTPRequest.asyncGet("movies.txt", new ResponseTextHandler() {

    >
    > JavaScript is not at all the same as Java.


    True.

    But since the code above is Java, then what is the point ?

    Arne
    Arne Vajhøj, Jun 19, 2008
    #4
  5. On Jun 18, 8:16 pm, Arne Vajhøj <> wrote:
    > Roger Lindsj� wrote:
    > > slowlearner wrote:
    > >> I'm making a http requset to a file movie.txt which is located in the
    > >> same folder as Hangman.html. But I just get this error from the server

    >
    > >> :<Sun Java System Application Server 9.1_02 - Error report
    > >> HTTP Status 404 - Status report
    > >> message description
    > >> The requested resource () is not available

    >
    > >> Is the problem with my code or should I be putting movie.txt in a
    > >> different location?

    >
    > >> my code is

    >
    > >>         HTTPRequest.asyncGet("movies.txt", new ResponseTextHandler() {

    >
    > > JavaScript is not at all the same as Java.

    >
    > True.
    >
    > But since the code above is Java, then what is the point ?
    >
    > Arne


    Hooray for Google Web Toolkit!

    Guy: You got your Java in my Javascript!

    Girl: You got your Javascript in my Java!

    Both: Wow! This tastes like *ass*!

    -fin-
    Owen Jacobson, Jun 19, 2008
    #5
  6. slowlearner

    slowlearner Guest

    On 19 Jun, 01:17, Owen Jacobson <> wrote:
    > On Jun 18, 8:16 pm, Arne Vajhøj <> wrote:
    >
    >
    >
    >
    >
    > > Roger Lindsj� wrote:
    > > > slowlearner wrote:
    > > >> I'm making a http requset to a file movie.txt which is located in the
    > > >> same folder as Hangman.html. But I just get this error from the server

    >
    > > >> :<Sun Java System Application Server 9.1_02 - Error report
    > > >> HTTP Status 404 - Status report
    > > >> message description
    > > >> The requested resource () is not available

    >
    > > >> Is the problem with my code or should I be putting movie.txt in a
    > > >> different location?

    >
    > > >> my code is

    >
    > > >>         HTTPRequest.asyncGet("movies.txt", new ResponseTextHandler() {

    >
    > > > JavaScript is not at all the same as Java.

    >
    > > True.

    >
    > > But since the code above is Java, then what is the point ?

    >
    > > Arne

    >
    > Hooray for Google Web Toolkit!
    >
    > Guy: You got your Java in my Javascript!
    >
    > Girl: You got your Javascript in my Java!
    >
    > Both: Wow!  This tastes like *ass*!
    >
    > -fin-- Hide quoted text -
    >
    > - Show quoted text -


    I'm surprised to see none of you can answer this simple question.
    slowlearner, Jun 19, 2008
    #6
  7. On Jun 19, 7:38 pm, Lew <> wrote:
    > slowlearner wrote:
    > > I'm surprised to see none of you can answer this simple question.

    >
    > If it's so simple, why are you asking?


    "What is the meaning of life?" is another simple
    question. It's the answer, that is hard.

    It always astounds me when someone who does not
    know the answer to a question has the temerity to
    presume the answer is simple.

    What are they basing that presumption on?

    --
    Andrew Thompson
    http://pscode.org/
    Andrew Thompson, Jun 19, 2008
    #7
  8. slowlearner wrote:

    > I'm surprised to see none of you can answer this simple question.


    The point is, your question is about the use of the Google Web Toolkit
    (GWT). I expect you would be better off asking in some GWT support forum.

    I suspect your webserver logs will tell you the path of the object being
    requested and from knowledge of this plus the docroot setting in the
    webserver config you should be able to work out what pathname
    corresponds to the current location of the object, or, where to move the
    object so that it is in the place referred to in the webserver error log.

    Clear as mud?

    --
    RGB
    RedGrittyBrick, Jun 19, 2008
    #8
  9. slowlearner wrote:
    > I'm making a http requset to a file movie.txt which is located in the
    > same folder as Hangman.html. But I just get this error from the server
    >
    > [...]
    >
    > my code is
    >
    > HTTPRequest.asyncGet("movies.txt", new ResponseTextHandler() {
    >


    Here's a quote:

    "New users frequently notice the com.google.gwt.user.client.HTTPRequest
    class, and attempt to use it. However, that particular class is intended
    primarily for use by GWT's internal RPC implementation, and is not a
    very friendly interface for developers to use on their own. In fact,
    the HTTPRequest class may go away in a future release of GWT."

    http://code.google.com/support/bin/answer.py?answer=55194&topic=10210


    I think you need help from a GWT support forum.

    --
    RGB
    RedGrittyBrick, Jun 19, 2008
    #9
  10. slowlearner

    slowlearner Guest

    On 19 Jun, 11:43, RedGrittyBrick <> wrote:
    > slowlearner wrote:
    > > I'm making a http requset to a file movie.txt which is located in the
    > > same folder as Hangman.html. But I just get this error from the server

    >
    > > [...]

    >
    > > my code is

    >
    > >         HTTPRequest.asyncGet("movies.txt", new ResponseTextHandler() {

    >
    > Here's a quote:
    >
    > "New users frequently notice the com.google.gwt.user.client.HTTPRequest
    > class, and attempt to use it. However, that particular class is intended
    > primarily for use by GWT's internal RPC implementation, and is not a
    > very friendly interface for developers to use on their own.  In fact,
    > the HTTPRequest class may go away in a future release of GWT."
    >
    > http://code.google.com/support/bin/answer.py?answer=55194&topic=10210
    >
    > I think you need help from a GWT support forum.
    >
    > --
    > RGB


    Thanks for your help everybody.

    I didn't mean you were all simple I was just in a hurry this morning
    & worded it badly. I just thought since it's my first attempt at gwt
    or web design then it stood to reason my question was simple, to
    assume it was advanced would have been big headed.
    If theres one thing that does not describe me that would it. Look at
    my Google name(slowlearner), I always assume my problems are simple
    compared to everybody else's. I did not mean you were simple. Sorry
    for the miss-understanding.

    m.cranna
    slowlearner, Jun 19, 2008
    #10
  11. slowlearner

    slowlearner Guest

    > It always astounds me when someone who does not
    > know the answer to a question has the temerity to
    > presume the answer is simple.
    >
    > What are they basing that presumption on?


    I'm basing the presumsion my question is simple on the fact I had a
    childhood Brain injury(1978) which up until about 2 years ago left me
    with no hope of installing the Java JRE let alone writting code for
    it. So Yes I assumed my question would be simple as I'm not exactly
    firing on all cylinders. Sorry to have offended you!
    slowlearner, Jun 19, 2008
    #11
  12. slowlearner

    slowlearner Guest

    On 19 Jun, 10:38, Lew <> wrote:
    > slowlearner wrote:
    > > I'm surprised to see none of you can answer this simple question.

    >
    > If it's so simple, why are you asking?
    >
    > --
    > Lew


    No offense was mean't by this. I had thought the previous respondents
    where playing around and so I just mean't to appeal to your ego's to
    try and get an answer.

    I didn't intend to imply you were all simple. It was just a rushed
    response badly worded. I expect I'll be writting apologies for days
    now, but truely I didn't mean to insult you all !

    m.cranna

    I've replied to all those I caused offence to now. Please anyone else
    reading this thread do not take offence at previous post.

    It was just badly worded. I've called myself slowlearner for a reason.
    slowlearner, Jun 19, 2008
    #12
  13. slowlearner wrote:
    > I didn't mean you were all simple I was just in a hurry this morning
    > & worded it badly. I just thought since it's my first attempt at gwt
    > or web design then it stood to reason my question was simple, to
    > assume it was advanced would have been big headed.
    > If theres one thing that does not describe me that would it. Look at
    > my Google name(slowlearner), I always assume my problems are simple
    > compared to everybody else's. I did not mean you were simple. Sorry
    > for the miss-understanding.


    I doubt anyone took it as personal insult, they just pointed out that a
    problem that looks simple could very well have very complicated solutions.

    But back to the original question, if you use Firefox with the
    LiveHTTPHeaders plugin then you could probably see the exact request
    made by the browser. Or, if you have access to the server logs you could
    look in those (as pointed out earlier by RedGrittyBrick).

    --
    Roger Lindsjö
    Roger Lindsjö, Jun 21, 2008
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Natty Gur
    Replies:
    0
    Views:
    2,569
    Natty Gur
    Jun 6, 2004
  2. =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?=
    Replies:
    0
    Views:
    2,382
    =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?=
    Jun 7, 2004
  3. Sam
    Replies:
    3
    Views:
    11,270
  4. Computer_Engineer

    j2ee request resource is not available hello1

    Computer_Engineer, Jul 24, 2004, in forum: Java
    Replies:
    0
    Views:
    366
    Computer_Engineer
    Jul 24, 2004
  5. Robert Mark Bram
    Replies:
    1
    Views:
    2,130
Loading...

Share This Page