I'm under the assumption that equinox.ds has an indirect dependency upon 
equinox.util.  Try starting equinox.util before equinos.ds.

I use the following startup order in my RCP app's config.ini:

osgi.bundles=...\
   org.eclipse.equinox.u...@2:start, \
   org.eclipse.equinox...@2:start, \
   ...



The contents of this e-mail are intended for the named addressee only. It 
contains information that may be confidential. Unless you are the named 
addressee or an authorized designee, you may not copy or use it, or disclose it 
to anyone else. If you received it in error please notify us immediately and 
then destroy it.

From: equinox-dev-boun...@eclipse.org [mailto:equinox-dev-boun...@eclipse.org] 
On Behalf Of Mitra, Priyanka
Sent: Thursday, February 05, 2009 5:47 PM
To: equinox-dev@eclipse.org
Subject: [equinox-dev] Declarative Services within RCP Applications 

Ben,

Thanx for your input. I do have the org.eclipse.equinox.ds in config.ini file. 
This is my config.ini file. All the custom bundles start at level 5. In the Run 
Configuration->Configuration tab, "Use an existing config.ini as a template" is 
checked in and "Use default location" is checked in. Still the bundles are not 
starting when launched in eclipse application.

#Configuration File
#Thu Feb 05 13:57:13 PST 2009
osgi.bundles=org.eclipse.osgi.services_3.1.200.v20071203....@start, \
                org.eclipse.equinox.ds_1.0.0.v20080427-0830....@2:start, \
                
org.eclipse.core.runtime.compatibility.registry_3.2.200.v20080610, \
                org.eclipse.ui.workbench_3.4.1.m20080827-0800a....@start, \
                org.eclipse.equinox.transforms.hook_1.0.0.v20080610.jar, \
                org.eclipse.core.jobs_3.4.0.v20080512....@start, \
                org.eclipse.swt_3.4.1.v3449c....@start, \
                org.eclipse.core.databinding_1.1.1.m20080827-0800b....@start, \
                org.eclipse.core.contenttype_3.3.0.v20080604-1400....@start, \
                com.ibm.icu_3.8.1.v20080530....@start, \
                org.eclipse.core.commands_3.4.0.i20080509-2000....@start, \
                org.eclipse.core.runtime_3.4.0.v20080512....@start, \
                org.eclipse.equinox.registry_3.4.0.v20080516-0950....@start, \
                org.eclipse.equinox.common_3.4.0.v20080421-2006....@start, \
                org.eclipse.core.expressions_3.4.0.v20080603-2000....@start, \
                org.eclipse.ui_3.4.1.m20080910-0800....@start, \
                org.eclipse.equinox.util_1.0.0.v20080414....@start, \
                
org.eclipse.core.runtime.compatibility.auth_3.2.100.v20070502....@start, \
                
org.eclipse.equinox.preferences_3.2.201.r34x_v20080709....@start, \
                org.eclipse.swt.gtk.linux.x86_3.4.1.v3449c.jar, \
                org.eclipse.jface.databinding_1.2.1.m20080827-0800a....@start, \
                org.eclipse.jface_3.4.1.m20080827-2000....@start, \
                org.eclipse.equinox.app_1.1.0.v20080421-2006....@start, \
                org.eclipse.help_3.3.101.v20080702_34x....@start, \
                javax.servlet_2.4.0.v200806031604....@start
                myhe...@5:start, \
                jmsimpor...@5:start, \
                com.etrade.comm...@5:start, \
                com.etrade.tops....@5:start, \
osgi.bundles.defaultStartLevel=4
osgi.install.area=file\:/etrade/home/pmitra/eclipse
osgi.framework=file\:/etrade/home/pmitra/eclipse/plugins/org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
osgi.configuration.cascaded=false 

Regards
Priyanka

-----Original Message-----
From: equinox-dev-boun...@eclipse.org [mailto:equinox-dev-boun...@eclipse.org] 
On Behalf Of equinox-dev-requ...@eclipse.org
Sent: Thursday, February 05, 2009 5:08 AM
To: equinox-dev@eclipse.org
Subject: equinox-dev Digest, Vol 46, Issue 5

