Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331045

Summary: Deploying a Web Application Bundle without a web.xml in OSGi does not get picked up by the Jetty Extender
Product: [RT] Jetty Reporter: Chris Frost <eclipse>
Component: osgiAssignee: Hugues Malphettes <hmalphettes>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P2 CC: hmalphettes, janb, jetty-inbox, mgorovoy, renier
Version: 7.2.1   
Target Milestone: 7.1.x   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
A simple WAB
none
Slightly modified Test WAB from http://wiki.eclipse.org/Jetty/Tutorial/Jetty-OSGi_SDK none

Description Chris Frost CLA 2010-11-24 12:06:35 EST
Created attachment 183779 [details]
A simple WAB

I have attached a sample WAB that I used to create this problem. The WAB contains a single html file and a manifest with the 'Web-ContextPath' header set to '/simple'.

Deploying the WAB on normal Virgo works fine and the webpage is accessible at /simple. When deploying with Jetty as the RFC66 impl it appears from the log as though nothing happens so I'm guessing the OSGi extender isn't picking it up. This may be because it has no web.xml.
Comment 1 Renier Morales CLA 2010-12-05 09:59:38 EST
Created attachment 184555 [details]
Slightly modified Test WAB from http://wiki.eclipse.org/Jetty/Tutorial/Jetty-OSGi_SDK

I'm having the same problem with the Jetty 7.1.6 bundles from the helios updates site in Eclipse/Equinox 3.6.

I've included a slightly modified WAB based on the one at http://wiki.eclipse.org/Jetty/Tutorial/Jetty-OSGi_SDK. I change the url pattern for the servlet in the web.xml and add an index.html file for static content.

I also include the run configuration I use to launch this from within Eclipse 3.6 just in case.

The exact behaviour I'm getting with this is after launching the run configuration, there is nothing running on port 8080 and http://localhost:8080/test/servlet doesn't go anywhere, of course. Below is the output I get from the OSGi console.

osgi> No default jetty started.
Returning defaultJettyServer  = null
Returning defaultJettyServer  = null
ss

Framework is launched.

id	State       Bundle
0	ACTIVE      org.eclipse.osgi_3.6.1.R36x_v20100806
	            Fragments=33
1	ACTIVE      org.eclipse.jetty.server_7.1.6.v20100715
2	ACTIVE      org.eclipse.jetty.continuation_7.1.6.v20100715
3	ACTIVE      org.eclipse.jetty.util_7.1.6.v20100715
4	ACTIVE      org.eclipse.jetty.client_7.1.6.v20100715
5	ACTIVE      org.eclipse.jetty.servlet_7.1.6.v20100715
6	ACTIVE      org.eclipse.jetty.osgi.boot_7.1.6.v20100715
7	ACTIVE      org.eclipse.jetty.security_7.1.6.v20100715
8	ACTIVE      javax.servlet_2.5.0.v200910301333
9	ACTIVE      org.eclipse.jetty.webapp_7.1.6.v20100715
10	ACTIVE      org.eclipse.osgi.services_3.2.100.v20100503
11	ACTIVE      org.eclipse.jetty.example.webapp_1.0.0.qualifier
12	ACTIVE      org.eclipse.jetty.http_7.1.6.v20100715
13	ACTIVE      org.eclipse.jetty.xml_7.1.6.v20100715
14	ACTIVE      org.eclipse.jetty.io_7.1.6.v20100715
15	ACTIVE      org.eclipse.jetty.deploy_7.1.6.v20100715
16	ACTIVE      org.eclipse.jetty.servlets_7.1.6.v20100715
18	ACTIVE      org.eclipse.jetty.osgi.httpservice_7.1.6.v20100715
19	ACTIVE      org.eclipse.equinox.http.servlet_1.1.0.v20100503
23	ACTIVE      org.eclipse.jetty.osgi.boot.warurl_7.1.6.v20100715
26	ACTIVE      javax.activation_1.1.0.v201005080500
27	ACTIVE      org.eclipse.jetty.annotations_7.1.6.v20100715
28	ACTIVE      org.eclipse.jetty.jndi_7.1.6.v20100715
29	ACTIVE      org.eclipse.jetty.jmx_7.1.6.v20100715
30	ACTIVE      org.eclipse.jetty.rewrite_7.1.6.v20100715
31	ACTIVE      org.eclipse.jetty.websocket_7.1.6.v20100715
32	ACTIVE      javax.mail.glassfish_1.4.1.v201005082020
33	RESOLVED    javax.transaction_1.1.1.v201004190952
	            Master=0
