Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » 404 error bug in Internal Web Browser
404 error bug in Internal Web Browser [message #218123] Thu, 24 July 2008 12:49 Go to next message
Eclipse User
Originally posted by: d.leader.bio.gla.ac.uk

This is a description of another - more annoying- bug I encountered using
Eclipse for Servlets. As in my last posting my configuration is as follows:

I'm using v. 3.4 of eclipsee-jee for Mac OS X, running under OS X 10.4 on
a PPC processor. I have Tomcat version 4.1 (from Server Logistics) running
on localhost, which I'm switching off before using as the virtual server.
I'm using JVM 1.5 - the Mac default.

The situation is that I set up a simple (or complex) servlet with an html
page in the WebContent directory at the same level as META-INF and WEB-INF
calling the servlet. (It's not relevant, but I use a relative path, so if
the project is called myProject and the servlet is mapped to a url of
myServlet, then the html page, start.html, will have a link <a
href="/myProject/myServlet">Execute</a>.)

OK, I set this up and get it working ok on the internal web browser, shut
everything down, go home, come back next day and try to run it again.
Typically (but not invariably) I get a 404 with the url
http://localhost:8080/myProject/start.html in the url entry field. Same
result copying and pasting into an external browser. Try
http://localhost:8080/myProject/ and nothing is listed.

At this stage I start kicking tyres and banging the engine: Rebuilding,
cleaning, removing the project from the virtual server (this seems
necessary but I'm not sure it's sufficient) and eventually
http://localhost:8080/myProject/ will list my start.html file. Click on it
and I get a 404 again (cache) but a reload clears and all is well.

This is time-wasting and infuriating as I don't know which kick does the
trick. Yesterday I got it on four consecutive servlets I'd previously set
up to demonstrate. Today the first one I checked was OK, but the second
showed this behaviour. It cleared after I removed the project from the
virtual server.

Anyone seen this before or can suggest a solution?

David
Re: 404 error bug in Internal Web Browser [message #218131 is a reply to message #218123] Thu, 24 July 2008 14:40 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
David Leader wrote:
> This is a description of another - more annoying- bug I encountered
> using Eclipse for Servlets. As in my last posting my configuration is as
> follows:
>
> I'm using v. 3.4 of eclipsee-jee for Mac OS X, running under OS X 10.4
> on a PPC processor. I have Tomcat version 4.1 (from Server Logistics)
> running on localhost, which I'm switching off before using as the
> virtual server. I'm using JVM 1.5 - the Mac default.
>
> The situation is that I set up a simple (or complex) servlet with an
> html page in the WebContent directory at the same level as META-INF and
> WEB-INF calling the servlet. (It's not relevant, but I use a relative
> path, so if the project is called myProject and the servlet is mapped to
> a url of myServlet, then the html page, start.html, will have a link <a
> href="/myProject/myServlet">Execute</a>.)
>
> OK, I set this up and get it working ok on the internal web browser,
> shut everything down, go home, come back next day and try to run it
> again. Typically (but not invariably) I get a 404 with the url
> http://localhost:8080/myProject/start.html in the url entry field. Same
> result copying and pasting into an external browser. Try
> http://localhost:8080/myProject/ and nothing is listed.
>
> At this stage I start kicking tyres and banging the engine: Rebuilding,
> cleaning, removing the project from the virtual server (this seems
> necessary but I'm not sure it's sufficient) and eventually
> http://localhost:8080/myProject/ will list my start.html file. Click on
> it and I get a 404 again (cache) but a reload clears and all is well.
>
> This is time-wasting and infuriating as I don't know which kick does the
> trick. Yesterday I got it on four consecutive servlets I'd previously
> set up to demonstrate. Today the first one I checked was OK, but the
> second showed this behaviour. It cleared after I removed the project
> from the virtual server.
>
> Anyone seen this before or can suggest a solution?
> David
>

Maybe a good first step would be to find out what is actually going to
and from the server. One way you can do this is to right-click on the
server in the Servers view and select Monitoring -> Monitor port 8080.
The next request to the server should open the TCP/IP Monitor view and
show the content of the request and the response. Be sure to use Run As
-> Run on Server to send the initial request. The URL will contain the
"monitoring" port being used to proxy the request to the server. For
Tomcat, you can also see the request and response data by uncommenting
the RequestDumperValve in server.xml found under the Servers project in
your workspace. The request and response data should appear in the
Console log. See if the expected requests are actually reaching the server.

Cheers,
Larry
Re: 404 error bug in Internal Web Browser [message #218218 is a reply to message #218131] Fri, 25 July 2008 14:59 Go to previous messageGo to next message
Eclipse User
Originally posted by: d.leader.bio.gla.ac.uk

Larry Isaacs wrote:

> Maybe a good first step would be to find out what is actually going to
> and from the server. One way you can do this is to right-click on the
> server in the Servers view and select Monitoring -> Monitor port 8080.
> The next request to the server should open the TCP/IP Monitor view and
> show the content of the request and the response. Be sure to use Run As
> -> Run on Server to send the initial request. The URL will contain the
> "monitoring" port being used to proxy the request to the server. For
> Tomcat, you can also see the request and response data by uncommenting
> the RequestDumperValve in server.xml found under the Servers project in
> your workspace. The request and response data should appear in the
> Console log. See if the expected requests are actually reaching the server.

Thanks. OK I followed all this and it seems that the request was
transmitted:

Request localhost:12596
Size: 0 (418) bytes
Header: GET /Greeting/HelloWorld.html HTTP/1.1

Response localhost:8080
Size: 740 (995) bytes
Header: HTTP/1.1 404 /Greeting/HelloWorld.html

Nothing on console except server startup.

Then I stopped the server, removed the project from it, reran
HelloWorld.html as Run on Server again and this time ok. Strangely nothing
on TCP/IP Monitor even though Monitoring still selected.

David
Re: 404 error bug in Internal Web Browser [message #218226 is a reply to message #218218] Fri, 25 July 2008 16:48 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
David Leader wrote:
> Larry Isaacs wrote:
>
>> Maybe a good first step would be to find out what is actually going to
>> and from the server. One way you can do this is to right-click on the
>> server in the Servers view and select Monitoring -> Monitor port
>> 8080. The next request to the server should open the TCP/IP Monitor
>> view and show the content of the request and the response. Be sure to
>> use Run As -> Run on Server to send the initial request. The URL will
>> contain the "monitoring" port being used to proxy the request to the
>> server. For Tomcat, you can also see the request and response data by
>> uncommenting the RequestDumperValve in server.xml found under the
>> Servers project in your workspace. The request and response data
>> should appear in the Console log. See if the expected requests are
>> actually reaching the server.
>
> Thanks. OK I followed all this and it seems that the request was
> transmitted:
>
> Request localhost:12596
> Size: 0 (418) bytes
> Header: GET /Greeting/HelloWorld.html HTTP/1.1
>
> Response localhost:8080
> Size: 740 (995) bytes
> Header: HTTP/1.1 404 /Greeting/HelloWorld.html
>
> Nothing on console except server startup.
>
> Then I stopped the server, removed the project from it, reran
> HelloWorld.html as Run on Server again and this time ok.

I would need to know a lot of details about the state of things at the
time to guess why this occurred. So I can't say if this represents a
problem or is expected behavior. An easy way to cause the later is to
start the server, then add the project to the server as part of Run on
Server. A server restart will be required before the project will be
served, so 404 is the expected response. This doesn't seem to be what
is happening here, but I don't have any alternate guesses at the moment.
We can take another look if it "breaks" again.

> Strangely
> nothing on TCP/IP Monitor even though Monitoring still selected.

Likely the port in the URL of the browser is showing 8080 instead of the
proxy port, which is why nothing appears in the TCP/IP Monitor view. I
tried it here and the same thing happened. I turned monitoring off and
restarted Eclipse and after turning monitoring back on the proxy port
started getting used again by Run on Server. It continued to work even
after subsequent restarts. I'm not sure what sequence of events leads
to the monitor's proxy port not being used by Run on Server when it should.

Cheers,
Larry

>
> David
>
>
>
>
>
Re: 404 error bug in Internal Web Browser [message #218254 is a reply to message #218226] Fri, 25 July 2008 21:11 Go to previous messageGo to next message
Eclipse User
Originally posted by: d.leader.bio.gla.ac.uk

Thanks Larry,

I guess this is just something to work round.

On a more positive note, I appreciate being able to run the servlets on
Eclipse. Although it's not the way I've been operating myself, our
Bioinformatics Masters students learn Java on it, so when they come to the
project part of their course it's helpful that they are able continue
using it. (The beauty of the Mac platform is that you can mimic a Solaris
or Linux installation with Tomcat running locally and your servlet
accessing local MySQL databases. Just avoid java 1.6.)

David
Re: 404 error bug in Internal Web Browser [message #218262 is a reply to message #218226] Fri, 25 July 2008 21:11 Go to previous message
Eclipse User
Originally posted by: d.leader.bio.gla.ac.uk

Thanks Larry,

I guess this is just something to work round.

On a more positive note, I appreciate being able to run the servlets on
Eclipse. Although it's not the way I've been operating myself, our
Bioinformatics Masters students learn Java on Eclipse, so when they come
to the project part of their course it's helpful that they are able
continue using it. (The beauty of the Mac platform is that you can mimic a
Solaris or Linux installation with Tomcat running locally and your servlet
accessing local MySQL databases. Just avoid java 1.6.)

David
Previous Topic:Problem in publishing with WST 3.0
Next Topic:el and jsp fragment validation
Goto Forum:
  


Current Time: Wed Sep 17 15:48:16 GMT 2014

Powered by FUDForum. Page generated in 0.03226 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software