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

Bug 421863

Summary: [releng] Wars created by maven build don't work
Product: [RT] RAP Reporter: Ralf Sternberg <rsternberg>
Component: RelengAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ivan, mknauer
Version: 2.2   
Target Milestone: 2.2 RC1   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Fix list of osgi.bundles in config.ini rsternberg: review+, ivan: review+

Description Ralf Sternberg CLA 2013-11-15 15:06:49 EST
The war files created by org.eclipse.rap.examples.build do not work. A lot of bundles can't start because of a missing dependencies to javax.servlet. So it seems that the servletbridge.extensionbundle (which is supposed to export javax.servlet) is not started.

Tried with Tomcat 7.
Comment 1 Ivan Furnadjiev CLA 2013-11-18 02:14:57 EST
This issue has been discussed several months ago - http://www.eclipse.org/forums/index.php/m/1071044/?srch=Maven#msg_1071044. The generated config.ini is missing the extensionbundle bundle - osgi.framework.extensions property is empty. If I remember correctly Markus had similar fix outlined here:
http://www.eclipse.org/forums/index.php/mv/msg/489963/1073241/#msg_1073241
Comment 2 Markus Knauer CLA 2013-11-21 12:21:33 EST
Fixed in master with commit 6f8516035f52f57f86e14779916fc126bb1f4c79

The change removes the simpleconfigurator which uses bundles.info to specify the list of bundles that need to be started. With the simpleconfigurator bundle removed the build falls back to list all required bundles in the config.ini.

In order to start the virtual org.eclipse.equinox.servletbridge.extensionbundle I added a small search&replace step to the Maven build that adds the required definition to the config.ini.

The removal simplifies the build, leads to a smaller .war file, and best of all: It creates .war files that work.
Comment 3 Ralf Sternberg CLA 2013-12-04 06:13:58 EST
The org.eclipse.equinox.servletbridge.extensionbundle is a fragment and cannot be started. Thus, the definition currently added to the config.ini

    org.eclipse.equinox.servletbridge.extensionbundle@4:start

leads to an exception at startup (see below). The "@4:start" should be removed. Moreover, the expression

    reference\:file\:javax.servlet_3.0.0.v201112011016.jar@4

should not be there.

    org.osgi.framework.BundleException: A fragment bundle cannot be started: org.eclipse.equinox.servletbridge.extensionbundle_1.3.0 [1]
        at org.eclipse.osgi.framework.internal.core.BundleFragment.startWorker(BundleFragment.java:224)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
        ...
Comment 4 Markus Knauer CLA 2013-12-04 09:03:32 EST
Created attachment 238006 [details]
Fix list of osgi.bundles in config.ini

This patch introduces a new regular expression that removes the javax.servlet entry from the list of bundles in the config.ini.

Additionally it doesn't add start parameters to the config.ini for the org.eclipse.equinox.servletbridge.extensionbundle fragment.
Comment 5 Ralf Sternberg CLA 2013-12-04 09:13:14 EST
Comment on attachment 238006 [details]
Fix list of osgi.bundles in config.ini

+1 for 2.2.
With this patch, the exported bundles work, no exceptions logged anymore
Comment 6 Markus Knauer CLA 2013-12-04 09:23:58 EST
Push to master with commit 74f557876dd5e52d3668e5ceabc7a68471e33424
Closing bug as fixed.
Comment 7 Ivan Furnadjiev CLA 2013-12-04 09:24:45 EST
Comment on attachment 238006 [details]
Fix list of osgi.bundles in config.ini

+1 for including it in 2.2RC2