34	ACTIVE      org.objectweb.asm_3.2.0.v200909071300
35	ACTIVE      org.eclipse.jetty.plus_7.1.6.v20100715
Comment 2 Hugues Malphettes CLA 2011-01-14 01:46:48 EST
(In reply to comment #1)
My apologies for the very late response:
the recent releases of jetty-osgi require a system property or an OSGi service be registered to start jetty.
The 2 ways to start jetty via system properties is to specify either one of:
-Djetty.home=/path/to/jettyhome
or
-Djetty.home.bundle=symbloic.name.of.bundle.with.jettyhome

This would explain the logs:
osgi> No default jetty started.
Returning defaultJettyServer  = null
Returning defaultJettyServer  = null

and the further consequence that nothing happens.
Comment 3 Hugues Malphettes CLA 2011-01-14 01:49:15 EST
(In reply to comment #0)
> Created attachment 183779 [details]
> A simple WAB
> 
> I have attached a sample WAB that I used to create this problem. The WAB
> contains a single html file and a manifest with the 'Web-ContextPath' header
> set to '/simple'.
> 
> Deploying the WAB on normal Virgo works fine and the webpage is accessible at
> /simple. When deploying with Jetty as the RFC66 impl it appears from the log as
> though nothing happens so I'm guessing the OSGi extender isn't picking it up.
> This may be because it has no web.xml.

Hi Chris,
I added support to deploy a WAB that does not have a web.xml but jetty does not pick it up. Well it does start the webapp and creates the WebappContext and all but never routes requests to the default servlet.

When I try to find out if webapps without web.xml are supported it seems that all the answers I get are pointing at servlet-3.0 to be able to do that.

I am asking the rest of the jetty team if they know better.
Comment 4 Chris Frost CLA 2011-01-14 05:14:10 EST
Hi,

Yeah I saw the post in jetty-dev. I didn't realise it wasn't in the 2.5 spec. I guess it's up to you guys unless it's in the 3.0 spec.

Thanks, Chris.
Comment 5 Hugues Malphettes CLA 2011-01-14 05:28:06 EST
(In reply to comment #4)
It seems that some features of jetty-8 (servlet-3.0) have been back-ported to jetty-7 (servlet-2.5).
I would not be surprised if this case is not supported with jetty-8 either and the same changes would be need in jetty-8 and jetty-7 to support it.
We will see what the core team answer ... although it is already the weekend in this part of the world.
Comment 6 Michael Gorovoy CLA 2011-01-24 16:55:29 EST
Assigning to Jan, question about servlet spec v3.0.
Comment 7 Hugues Malphettes CLA 2011-03-15 00:58:25 EDT
Jan, I have just verified that the attached WAB where there is no web.xml works fine in jetty-8 OSGi.
Comment 8 Jan Bartel CLA 2011-06-28 02:55:11 EDT
Hi Hugues,

I'm not sure what's going on here. Jetty-7 supports webapps that have no web.xml. I just tried simple.jar renamed to simple.war in the non-osgi jetty-7.4.2 distro and it works just fine...

Is there something in the jetty-7 osgi plumbing that is preventing this webapp bundle working????

Jan


(In reply to comment #7)
> Jan, I have just verified that the attached WAB where there is no web.xml works
> fine in jetty-8 OSGi.
Comment 9 Jan Bartel CLA 2012-05-03 08:30:59 EDT
Test jetty-7.6.3 and the simple WAB works fine. Either something has changed since the version of the initial report, or the initial report was not correct. Either way, this is working now, so I'm closing the issue.

Jan