Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Stupid question regarding multiple plugins within a single RAP application
icon5.gif  Stupid question regarding multiple plugins within a single RAP application [message #1074379] Fri, 26 July 2013 11:59 Go to next message
Rick Flower is currently offline Rick Flower
Messages: 4
Registered: July 2013
Junior Member
Hi all.. So I had some training this week (ok -- a little -- like a day and a half) Very Happy in RCP and now I want to do something similar in RAP for home use. With that said, I was using some of the training material for RCP and tailoring it a bit for use w/ RAP.

In this case the tutorial created a few plugins as shown below :

1) com.foo.app.core - domain classes defined here for some stock market classes - this was your standard plugin - depends on #2 below for reading stock data

2) org.apache.commons.io - Apache Commons I/O plugin - used by #1 above

3) com.foo.app.core.test - JUnit plugin-fragment for unit testing the above - minimal test passed w/o issue

4) com.foo.app.core.ui - RAP plugin (w/o activator enabled, UI contributor) - depends on #1 above - derived from RAP Hello-World example w/o changes other than to the Manifest to update the dependencies

When I try to run (as a RAP application) #4 above, Eclipse complains about the dependencies for #1 as missing from the "Require-Bundle" line even though it was present down to version 1.0.qualified to match the actual plugin version info..

It didn't seem to matter much what I put it was not happy.. Unfortunately I do not have the code in front of me.. Is there anything you can think of that I might have missed? Or can you point me to a small-ish example that has an application separated into multiple plugins hopefully with some unit test fragments? Thanks!
Re: Stupid question regarding multiple plugins within a single RAP application [message #1074574 is a reply to message #1074379] Sat, 27 July 2013 01:39 Go to previous messageGo to next message
Rick Flower is currently offline Rick Flower
Messages: 4
Registered: July 2013
Junior Member
ok.. here's the log.. All I did was add 1 dependency to the standard RAP-Hello World example and I get this :
2013-07-26 21:55:32.119:INFO:oejs.Server:jetty-8.1.10.v20130312
2013-07-26 21:55:32.152:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:61910
!SESSION 2013-07-26 21:55:31.420 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_51
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Command-line arguments:  -dev file:/Users/nrf/Documents/workspace/.metadata/.plugins/org.eclipse.pde.core/com.bank.tracker.ui/dev.properties -os macosx -ws cocoa -arch x86_64 -console -consolelog -data /Users/nrf/Documents/workspace/.metadata/.plugins/org.eclipse.rap.tools.launch/com.bank.tracker.ui

!ENTRY com.bank.tracker.ui 4 0 2013-07-26 21:55:32.197
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The bundle "com.bank.tracker.ui_1.0.0.qualifier [21]" could not be resolved. Reason: Missing Constraint: Require-Bundle: com.bank.tracker.core; bundle-version="1.0.0"
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.eclipse.osgi 4 0 2013-07-26 21:55:32.199
!MESSAGE Bundle initial@reference:file:../../../../com.bank.tracker.ui/ was not resolved.

!ENTRY org.eclipse.osgi 2 0 2013-07-26 21:55:32.216
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-07-26 21:55:32.216
!MESSAGE Bundle initial@reference:file:../../../../com.bank.tracker.ui/ was not resolved.
!SUBENTRY 2 com.bank.tracker.ui 2 0 2013-07-26 21:55:32.216
!MESSAGE Missing required bundle com.bank.tracker.core_1.0.0.

!ENTRY org.eclipse.osgi 2 0 2013-07-26 21:55:32.218
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-07-26 21:55:32.218
!MESSAGE Bundle com.bank.tracker.ui_1.0.0.qualifier [21] was not resolved.
!SUBENTRY 2 com.bank.tracker.ui 2 0 2013-07-26 21:55:32.218
!MESSAGE Missing required bundle com.bank.tracker.core_1.0.0.
osgi> 


Here's the manifest from the UI plugin (com.bank.tracker.ui):
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Ui
Bundle-SymbolicName: com.bank.tracker.ui
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.bank.tracker.ui.Activator
Bundle-Vendor: BIGBANK
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.rap.rwt;bundle-version="[2.0.0,3.0.0)",
 com.bank.tracker.core;bundle-version="1.0.0"
Import-Package: org.osgi.framework
Service-Component: OSGI-INF/contribution.xml


Here's the manifest from the com.bank.tracker.core plugin that is causing the problem :

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Core
Bundle-SymbolicName: com.bank.tracker.core
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.bank.tracker.core.Activator
Bundle-Vendor: BIGBANK
Require-Bundle: org.eclipse.core.runtime,
 org.apache.commons.io;bundle-version="2.4.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: com.bank.tracker.core.model


Here's the output from the OSGi console :

osgi> ss
"Framework is launched."


id	State       Bundle
0	ACTIVE      org.eclipse.osgi_3.9.0.v20130529-1710
1	ACTIVE      org.eclipse.jetty.io_8.1.10.v20130312
2	ACTIVE      org.eclipse.jetty.server_8.1.10.v20130312
3	ACTIVE      org.apache.felix.gogo.command_0.10.0.v201209301215
4	ACTIVE      org.eclipse.jetty.continuation_8.1.10.v20130312
5	ACTIVE      javax.servlet_3.0.0.v201112011016
6	ACTIVE      org.eclipse.jetty.http_8.1.10.v20130312
7	ACTIVE      org.apache.felix.gogo.shell_0.10.0.v201212101605
8	ACTIVE      org.eclipse.jetty.util_8.1.10.v20130312
9	ACTIVE      org.eclipse.rap.rwt.osgi_2.1.0.20130506-1748
10	ACTIVE      org.eclipse.rap.rwt_2.1.0.20130611-2139
11	ACTIVE      org.eclipse.equinox.http.jetty_3.0.100.v20130327-1442
12	ACTIVE      org.eclipse.jetty.servlet_8.1.10.v20130312
14	ACTIVE      org.eclipse.osgi.services_3.3.100.v20130513-1956
15	ACTIVE      org.eclipse.equinox.util_1.0.500.v20130404-1337
16	ACTIVE      org.apache.felix.gogo.runtime_0.10.0.v201209301036
17	ACTIVE      org.eclipse.equinox.ds_1.4.100.v20130515-2026
18	ACTIVE      org.eclipse.equinox.console_1.0.100.v20130429-0953
19	ACTIVE      org.eclipse.jetty.security_8.1.10.v20130312
20	ACTIVE      org.eclipse.equinox.http.servlet_1.1.400.v20130418-1354
21	INSTALLED   com.bank.tracker.ui_1.0.0.qualifier
osgi> diag 21
initial@reference:file:../../../../com.bank.tracker.ui/ [21]
  Direct constraints which are unresolved:
    Missing required bundle com.bank.tracker.core_1.0.0.
osgi> bundle 21
com.bank.tracker.ui_1.0.0.qualifier [21]
  Id=21, Status=INSTALLED   Data Root=/Users/nrf/Documents/workspace/.metadata/.plugins/org.eclipse.pde.core/com.bank.tracker.ui/org.eclipse.osgi/bundles/21/data
  "No registered services."
  No services in use.
  No exported packages
  No imported packages
  No fragment bundles
  No named class spaces
  No required bundles
osgi>


Any ideas on what I messed up? I gather I could probably put the missing bundle in the target config but that doesn't seem right.. Do I need to setup a product configuration project and put all of the overall dependencies in there for use with Maven Tycho? Sorry for the newbie questions.. I'm just not sure the best approach here..

[Updated on: Sat, 27 July 2013 01:43]

Report message to a moderator

Re: Stupid question regarding multiple plugins within a single RAP application [message #1074964 is a reply to message #1074574] Sun, 28 July 2013 05:17 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1286
Registered: July 2009
Senior Member

On 07/27/2013 07:39 AM, Rick Flower wrote:
> osgi> diag 21
> initial@reference:file:../../../../com.bigbank.stocktracker.ui/ [21]
> Direct constraints which are unresolved:
> Missing required bundle com.bigbank.stocktracker.core_1.0.0.

I'm not sure if I understand your questions, but it seems that you
simply forgot to include the bundle com.bigbank.stocktracker.core. Since
it's required, it must be present at runtime.

Regards, Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Stupid question regarding multiple plugins within a single RAP application [message #1075113 is a reply to message #1074964] Sun, 28 July 2013 15:54 Go to previous messageGo to next message
Rick Flower is currently offline Rick Flower
Messages: 4
Registered: July 2013
Junior Member
Thanks Ralf for chiming in.. If it's listed in the dependencies tab of the UI manifest doesn't that take care of it or am I missing something? The same sort of thing works fine for RCP but has issues for RAP
Re: Stupid question regarding multiple plugins within a single RAP application [message #1075122 is a reply to message #1075113] Sun, 28 July 2013 16:31 Go to previous messageGo to next message
Cole Markham is currently offline Cole Markham
Messages: 132
Registered: July 2009
Senior Member
Rick,

Specifying the dependency in the bundle's maninfest only declares that your bundle needs another bundle to start. That is why your bundle is failing to start, because the dependency is missing. You also have to specify which bundles are installed in the running osgi environment. If you are starting from Eclipse, that is done via the Run->"Run Configurations" dialog. Make sure the bundles you require are checked on the "Bundles" tab of the configuration you use to launch your RAP Application. I am not familiar with the exact configuration for Maven/Tycho, but you will need to ensure all required bundles are included there as well. This includes not only the bundles you develop, but also 3rd party dependencies such as the org.apache.commons.io dependency required by your core bundle.

Hope that helps,

Cole Markham
Re: Stupid question regarding multiple plugins within a single RAP application [message #1075222 is a reply to message #1075122] Sun, 28 July 2013 23:50 Go to previous message
Rick Flower is currently offline Rick Flower
Messages: 4
Registered: July 2013
Junior Member
Cole Markham wrote on Sun, 28 July 2013 16:31
Specifying the dependency in the bundle's maninfest only declares that your bundle needs another bundle to start. That is why your bundle is failing to start, because the dependency is missing. You also have to specify which bundles are installed in the running osgi environment. If you are starting from Eclipse, that is done via the Run->"Run Configurations" dialog. Make sure the bundles you require are checked on the "Bundles" tab of the configuration you use to launch your RAP Application. I am not familiar with the exact configuration for Maven/Tycho, but you will need to ensure all required bundles are included there as well. This includes not only the bundles you develop, but also 3rd party dependencies such as the org.apache.commons.io dependency required by your core bundle.


Cole-- You da man!!

You were spot on.. I right-clicked on the plugin name (for the UI) and pulled up the "Run Configurations" window as part of the "Run As"... On that window in the Bundles tab is a button entitled "Add Required Bundles" which fixed the issue and added my "core" bundle as well as the Apache Commons IO required by it.. slick -- all is working now!! Thanks all!
Previous Topic:Selenium get Widget by DOM Element
Next Topic:Widget is disposed exception on table when double click
Goto Forum:
  


Current Time: Thu Apr 17 05:57:00 EDT 2014

Powered by FUDForum. Page generated in 0.01818 seconds