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

Bug 393754

Summary: Unable to simultaneously register applications by branding and ApplicationConfigurations
Product: [RT] RAP Reporter: Timo Rohrberg <timo.rohrberg>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Demo projects to reproduce the problem. none

Description Timo Rohrberg CLA 2012-11-07 05:45:33 EST
Created attachment 223289 [details]
Demo projects to reproduce the problem.

Hello everybody,

first of all, this bug seems to be related to bugs 377414, 372114, and 360481. I still preferred to open another bug report since I have a very particular use case for which I also created corresponding demo projects (see attachment).

We are developing a single-sourcing RCP/RAP application with a lot of common bundles and some RCP- vs. RAP-specific bundles and fragments. The main application uses the Eclipse workbench. Additionally, we would like to provide a simplified user interface via a RWT standalone application tailored for web browsers, as well as another RWT standalone application tailored for Tabris clients. Thus, we have three RAP applications with individual entrypoints:

- One entrypoint for the workbench-based application.
- One entrypoint for the RWT standalone application tailored for web browsers.
- One entrypoint for the RWT standalone application tailored for Tabris clients.

The first entrypoint is defined declaratively in the org.example.rap.entrypointdemo.workbench bundle by extensions to the org.eclipse.rap.ui.entrypoint and org.eclipse.rap.ui.branding extension points.

The second and third entrypoints are defined in the org.example.rap.entrypointdemo.standalone and org.example.rap.entrypointdemo.tabris bundles respectively by registering ApplicationConfiguration instances via declarative services.

When launching the application with all three bundles activated, a NamespaceException is thrown indicating that the alias "/index.json" is already in use. This seems weired since two different context paths have been configured when registering the respective ApplicationConfiguration instances as explained in the RAP developers guide.

However, when launching the application with the workbench-based entrypoint and only one of the RWT standalone entrypoints (e.g. only the bundles org.example.rap.entrypointdemo.workbench and org.example.rap.entrypointdemo.standalone activated), one can either access the workbench-based application XOR the RWT standalone one. After one of them has been launched, the other one cannot be loaded anymore as the entrypoint is not found.

Debugging into the RWT source code, shows that (apart from all the others provided by whatever brandings) a RWTServlet instance is created only for the workbench-based entrypoint with the alias "demoworkbench" specified in the org.eclipse.rap.ui.branding extension.

The branding is registered via the BrandingManager.register() method.

The individual entrypoints are registered via the EntryPointManager.doRegisterByPath() and EntryPointManager.doRegisterByName() methods, whereas the workbench-based entrypoint is registered in another instance of EntryPointManager than the one for the RWT standalone application.

When servicing an incoming request, the framework however accesses the correct BrandingManager and EntryPointManager instance for the first request. For subsequent requests, it does not use the correct BrandingManager and EntryPointManager instances, but the ones that where used for the request before. Thus, the corresponding entrypoint is not found and the request cannot be serviced.

Somehow this looks like a "something-is-static-that-should-not-be-static" problem to me...

Do you have any ideas?

Thanks a lot for any comments and hints.
Timo
Comment 1 Ralf Sternberg CLA 2013-06-07 08:57:02 EDT
You can't run multiple applications in parallel on Equinox because of bug 386504. We've had a discussion with the Equinox guys recently and agreed on a solution that will fix this problem, but it will be after Kepler.

Marking as dup, please re-open if you think your problem is different.

*** This bug has been marked as a duplicate of bug 386504 ***