httpRequest resource not available

S

slowlearner

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
 
R

Roger Lindsjö

slowlearner said:
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?
 
S

slowlearner

JavaScript is not at all the same as Java.

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

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
 
O

Owen Jacobson

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-
 
S

slowlearner

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.
 
A

Andrew Thompson

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?
 
R

RedGrittyBrick

slowlearner said:
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?
 
R

RedGrittyBrick

slowlearner said:
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.
 
S

slowlearner

slowlearner said:
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.

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
 
S

slowlearner

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!
 
S

slowlearner

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

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.
 
R

Roger Lindsjö

slowlearner said:
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).
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top