Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320043 - Cannot list directory contents of a static web project
Summary: Cannot list directory contents of a static web project
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: osgi (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 7.1.x   Edit
Assignee: Jan Bartel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 378492 378493
Blocks:
  Show dependency tree
 
Reported: 2010-07-15 17:14 EDT by Prasad Kashyap CLA
Modified: 2012-07-30 00:13 EDT (History)
6 users (show)

See Also:


Attachments
jetty-7 version of the class (14.26 KB, text/plain)
2010-09-28 00:52 EDT, Jan Bartel CLA
no flags Details
Error displayed when the server is starting (Eclipse 4.2) (32.93 KB, image/jpeg)
2012-05-03 11:37 EDT, Pablo Esparza CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Prasad Kashyap CLA 2010-07-15 17:14:57 EDT
Build Identifier: 

The J2EE server in Eclipse is actually built off of Jetty. When a Static Web Project is deployed on it, it cannot list the contents of the project's directory. It shows HTTP Error 403. Forbidden.

Now deploy a Dynamic Web Project on the same Jetty server. The server can show the directory listing of this project.

The problem is in the Jetty plugin for Eclipse.
org.mortbay.jetty.handler.ResourceHandler class handles SWP.
The handle() checks if the resource is a directory.
If it is, it tries to serve the welcome file index.html.
If the welcome file(s) are missing, then it sends Error 403.

Reproducible: Always

Steps to Reproduce:
1. Create a J2EE Server in Eclipse 3.6
2. Create a Static Web Project (call it say, "swp")
3. Create an HTML file. DO NOT name it index.html
4. Deploy the project to the server.
5. Access the app using the URL http://localhost:8080/swp

You will see an error 403.
Comment 1 Greg Wilkins CLA 2010-07-15 17:49:51 EDT
This sounds like the dirAllowed initParameter of the defaultweb.xml file is set to false.
Comment 2 Prasad Kashyap CLA 2010-07-16 09:32:58 EDT
Actually it is set to true which is why the directory listing of Dynamic Web Projects is allowed.
Comment 3 Billy Rowe CLA 2010-09-27 23:30:07 EDT
What's the outlook for this bugzilla. Any chance we could get it in 2010?
Comment 4 Jan Bartel CLA 2010-09-28 00:52:16 EDT
Created attachment 179707 [details]
jetty-7 version of the class
Comment 5 Jan Bartel CLA 2010-09-28 00:54:41 EDT
Prasad, Billy, 

Jetty-6 is not under active development any longer - just security fixes mostly - so is it possible for the J2EE server project to upgrade to jetty-7?

Failing that, I suggest it might be quicker to create the project's own ResourceHandler based off the jetty-7 version. It should be about a dozen lines
to do the configuration and directly serving. 

I'm attaching a copy of the jetty-7 ResourceHandler.java for info.

regards
Jan
Comment 6 Greg Wilkins CLA 2011-01-10 10:51:53 EST
Jesse,

can you look at this one. thanks
Comment 7 Jesse McConnell CLA 2011-01-10 11:16:20 EST
As far as I know we have jetty7 HttpService being provided now...I'll check with Hugues but I had thought it was the default now.
Comment 8 Jesse McConnell CLA 2011-01-10 13:16:50 EST
seems we might be waiting on this issue?

https://bugs.eclipse.org/bugs/show_bug.cgi?id=309529

I suspect there is a small cluster of issues here that are either resolved or very close to being resolves once we take a bit of a looksee
Comment 9 Jesse McConnell CLA 2011-06-09 18:19:35 EDT
1.6 has been released
Comment 10 Jesse McConnell CLA 2011-06-09 18:20:32 EDT
doh, closed the wrong one
Comment 11 Jan Bartel CLA 2012-05-02 11:08:11 EDT
Prasad,

As Equinox has updated to jetty-8, (see closed bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=309529), can you retest and let us know if this issue is resolved?

thanks
Jan
Comment 12 Jesse McConnell CLA 2012-05-02 15:14:19 EDT
they are on 8.1.3 for juno as well
Comment 13 Pablo Esparza CLA 2012-05-03 11:37:27 EDT
Created attachment 215012 [details]
Error displayed when the server is starting (Eclipse 4.2)
Comment 14 Pablo Esparza CLA 2012-05-03 11:38:49 EDT
Hi all,

I've verified this defect and these are the results:

Using Eclipse JEE Indigo 3.7: When I performed the last step I got a 404 Error... So, I guess this is the expected behavior. 

However...

Using Eclipse JEE Juno 4.2: When I tried to start the server the following error was displayed.
"Could not find required bundle org.mortbay.jetty.server"

I'm attaching an screenshot of the error. 

Thanks!
Comment 15 Jesse McConnell CLA 2012-05-03 12:16:10 EDT
juno doesn't use org.mortbay.jetty.server

it should be something like org.eclipse.jetty.server I think
Comment 16 Pablo Esparza CLA 2012-05-03 12:28:21 EDT
That's correct, org.eclipse.jetty.server plugin is in the installation directory.

But the questions is: Why Eclipse is trying to get org.mortbay.jetty.server instead of org.eclipse.jetty.server? This should be a defect, right?? do you know if there is an open defect for this error?

Thanks Jesse for the quick response.
Comment 17 Jan Bartel CLA 2012-05-03 13:04:42 EDT
Hi Pablo,

I have seen the same problem with using Juno. I am talking to some of the Equinox guys to work out on which Eclipse component we need to raise this bug. I'll update this bug when I hear back from them.

thanks
Jan
Comment 18 Jan Bartel CLA 2012-05-04 09:28:44 EDT
I created some bugs for this on the WTP project:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=378492
https://bugs.eclipse.org/bugs/show_bug.cgi?id=378493

Jan
Comment 19 Jan Bartel CLA 2012-07-30 00:13:07 EDT
Closing this bug as the related bugs on the wtp project (see comment #18) have been marked as fixed.