Send equinox-dev mailing list submissions to
        equinox-dev@eclipse.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://dev.eclipse.org/mailman/listinfo/equinox-dev
or, via email, send a message with subject or body 'help' to
        equinox-dev-requ...@eclipse.org

You can reach the person managing the list at
        equinox-dev-ow...@eclipse.org

When replying, please edit your Subject line so it is more specific than "Re: 
Contents of equinox-dev digest..."


Today's Topics:

   1. Declarative Services within RCP Applications (Mitra, Priyanka)
   2. Re: Declarative Services within RCP Applications (Benjamin CAB?)


----------------------------------------------------------------------

Message: 1
Date: Wed, 4 Feb 2009 18:48:04 -0500
From: "Mitra, Priyanka" <priyanka.mi...@etrade.com>
Subject: [equinox-dev] Declarative Services within RCP Applications
To: <equinox-dev@eclipse.org>
Message-ID:
        <6b657591b767a94aa6170def5d8b5bb7016ef...@atl1ex11.corp.etradegrp.com>
Content-Type: text/plain; charset="us-ascii"

Hello

I am not very clear how to use declaratively declarative services from RCP 
Application. I have a main container that other plugins that contribute to UI. 
In one of the plugin, I have a view that has to subscribe to a JMS service, the 
implementation of which is declared as a service in another bundle.
I am able to run this using "Run As -> OSGI Framework". The subscription takes 
place without any problems. But when run as Eclipse Application, osgi console 
comes up and then immediately shuts down and then my RCP Application comes up. 
The subscription to JMS service fails as there is no reference available. In 
fact it almost seems like the DS bundle for JMS is not loaded or installed at 
the runtime of RCP App. Am I missing something in the run configuration? Why 
the service bundle is not getting installed when RCP app comes up?

This is my service bundle: Subscription implementation is in JMSConnection.

<?xml version="1.0"?>
<component name="jmsService">
        <implementation class="com.....JMSConnection"/>
        <service>
                <provide interface="com......IMessageService"/>
        </service>
</component>

This is the call from consumer bundle. This bundle also contributes to UI..

<?xml version="1.0"?>
<component name="jmsconn">
        <implementation
class="tops.order.trade.mgmt.ui.views.AlertsView"/>
        <reference name="jmsService"
        interface="com......IMessageService"
        bind="setService"
        unbind="unsetService"
        cardinality="0..1"
        policy="dynamic"/>
</component>

AlertsView.java

public class AlertsView extends ViewPart implements IMessageHandler {

        private IMessageService jmsService = null;

        public void createPartControl(Composite parent) {
                .............. // some UI code

                openJMSConnection(topic, mapper, handler);
        }
        /* (non-Javadoc)
         */
        public void setService(IMessageService jmsService) {
                System.out.println("Setting up JMS Service Instance");
            this.jmsService = jmsService;
            openJMSConnection("", new AlertsMessageMapper(), this);
        }
        /* (non-Javadoc)
         */
        public void unsetService(IMessageService jmsService) {
            this.jmsService = null;
        }

