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

Bug 423792

Summary: The alias '/path' is already in use. Whereas path={examples, controls}
Product: [RT] RAP Reporter: Daniel Keck <danielkeck>
Component: DemoAssignee: Project Inbox <rap-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: minor    
Priority: P3 CC: ivan, mknauer
Version: 2.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Daniel Keck CLA 2013-12-11 06:41:15 EST
Running the RAP Demos I get for instance:
!MESSAGE Unable to start RWT application.
java.lang.RuntimeException: org.osgi.service.http.NamespaceException:  The alias '/examples' is already in use.
Since I was running into (but not aware of) https://bugs.eclipse.org/bugs/show_bug.cgi?id=282756 I added a contribution.xml containing
  <implementation class="org.eclipse.rap.examples.internal.ExampleApplication"/>
  <property name="contextName" type="String" value="example3"/>
and changed the path in the ExampleApplication class to /examples3.
The error showed up again "The alias '/examples3' is already in use."
After that it reveals that both: <mySocket>/rapdemo/examples3 and <mySocket>/rapdemo/examples were working fine with and without the contribution.xml.

My question is now: Why is the namespace exception fired?
Comment 1 Daniel Keck CLA 2013-12-11 06:45:01 EST
Offtopic: Can someone please tell me how to make a proper link? E.g. turning [https://bugs.eclipse.org/bugs/show_bug.cgi?id=282756] into something more readable like [browser opened too early bug]?
Comment 2 Ivan Furnadjiev CLA 2013-12-11 07:26:34 EST
Check included bundles in your launch configuration - probably the examples/controls demo bundle is selected in both workspace/target. Post the output of "ss" command in your OSGi console.
Comment 3 Daniel Keck CLA 2013-12-11 12:12:36 EST
Hi no these only appear under workspace but there are other duplicates:
jface, jface.databinding, rap.rwt, rap.rwt.osgi in version 2.1.1 and 2.2 but if I uncheck version 2.1.1 bundles ans apply the changes and run the examples they appear to be selected again when I reopen the Run Configurations dialog. In all cases the namespace exception was thrown.

ss shows
id	State       Bundle
0	ACTIVE      org.eclipse.osgi_3.9.1.v20130814-1242
1	ACTIVE      org.eclipse.equinox.http.jetty_3.0.100.v20130327-1442
2	ACTIVE      org.eclipse.rap.jface.databinding_2.2.0.20130702-1310
3	ACTIVE      org.eclipse.rap.rwt.osgi_2.2.0.20131126-1551
4	ACTIVE      org.eclipse.rap.examples.pages_2.2.0.qualifier
5	ACTIVE      org.eclipse.jetty.http_8.1.10.v20130312
6	ACTIVE      org.eclipse.jetty.io_8.1.10.v20130312
7	ACTIVE      org.eclipse.rap.jface_2.1.1.20130902-1345
8	ACTIVE      org.eclipse.equinox.util_1.0.500.v20130404-1337
9	ACTIVE      org.eclipse.equinox.http.servlet_1.1.400.v20130418-1354
10	ACTIVE      org.eclipse.core.databinding_1.4.1.v20130515-1857
11	ACTIVE      org.eclipse.core.runtime_3.9.0.v20130326-1255
12	ACTIVE      org.eclipse.core.databinding.beans_1.2.200.v20130515-1857
13	ACTIVE      org.eclipse.osgi.services_3.3.100.v20130513-1956
14	ACTIVE      org.apache.felix.gogo.command_0.10.0.v201209301215
15	ACTIVE      org.eclipse.core.contenttype_3.4.200.v20130326-1255
16	ACTIVE      org.eclipse.jetty.servlet_8.1.10.v20130312
17	ACTIVE      com.ibm.icu.base_50.1.1.v201304230130
18	ACTIVE      org.eclipse.rap.rwt_2.2.0.20131204-0942
19	ACTIVE      org.eclipse.jetty.server_8.1.10.v20130312
20	ACTIVE      org.eclipse.equinox.ds_1.4.101.v20130813-1853
21	ACTIVE      org.apache.commons.io_2.0.1.v201105210651
22	ACTIVE      org.eclipse.core.commands_3.6.100.v20130515-1857
23	ACTIVE      org.apache.felix.gogo.shell_0.10.0.v201212101605
24	ACTIVE      org.eclipse.jetty.continuation_8.1.10.v20130312
25	ACTIVE      org.eclipse.equinox.console_1.0.100.v20130429-0953
26	ACTIVE      org.eclipse.equinox.preferences_3.5.100.v20130422-1538
27	ACTIVE      org.eclipse.equinox.common_3.6.200.v20130402-1505
28	ACTIVE      org.eclipse.rap.examples_2.2.0.qualifier
29	ACTIVE      org.eclipse.core.databinding.property_1.4.200.v20130515-1857
30	ACTIVE      org.eclipse.core.expressions_3.4.500.v20130515-1343
31	ACTIVE      javax.servlet_3.0.0.v201112011016
32	ACTIVE      org.eclipse.jetty.util_8.1.10.v20130312
33	ACTIVE      org.eclipse.rap.jface.databinding_2.1.1.20130902-1345
34	ACTIVE      org.eclipse.equinox.registry_3.5.301.v20130717-1549
35	ACTIVE      org.eclipse.equinox.app_1.3.100.v20130327-1442
36	ACTIVE      javax.xml_1.3.4.v201005080400
37	ACTIVE      org.eclipse.jetty.security_8.1.10.v20130312
38	ACTIVE      org.eclipse.rap.jface_2.2.0.20131017-1149
39	ACTIVE      org.eclipse.rap.rwt_2.1.1.20130902-1345
40	ACTIVE      org.eclipse.rap.rwt.osgi_2.1.1.20130902-1345
41	ACTIVE      org.eclipse.core.jobs_3.5.300.v20130429-1813
42	ACTIVE      org.eclipse.core.databinding.observable_1.4.1.v20130515-1857
43	ACTIVE      org.apache.felix.gogo.runtime_0.10.0.v201209301036
Comment 4 Markus Knauer CLA 2013-12-11 12:41:38 EST
But that explains the failures... both RAP bundles are trying to register a servlet with the same path. If you are using a target definition you should make sure that it contains bundles from a single RAP version only.
Comment 5 Daniel Keck CLA 2013-12-11 14:34:56 EST
Hi Markus,
thanks for that hint! Do you mean I will have to delete one version or is there any option/choice beyond the bundle structure to configure. I am asking because I don't have something like a target definition. Everything resides in one huge folder with thousands of plugins.
Comment 6 Markus Knauer CLA 2013-12-11 15:12:43 EST
Yep, I think the best advise I can give you at this time is using a target definition. A target definition can be defined in several ways, using a directory is just one method. There are several good sites that describe the usage of target definition, but here are two links [1] and [2] that will help you getting started.

If you have additional questions, the RAP Forum [3] is always a good place to ask.

Since this issue seems not to be related to RAP, I am going to close this bug now.


[1] http://eclipsesource.com/blogs/2013/04/05/keeping-target-control/
[2] http://wiki.eclipse.org/PDE/Target_Definitions
[3] http://www.eclipse.org/forums/eclipse.technology.rap