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

Bug 353590

Summary: BundleException: Failed to create web application for bundle: Unable to locate Host
Product: [RT] Gemini.Web Reporter: Violeta Georgieva <milesg78>
Component: unknownAssignee: Violeta Georgieva <milesg78>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: glyn.normington
Version: unspecified   
Target Milestone: 2.1.0.M01   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Full exception log
none
test web application
none
Patch proposal glyn.normington: review+

Description Violeta Georgieva CLA 2011-08-02 10:16:38 EDT
Created attachment 200718 [details]
Full exception log

Following exception is thrown:


org.osgi.framework.BundleException: Failed to create web application for bundle 'war-with-servlet_0.0.0 [42]'
        at org.eclipse.gemini.web.internal.StandardWebContainer.createWebApplication(StandardWebContainer.java:64)
...
Caused by: java.lang.IllegalStateException: Unable to locate Host.
        at org.eclipse.gemini.web.tomcat.internal.OsgiAwareEmbeddedTomcat.findHost(OsgiAwareEmbeddedTomcat.java:152)
        at org.eclipse.gemini.web.tomcat.internal.OsgiAwareEmbeddedTomcat.getHost(OsgiAwareEmbeddedTomcat.java:124)
        at org.eclipse.gemini.web.tomcat.internal.OsgiAwareEmbeddedTomcat.addWebapp(OsgiAwareEmbeddedTomcat.java:223)




Scenario:
1. Start Gemini Web
2. Install the attached web application
3. Start the web application
4. Refresh the bundle "com.springsource.org.apache.catalina"
5. The exception is thrown.
6. Full exception log is attached
Comment 1 Violeta Georgieva CLA 2011-08-02 10:21:37 EDT
Created attachment 200719 [details]
test web application
Comment 2 Violeta Georgieva CLA 2011-08-02 10:35:49 EDT
Problem is reproducible on both versions 1.1.1.RELEASE and 2.0.0.RC1
Comment 3 Violeta Georgieva CLA 2011-10-05 05:17:21 EDT
Created attachment 204575 [details]
Patch proposal

Could you please review the patch.

There are three important changes:

1. org.eclipse.gemini.web.tomcat.internal.Activator, org.eclipse.gemini.web.internal.WebContainerActivator

* The 'URLConstants.URL_HANDLER_PROTOCOL' property for URLStreamHandlerService has to be String array instead of String.

2. org.eclipse.gemini.web.tomcat.internal.Activator

* ServletContainer service is unregistered first and then TomcatServletContainer is stopped.

3. org.eclipse.gemini.web.extender.ExtenderActivator

* BundleTracker is made NULL when WebContainer service is registered.
Comment 4 Violeta Georgieva CLA 2011-10-05 05:20:12 EDT
(In reply to comment #3)
> * BundleTracker is made NULL when WebContainer service is registered.

I meant "WebContainer service is UNregistered"
Comment 5 Glyn Normington CLA 2011-10-05 05:33:05 EDT
Comment on attachment 204575 [details]
Patch proposal

It's quite hard to see the changes because the code has been reformatted in places, but the 3 changes you describe sound correct.
Comment 6 Violeta Georgieva CLA 2011-10-05 08:41:27 EDT
Thanks

Change is committed, tested and pushed
Commit Id: fad904a0cd24483b5820b2012959ab1de0eb6c40