        public void openJMSConnection (String topic, IMessageMapper mapper, 
IMessageHandler handler) 
        {
            if (this.jmsService != null) {
                System.out.println("Service not null");
                jmsService.subscribeService(topic, mapper, handler);
            }
            else
                System.out.println("Service is null");
        }

Can anyone suggest what is the best way to mix the use of extensions and 
services at the same time within RCP Application. I appreciate your attention 
on this matter.

Regards..
Priyanka

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
https://dev.eclipse.org/mailman/private/equinox-dev/attachments/20090204/407b1ce4/attachment.html

------------------------------

Message: 2
Date: Thu, 05 Feb 2009 14:07:55 +0100
From: Benjamin CAB? <benjamin.c...@anyware-tech.com>
Subject: Re: [equinox-dev] Declarative Services within RCP
        Applications
To: Equinox development mailing list <equinox-dev@eclipse.org>
Message-ID: <498ae4ab.6010...@anyware-tech.com>
Content-Type: text/plain; charset="iso-8859-1"

Mitra,

The org.eclipse.equinox.ds bundle must always be started; hence you need to 
either use a custom config.ini which should look like
    osgi.bundles=org.eclipse.equinox...@2:start
or use Eclipse 3.5 M5 to be able to set the DS bundle to autostart using the 
new Eclipse launch configuration dialog...

On a side note, adding -Dequinox.ds.print=true to the VM args of your launch 
configuration may be useful to have traces about components activation, 
deactivation, etc.

Cheers,
Ben
Anyware Technologies <http://www.anyware-tech.com>      
*Benjamin Cabé*
Expert Eclipse
benjamin.c...@anyware-tech.com <mailto:benjamin.c...@anyware-tech.com>
*http://blog.benjamin-cabe.com*
Tel : +33(0)5 61 00 06 41
Fax : +33(0)5 61 00 51 46
        
*Nouvelle adresse
*

------------------------------------------------------------------------
*Anyware Technologies
* Lake Park
ZAC de l'Hers - Allée du Lac
BP 87216
31672 Labège Cedex
France
www.anyware-tech.com <http://www.anyware-tech.com>



Mitra, Priyanka a écrit :
>
> Hello
>
> I am not very clear how to use declaratively declarative services from 
> RCP Application. I have a main container that other plugins that 
> contribute to UI. In one of the plugin, I have a view that has to 
> subscribe to a JMS service, the implementation of which is declared as 
> a service in another bundle.
>
> I am able to run this using "Run As -> OSGI Framework". The 
> subscription takes place without any problems. But when run as Eclipse 
> Application, osgi console comes up and then immediately shuts down and 
> then my RCP Application comes up. The subscription to JMS service 
> fails as there is no reference available. In fact it almost seems like 
> the DS bundle for JMS is not loaded or installed at the runtime of RCP 
> App. Am I missing something in the run configuration? Why the service 
> bundle is not getting installed when RCP app comes up?
>
> This is my service bundle: Subscription implementation is in 
> JMSConnection.
>
> <?xml version="1.0"?>
> <component name="jmsService">
>         <implementation class="com.....JMSConnection"/>
>         <service>
>                 <provide interface="com......IMessageService"/>
>         </service>
> </component>
>
> This is the call from consumer bundle. This bundle also contributes to 
> UI..
>
> <?xml version="1.0"?>
> <component name="jmsconn">
>         <implementation
> class="tops.order.trade.mgmt.ui.views.AlertsView"/>
>         <reference name="jmsService"
>         interface="com......IMessageService"
>         bind="setService"
>         unbind="unsetService"
>         cardinality="0..1"
>         policy="dynamic"/>
> </component>
>
> AlertsView.java
>
> public class AlertsView extends ViewPart implements IMessageHandler {
>
>         private IMessageService jmsService = null;
>
>         public void createPartControl(Composite parent) {
>                 .............. // some UI code
>
>                 openJMSConnection(topic, mapper, handler);
>         }
>         /* (non-Javadoc)
>          */
>         public void setService(IMessageService jmsService) {
>                 System.out.println("Setting up JMS Service Instance");
>             this.jmsService = jmsService;
>             openJMSConnection("", new AlertsMessageMapper(), this);
>         }
>         /* (non-Javadoc)
>          */
>         public void unsetService(IMessageService jmsService) {
>             this.jmsService = null;
>         }
>
>         public void openJMSConnection (String topic, IMessageMapper 
> mapper, IMessageHandler handler)
>         {
>             if (this.jmsService != null) {
>                 System.out.println("Service not null");
>                 jmsService.subscribeService(topic, mapper, handler);
>             }
>             else
>                 System.out.println("Service is null");
>         }
>
> Can anyone suggest what is the best way to mix the use of extensions 
> and services at the same time within RCP Application. I appreciate 
> your attention on this matter.
>
> Regards..
> Priyanka
>
> ----------------------------------------------------------------------
> --
>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@eclipse.org
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>   
-------------- next part --------------
Skipped content of type multipart/related

------------------------------

_______________________________________________
equinox-dev mailing list
equinox-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev


End of equinox-dev Digest, Vol 46, Issue 5
******************************************
_______________________________________________
equinox-dev mailing list
equinox-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Reply via email to