How use EJB Service in another bundle

View: New views
10 Messages — Rating Filter:   Alert me  

How use EJB Service in another bundle

by gembin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 How use EJB Service in another bundle?

 Suppose there are 2 bundles.
 bundle A:
 @Stateless
 @Local
 @Remote
 public  interface IHelloService{void sayHello()}
 public class HelloServiceBean implements IHelloService{
     void sayHello(){
           System.out.println("Hello EasyBeans!");
     }
 }


 bundle B:
 @Stateless
 @Local
 public interface IServiceComposite {void doService()}

public class ServiceComposite implements IServiceComposite{
    @EJB  IHelloService service;  
   void doService(){
      service.sayHello();
     System.out.println("Service done!!");
   }
}
and i also Export-Package for Bundle A in the MANIFEST.MF
how to make this work?
help!!
thank you !

Re: How use EJB Service in another bundle

by ekke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

gembin schrieb:

>  How use EJB Service in another bundle?
>
>  Suppose there are 2 bundles.
>  bundle A:
>  @Stateless
>  @Local
>  @Remote
>  public  interface IHelloService{void sayHello()}
>  public class HelloServiceBean implements IHelloService{
>      void sayHello(){
>   System.out.println("Hello EasyBeans!");
>      }
>  }
>
>
>  bundle B:
>  @Stateless
>  @Local
>  public interface IServiceComposite {void doService()}
>
> public class ServiceComposite implements IServiceComposite{
>     @EJB  IHelloService service;  
>    void doService(){
>       service.sayHello();
>      System.out.println("Service done!!");
>    }
> }
> and i also Export-Package for Bundle A in the MANIFEST.MF
> how to make this work?
> help!!
> thank you !
>
gembin,

if all of your dependencies are well designed and EZB osgi bundles are
initialized you should be able to use it without any problems.

all your API should be exported from those bundles and all bundles using
services should be import them.

perhaps you'll take a look at my blogs ?
http://ekkes-corner.org
where I describe how to build an OSGI based EJB3 server. its not all
finished at the moment, but should be until end of april, because
there'll be a session at JAX09 - OSGI Experts Day
  http://it-republik.de/jaxenter/jax/sessions/?tid=1177

ekke


Re: Re: How use EJB Service in another bundle

by gembin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi ekke,
 yes, all the dependencies should be ok.
 
 if i change it like this, it works...   why?
 
  @Stateless(mappedName="HelloServiceBean ")
  public class HelloServiceBean implements IHelloService{
    void sayHello(){
          System.out.println("Hello EasyBeans!");
    }
 }
 
public class ServiceComposite implements IServiceComposite{
   @EJB(mappedName="HelloServiceBean ")  IHelloService service;
  void doService(){
     service.sayHello();
    System.out.println("Service done!!");
  }
}

and i did another test.
bundle A  is seperated to 2 bundles API and Impl.
in the API bundle i just export the package without Activator and in Impl Bundle i add org.ow2.easybeans.osgi.ejbjar.Activator
when i start Bundle B, there is NoSuchFieldException thrown in  class ServiceComposite .
 
Any ideas?
 
 
2009/3/2 ekke <ekkehard@...>
gembin schrieb:

 How use EJB Service in another bundle?

 Suppose there are 2 bundles.
 bundle A:
 @Stateless
 @Local
 @Remote
 public  interface IHelloService{void sayHello()}
 public class HelloServiceBean implements IHelloService{
    void sayHello(){
          System.out.println("Hello EasyBeans!");
    }
 }


 bundle B:
 @Stateless
 @Local
 public interface IServiceComposite {void doService()}

public class ServiceComposite implements IServiceComposite{
   @EJB  IHelloService service;     void doService(){
     service.sayHello();
    System.out.println("Service done!!");
  }
}
and i also Export-Package for Bundle A in the MANIFEST.MF
how to make this work?
help!!
thank you !

gembin,

if all of your dependencies are well designed and EZB osgi bundles are initialized you should be able to use it without any problems.

all your API should be exported from those bundles and all bundles using services should be import them.

perhaps you'll take a look at my blogs ?
http://ekkes-corner.org
where I describe how to build an OSGI based EJB3 server. its not all finished at the moment, but should be until end of april, because there'll be a session at JAX09 - OSGI Experts Day
 http://it-republik.de/jaxenter/jax/sessions/?tid=1177

ekke




--
Gembin
My Blog: http://www.blogjava.net/gembin


Re: Re: Re: How use EJB Service in another bundle

by Guillaume Sauthier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


>
> }
>
> *and i did another test.*
> *bundle A  is seperated to 2 bundles API and Impl.*
> *in the API bundle i just export the package without Activator and in
> Impl Bundle i add org.ow2.easybeans.osgi.ejbjar.Activator*
> *when i start Bundle B, there is NoSuchFieldException thrown in  class
> ServiceComposite* .

Hi, the stack trace would be very helpful here :)
--Guillaume



[Guillaume_Sauthier.vcf]

begin:vcard
fn:Guillaume Sauthier
n:Sauthier;Guillaume
org:<a href="http://www.ow2.org"><img title="OW2" alt="OW2 Consortium" border="0" src="http://www.ow2.org/xwiki/bin/skin/XWiki/DefaultSkin/logoOW2.png" /></a>
adr:;;;;;;France
email;internet:guillaume.sauthier@...
title:<a href="http://jonas.ow2.org">JOnAS Application Server</a>
x-mozilla-html:TRUE
url:http://jonas.ow2.org
version:2.1
end:vcard



Re: Re: Re: How use EJB Service in another bundle

by ekke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

张斌 schrieb:
hi ekke,
 yes, all the dependencies should be ok.
 
 if i change it like this, it works...   why?
 
  @Stateless(mappedName="HelloServiceBean ")
I always use this  format of @EJB annotation with mappedName property -
I remember some problems without a mappedName

ekke
  public class HelloServiceBean implements IHelloService{
    void sayHello(){
          System.out.println("Hello EasyBeans!");
    }
 }
 
public class ServiceComposite implements IServiceComposite{
   @EJB(mappedName="HelloServiceBean ")  IHelloService service;
  void doService(){
     service.sayHello();
    System.out.println("Service done!!");
  }
}

and i did another test.
bundle A  is seperated to 2 bundles API and Impl.
in the API bundle i just export the package without Activator and in Impl Bundle i add org.ow2.easybeans.osgi.ejbjar.Activator
when i start Bundle B, there is NoSuchFieldException thrown in  class ServiceComposite .
 
Any ideas?
 
 
2009/3/2 ekke <ekkehard@...>
gembin schrieb:

 How use EJB Service in another bundle?

 Suppose there are 2 bundles.
 bundle A:
 @Stateless
 @Local
 @Remote
 public  interface IHelloService{void sayHello()}
 public class HelloServiceBean implements IHelloService{
    void sayHello(){
          System.out.println("Hello EasyBeans!");
    }
 }


 bundle B:
 @Stateless
 @Local
 public interface IServiceComposite {void doService()}

public class ServiceComposite implements IServiceComposite{
   @EJB  IHelloService service;     void doService(){
     service.sayHello();
    System.out.println("Service done!!");
  }
}
and i also Export-Package for Bundle A in the MANIFEST.MF
how to make this work?
help!!
thank you !

gembin,

if all of your dependencies are well designed and EZB osgi bundles are initialized you should be able to use it without any problems.

all your API should be exported from those bundles and all bundles using services should be import them.

perhaps you'll take a look at my blogs ?
http://ekkes-corner.org
where I describe how to build an OSGI based EJB3 server. its not all finished at the moment, but should be until end of april, because there'll be a session at JAX09 - OSGI Experts Day
 http://it-republik.de/jaxenter/jax/sessions/?tid=1177

ekke




--
Gembin
My Blog: http://www.blogjava.net/gembin



--

ekkehard gentz
software-architect
erp-consultant

opensource: http://ekkehard.org
blog (en): http://ekkes-corner.org
blog (de): http://ekkes-ecke.org


Re: Re: Re: Re: How use EJB Service in another bundle

by gembin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi,
 
i reproduce the issue with a sample, please find the src in the attachment 
 
@Local
@Stateless(mappedName="ConsumerBean")
public class ServiceConsumerBean implements IServiceConsumer {
    @EJB(mappedName="SampleServiceBean") ISampleService sService;
    @EJB(mappedName="HelloBean") HelloService hService;
    @Override
    public void consume () {
        System.out.println ("consume.....");
        hService.speak ();
        System.out.println (sService.doServiceFor ("gembin"));
        System.out.println ("consumed");
    }
}
 
java.lang.NoSuchFieldError: sService
        at org.easybeans.consumer.ServiceConsumerBean.original$EasyBeans$injectedByEasyBeans(Service
ConsumerBean.java)
        at org.ow2.easybeans.gen.invocationcontext.org.easybeans.consumer.ServiceConsumerBean.EasyBe
ansInvocationContextImploriginal$EasyBeans$injectedByEasyBeansDEPINJECT39797.proceed(Unknown Source)

        at org.ow2.easybeans.naming.interceptors.EZBENCInterceptor.intercept(EZBENCInterceptor.java:
71)
        at org.ow2.easybeans.gen.invocationcontext.org.easybeans.consumer.ServiceConsumerBean.EasyBe
ansInvocationContextImploriginal$EasyBeans$injectedByEasyBeansDEPINJECT39797.proceed(Unknown Source)

        at org.easybeans.consumer.ServiceConsumerBean.injectedByEasyBeans(ServiceConsumerBean.java)
        at org.ow2.easybeans.container.AbsFactory.injectResources(AbsFactory.java:264)
        at org.ow2.easybeans.container.session.SessionFactory.create(SessionFactory.java:175)
        at org.ow2.easybeans.container.session.stateless.StatelessSessionFactory.create(StatelessSes
sionFactory.java:56)
        at org.ow2.util.pool.impl.JPool.get(JPool.java:256)
        at org.ow2.util.pool.impl.JPool.get(JPool.java:174)
        at org.ow2.easybeans.container.session.stateless.StatelessSessionFactory.getBean(StatelessSe
ssionFactory.java:111)
        at org.ow2.easybeans.container.session.stateless.StatelessSessionFactory.localCall(Stateless
SessionFactory.java:130)
        at org.ow2.easybeans.proxy.client.LocalCallInvocationHandler.invoke(LocalCallInvocationHandl
er.java:173)
        at $Proxy19.consume(Unknown Source)
        at org.easybeans.example.Activator._tx(Activator.java:46)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCom
mandInterpreter.java:150)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java
:298)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:2
83)
        at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:219)
        at java.lang.Thread.run(Unknown Source)
 
Gembin
 
2009/3/2 Guillaume Sauthier <Guillaume.Sauthier@...>


}

*and i did another test.*

*bundle A  is seperated to 2 bundles API and Impl.*
*in the API bundle i just export the package without Activator and in Impl Bundle i add org.ow2.easybeans.osgi.ejbjar.Activator*
*when i start Bundle B, there is NoSuchFieldException thrown in  class ServiceComposite* .

Hi, the stack trace would be very helpful here :)
--Guillaume





--
Gembin
My Blog: http://www.blogjava.net/gembin



EasyBeans-Sample-With-Issue.zip (13K) Download Attachment

Re: How use EJB Service in another bundle

by ekke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

gembin,

if you look at the thread
EJB "auto-injection" not working when session bean to inject is in
another bundle
started 2008-11-3 there those problems with injecting EJB from other
bundles were discussed

ekke

张斌 schrieb:

> hi,
>  
> i reproduce the issue with a sample, please find the src in the attachment
>  
> @Local
> @Stateless(mappedName="ConsumerBean")
> public class ServiceConsumerBean implements IServiceConsumer {
>     @EJB(mappedName="SampleServiceBean") ISampleService sService;
>     @EJB(mappedName="HelloBean") HelloService hService;
>     @Override
>     public void consume () {
>         System.out.println ("consume.....");
>         hService.speak ();
>         System.out.println (sService.doServiceFor ("gembin"));
>         System.out.println ("consumed");
>     }
> }
>  
> java.lang.NoSuchFieldError: sService
>         at
> org.easybeans.consumer.ServiceConsumerBean.original$EasyBeans$injectedByEasyBeans(Service
> ConsumerBean.java)
>         at
> org.ow2.easybeans.gen.invocationcontext.org.easybeans.consumer.ServiceConsumerBean.EasyBe
> ansInvocationContextImploriginal$EasyBeans$injectedByEasyBeansDEPINJECT39797.proceed(Unknown
> Source)
>
>         at
> org.ow2.easybeans.naming.interceptors.EZBENCInterceptor.intercept(EZBENCInterceptor.java:
> 71)
>         at
> org.ow2.easybeans.gen.invocationcontext.org.easybeans.consumer.ServiceConsumerBean.EasyBe
> ansInvocationContextImploriginal$EasyBeans$injectedByEasyBeansDEPINJECT39797.proceed(Unknown
> Source)
>
>         at
> org.easybeans.consumer.ServiceConsumerBean.injectedByEasyBeans(ServiceConsumerBean.java)
>         at
> org.ow2.easybeans.container.AbsFactory.injectResources(AbsFactory.java:264)
>         at
> org.ow2.easybeans.container.session.SessionFactory.create(SessionFactory.java:175)
>         at
> org.ow2.easybeans.container.session.stateless.StatelessSessionFactory.create(StatelessSes
> sionFactory.java:56)
>         at org.ow2.util.pool.impl.JPool.get(JPool.java:256)
>         at org.ow2.util.pool.impl.JPool.get(JPool.java:174)
>         at
> org.ow2.easybeans.container.session.stateless.StatelessSessionFactory.getBean(StatelessSe
> ssionFactory.java:111)
>         at
> org.ow2.easybeans.container.session.stateless.StatelessSessionFactory.localCall(Stateless
> SessionFactory.java:130)
>         at
> org.ow2.easybeans.proxy.client.LocalCallInvocationHandler.invoke(LocalCallInvocationHandl
> er.java:173)
>         at $Proxy19.consume(Unknown Source)
>         at org.easybeans.example.Activator._tx(Activator.java:46)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at
> org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCom
> mandInterpreter.java:150)
>         at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java
> :298)
>         at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:2
> 83)
>         at
> org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:219)
>         at java.lang.Thread.run(Unknown Source)
>  
> Gembin
>  
> 2009/3/2 Guillaume Sauthier <Guillaume.Sauthier@...
> <mailto:Guillaume.Sauthier@...>>
>
>
>
>         }
>
>         *and i did another test.*
>
>         *bundle A  is seperated to 2 bundles API and Impl.*
>         *in the API bundle i just export the package without Activator
>         and in Impl Bundle i add org.ow2.easybeans.osgi.ejbjar.Activator*
>         *when i start Bundle B, there is NoSuchFieldException thrown in
>          class ServiceComposite* .
>
>
>     Hi, the stack trace would be very helpful here :)
>     --Guillaume
>
>
>
>
>
> --
> Gembin
> My Blog: http://www.blogjava.net/gembin
>


Re: Re: How use EJB Service in another bundle

by gembin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi ekke,
 
  ok, thanks!

gembin

2009/3/3 ekke <ekkehard@...>
gembin,

if you look at the thread
EJB "auto-injection" not working when session bean to inject is in another bundle
started 2008-11-3 there those problems with injecting EJB from other bundles were discussed

ekke

张斌 schrieb:
hi,
 i reproduce the issue with a sample, please find the src in the attachment  @Local
@Stateless(mappedName="ConsumerBean")
public class ServiceConsumerBean implements IServiceConsumer {
   @EJB(mappedName="SampleServiceBean") ISampleService sService;
   @EJB(mappedName="HelloBean") HelloService hService;
   @Override
   public void consume () {
       System.out.println ("consume.....");
       hService.speak ();
       System.out.println (sService.doServiceFor ("gembin"));
       System.out.println ("consumed");
   }
}
 java.lang.NoSuchFieldError: sService
       at org.easybeans.consumer.ServiceConsumerBean.original$EasyBeans$injectedByEasyBeans(Service
ConsumerBean.java)
       at org.ow2.easybeans.gen.invocationcontext.org.easybeans.consumer.ServiceConsumerBean.EasyBe
ansInvocationContextImploriginal$EasyBeans$injectedByEasyBeansDEPINJECT39797.proceed(Unknown Source)

       at org.ow2.easybeans.naming.interceptors.EZBENCInterceptor.intercept(EZBENCInterceptor.java:
71)
       at org.ow2.easybeans.gen.invocationcontext.org.easybeans.consumer.ServiceConsumerBean.EasyBe
ansInvocationContextImploriginal$EasyBeans$injectedByEasyBeansDEPINJECT39797.proceed(Unknown Source)

       at org.easybeans.consumer.ServiceConsumerBean.injectedByEasyBeans(ServiceConsumerBean.java)
       at org.ow2.easybeans.container.AbsFactory.injectResources(AbsFactory.java:264)
       at org.ow2.easybeans.container.session.SessionFactory.create(SessionFactory.java:175)
       at org.ow2.easybeans.container.session.stateless.StatelessSessionFactory.create(StatelessSes
sionFactory.java:56)
       at org.ow2.util.pool.impl.JPool.get(JPool.java:256)
       at org.ow2.util.pool.impl.JPool.get(JPool.java:174)
       at org.ow2.easybeans.container.session.stateless.StatelessSessionFactory.getBean(StatelessSe
ssionFactory.java:111)
       at org.ow2.easybeans.container.session.stateless.StatelessSessionFactory.localCall(Stateless
SessionFactory.java:130)
       at org.ow2.easybeans.proxy.client.LocalCallInvocationHandler.invoke(LocalCallInvocationHandl
er.java:173)
       at $Proxy19.consume(Unknown Source)
       at org.easybeans.example.Activator._tx(Activator.java:46)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCom
mandInterpreter.java:150)
       at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java
:298)
       at org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:2
83)
       at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:219)
       at java.lang.Thread.run(Unknown Source)
 Gembin
 2009/3/2 Guillaume Sauthier <Guillaume.Sauthier@... <mailto:Guillaume.Sauthier@...>>




       }

       *and i did another test.*

       *bundle A  is seperated to 2 bundles API and Impl.*
       *in the API bundle i just export the package without Activator
       and in Impl Bundle i add org.ow2.easybeans.osgi.ejbjar.Activator*
       *when i start Bundle B, there is NoSuchFieldException thrown in
        class ServiceComposite* .


   Hi, the stack trace would be very helpful here :)
   --Guillaume





--
Gembin
My Blog: http://www.blogjava.net/gembin





--
Gembin
My Blog: http://www.blogjava.net/gembin


Re: Re: Re: How use EJB Service in another bundle

by Freitas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Gembi, 
     last year I created a small example with Ekke's help. 
I would like to share it with you.

I hope it helps on your development

Best Regards
Fernando Freitas


The email with the example that I have sent to this mailing list, follows below:



//----------------------------
----------------------------------------
Step 1

Follow the sequence of the blog of Ekke.

I've used a easybeans_target_minimal

http://ekkes-corner.blogspot.com/2008/06/easybeans-und-equinox.html

//------------------------------------------------------------------------

Step 2

Create two bundle/plugin projects:

ex..

br.com.test_ezb
    and
br.com.test_ezb_invoke

//-------------------------------------------------------------------------

  br.com.test_ezb

//----- Interface EJB

package br.com.test_ezb;

import javax.ejb.Local;
import javax.ejb.Remote;

@Local
@Remote
public interface Hello{
        public String sayHello(String str);
}

//--- Stateless EJB

package br.com.test_ezb;

import javax.ejb.Stateless;

@Stateless(mappedName="HelloBean")
public class HelloBean implements Hello{
        public String sayHello(String str){
                return str;
        }  
}



//---Manifest

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test_ezb3 Plug-in
Bundle-SymbolicName: br.com.test_ezb
Bundle-Version: 1.0.0
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Activator:  org.ow2.easybeans.osgi.ejbjar.Activator
Bundle-ActivationPolicy: lazy
Import-Package:  javax.ejb , org.ow2.easybeans.osgi.ejbjar , javax.annotation
Export-Package: br.com.test_ezb



//This bundle must have this Activator org.ow2.easybeans.osgi.ejbjar.Activator

//----------------------------------------------------------------------------------

br.com.test_ezb_invoke


//For this bundle to work, you must add in your easybeans_targed_minimal 
//this bundle  org.eclipse.osgi.source_3.4.0


//This bundle should have this Activator.
 
package br.com.test_ezb_invoke;

import javax.naming.Context;
import javax.naming.NamingException;
import java.util.Hashtable;
import javax.naming.InitialContext;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;


import br.com.test_ezb.Hello;

public class Activator implements BundleActivator {


      private static final String DEFAULT_INITIAL_CONTEXT_FACTORY = "org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory";
   

      private Hello hello = null;
     
      private static Context getInitialContext() throws NamingException {

            Hashtable<String, Object> env = new Hashtable<String, Object>();
            env.put(Context.INITIAL_CONTEXT_FACTORY, DEFAULT_INITIAL_CONTEXT_FACTORY);           
            return new InitialContext(env);}
     
     
    /*
     * (non-Javadoc)
     * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
     */
    public void start(BundleContext context) throws Exception {
              
       
        Context initialContext = getInitialContext();
        hello = (Hello) initialContext.lookup("HelloBean");
        System.out.println(hello.sayHello("Hello World"));     

    }

    /*
     * (non-Javadoc)
     * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
     */
    public void stop(BundleContext context) throws Exception {
    }

}

//--- manifest

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test_ezb_ivk2 Plug-in
Bundle-SymbolicName: br.com.test_ezb_invoke
Bundle-Version: 1.0.0
Bundle-Activator: br.com.test_ezb_invoke.Activator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: org.osgi.framework;version="1.3.0", javax.ejb, br.com.test_ezb, org.objectweb.carol.jndi.spi


//----------------------------------------------------

Step 3

 before your code is running you must be sure:
1) that EZB initializes all well

2) the EZB agent must be finished
3) and also Hibernate must be finsihed initiliazing

Console View



osgi> 29/10/08 15:22:09 (W) Activator.start : Cannot find User configuration (easybeans.xml) for Easybeans. Using default configuration
29/10/08 15:22:11 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-component-carol_1.0.2.jar/ [14]
29/10/08 15:22:12 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-component-jotm_1.0.2.jar/ [15]
INFO - 15:22:12 [B: org.ow2.easybeans.component.carol] - BundleEvent STARTED.
INFO - 15:22:12 [B: org.ow2.easybeans.component.jotm] - BundleEvent STARTED.
29/10/08 15:22:12 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-component-quartz_1.0.2.jar/ [2]
INFO - 15:22:12 [B: org.ow2.easybeans.component.quartz] - BundleEvent STARTED.
29/10/08 15:22:12 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-component-hsqldb_1.0.2.jar/ [6]
INFO - 15:22:12 [B: org.ow2.easybeans.component.hsqldb] - BundleEvent STARTED.
29/10/08 15:22:12 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-core_1.0.2.jar/ [10]
29/10/08 15:22:12 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-component-joram_1.0.2.jar/ [3]
INFO - 15:22:12 [B: org.ow2.easybeans.core] - BundleEvent STARTED.
29/10/08 15:22:12 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-component-jdbcpool_1.0.2.jar/ [5]
INFO - 15:22:12 [B: org.ow2.easybeans.component.joram] - BundleEvent STARTED.
INFO - 15:22:12 [B: org.ow2.easybeans.component.jdbcpool] - BundleEvent STARTED.
INFO - 15:22:12 [B: org.ow2.easybeans.agent] - BundleEvent STARTED.
INFO - 15:22:12 [S: org.ow2.easybeans.component.carol.carolcomponent] - ServiceEvent REGISTERED.
INFO - 15:22:12 [B: org.eclipse.osgi] - FrameworkEvent STARTLEVEL CHANGED.
INFO - 15:22:12 [S: org.ow2.easybeans.component.hsqldb.hsqldbcomponent] - ServiceEvent REGISTERED.
29/10/08 15:22:12 (I) TraceCarol.infoCarol : Name service for jrmp is started on port 1099
INFO - 15:22:13 [S: org.ow2.easybeans.component.carol.carolcomponent-1225300931396-1] - ServiceEvent REGISTERED.
INFO - 15:22:13 [S: org.ow2.easybeans.component.jotm.jotmcomponent] - ServiceEvent REGISTERED.
INFO - 15:22:13 [S: org.ow2.easybeans.component.quartz.quartzcomponent] - ServiceEvent REGISTERED.
INFO - 15:22:13 [S: org.ow2.easybeans.core] - ServiceEvent REGISTERED.
29/10/08 15:22:13 (I) EZBCoreService.activate : Activating EasyBeans/OSGi/Core
29/10/08 15:22:13 (I) PolicyProvider.init : Using EasyBeans policy provider 'org.ow2.easybeans.security.jacc.provider.JPolicy'.
29/10/08 15:22:13 (I) PolicyProvider.init : Using EasyBeans PolicyConfigurationFactory provider and EasyBeans Policy provider
29/10/08 15:22:14 (I) JMXRemoteHelper.init : Creating JMXRemote connector with URL 'service:jmx:rmi:///jndi/rmi://localhost:1099/EasyBeansConnector'
29/10/08 15:22:14 (I) Embedded.start : Startup of EasyBeans '1.0.2' was done in '1.017' ms.
INFO - 15:22:14 [S: null] - ServiceEvent REGISTERED.
29/10/08 15:22:14 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.carol.carolcomponent-1225300931396-1 created
INFO - 15:22:14 [S: org.ow2.easybeans.component.jdbcpool.jdbcpoolcomponent] - ServiceEvent REGISTERED.
29/10/08 15:22:14 (I) HSQLDBComponent.start : Starting 'HSQLDB server' '1.8.0' on port '9002'
29/10/08 15:22:15 (I) HSQLDBComponent.start : HSQLDB server started with URL jdbc:hsqldb:hsql://localhost:9002/jdbc_2
INFO - 15:22:15 [S: org.ow2.easybeans.component.hsqldb.hsqldbcomponent-1225300931643-5] - ServiceEvent REGISTERED.
29/10/08 15:22:15 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.hsqldb.hsqldbcomponent-1225300931643-5 created
29/10/08 15:22:15 (I) HSQLDBComponent.start : Starting 'HSQLDB server' '1.8.0' on port '9001'
29/10/08 15:22:15 (I) HSQLDBComponent.start : HSQLDB server started with URL jdbc:hsqldb:hsql://localhost:9001/jdbc_1
INFO - 15:22:15 [S: org.ow2.easybeans.component.hsqldb.hsqldbcomponent-1225300931600-4] - ServiceEvent REGISTERED.
29/10/08 15:22:15 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.hsqldb.hsqldbcomponent-1225300931600-4 created
29/10/08 15:22:15 (I) Current.<init> : JOTM 2.0.10
29/10/08 15:22:15 (I) JOTMComponent.start : Register javax.transaction.UserTransaction as transaction manager object
INFO - 15:22:15 [S: org.ow2.easybeans.component.jotm.jotmcomponent-1225300931470-2] - ServiceEvent REGISTERED.
INFO - 15:22:15 [S: org.ow2.easybeans.component.joram.joramcomponent] - ServiceEvent REGISTERED.
29/10/08 15:22:15 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.jotm.jotmcomponent-1225300931470-2 created
29/10/08 15:22:16 (I) QuartzScheduler.<init> : Quartz Scheduler v.1.6.0 created.
29/10/08 15:22:16 (I) RAMJobStore.initialize : RAMJobStore initialized.
29/10/08 15:22:16 (I) StdSchedulerFactory.instantiate : Quartz scheduler 'EasyBeans' initialized from an externally provided properties instance.
29/10/08 15:22:16 (I) StdSchedulerFactory.instantiate : Quartz scheduler version: 1.6.0
29/10/08 15:22:16 (I) QuartzScheduler.start : Scheduler EasyBeans_$_NON_CLUSTERED started.
INFO - 15:22:16 [S: org.ow2.easybeans.component.quartz.quartzcomponent-1225300930552-0] - ServiceEvent REGISTERED.
29/10/08 15:22:16 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.quartz.quartzcomponent-1225300930552-0 created
29/10/08 15:22:16 (I) JDBCPoolComponent.start : DS 'jdbc_1', URL 'jdbc:hsqldb:hsql://localhost:9001/jdbc_1', Driver = 'org.hsqldb.jdbcDriver'.
INFO - 15:22:16 [S: org.ow2.easybeans.component.jdbcpool.jdbcpoolcomponent-1225300931753-7] - ServiceEvent REGISTERED.
29/10/08 15:22:16 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.jdbcpool.jdbcpoolcomponent-1225300931753-7 created
29/10/08 15:22:16 (I) JDBCPoolComponent.start : DS 'jdbc_2', URL 'jdbc:hsqldb:hsql://localhost:9002/jdbc_2', Driver = 'org.hsqldb.jdbcDriver'.
INFO - 15:22:16 [S: org.ow2.easybeans.component.jdbcpool.jdbcpoolcomponent-1225300931796-8] - ServiceEvent REGISTERED.
29/10/08 15:22:16 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.jdbcpool.jdbcpoolcomponent-1225300931796-8 created
29/10/08 15:22:17 (I) JoramComponent.start : Joram version '5.0.9' started on localhost:16030. WorkManager[minTx=5,maxTx=100,txTimeout=60s]
INFO - 15:22:17 [S: org.ow2.easybeans.component.joram.joramcomponent-1225300931532-3] - ServiceEvent REGISTERED.
29/10/08 15:22:17 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.joram.joramcomponent-1225300931532-3 created
ss

Framework is launched.

id    State       Bundle
0    ACTIVE      org.eclipse.osgi_3.4.0.v20080529-1200
1    ACTIVE      org.eclipse.equinox.cm_1.0.0.v20080509-1800
2    ACTIVE      org.ow2.easybeans.component.quartz_1.0.2
3    ACTIVE      org.ow2.easybeans.component.joram_1.0.2
4    ACTIVE      org.eclipse.equinox.log_1.1.0.v20080414
5    ACTIVE      org.ow2.easybeans.component.jdbcpool_1.0.2
6    ACTIVE      org.ow2.easybeans.component.hsqldb_1.0.2
7    ACTIVE      org.eclipse.equinox.util_1.0.0.v20080414
8    ACTIVE      org.ow2.easybeans.agent_1.0.2
9    <<LAZY>>    br.com.test_ezb_1.0.0
10    ACTIVE      org.ow2.easybeans.core_1.0.2
11    <<LAZY>>    br.com.test_ezb_invoke_1.0.0
12    ACTIVE      org.eclipse.osgi.source_3.4.0.v20080529-1200
13    ACTIVE      org.eclipse.equinox.common_3.4.0.v20080421-2006
14    ACTIVE      org.ow2.easybeans.component.carol_1.0.2
15    ACTIVE      org.ow2.easybeans.component.jotm_1.0.2
16    ACTIVE      org.ow2.bundles.ow2-bundles-externals-commons-logging_1.0.5
17    ACTIVE      org.eclipse.equinox.ds_1.0.0.v20080427-0830
18    ACTIVE      org.eclipse.osgi.services_3.1.200.v20071203

osgi> start 9
29/10/08 15:22:45 (I) Activator.startContainer : Creating Container from the Bundle Archive 'bundleentry://9/'
29/10/08 15:22:46 (W) ContainerJNDIResolver.addJNDIName : Data already set for JNDIData[name=HelloBean, beanName=HelloBean] for the container URL bundleentry://9/.
29/10/08 15:22:46 (I) JContainer3.start : Container 'br.com.test_ezb' [1 SLSB, 0 SFSB, 0 MDB] started in 1.209 ms

osgi> INFO - 15:22:46 [S: null] - ServiceEvent REGISTERED.
INFO - 15:22:46 [B: br.com.test_ezb] - BundleEvent STARTED.
start 11
Hello World

osgi> INFO - 15:22:56 [B: br.com.test_ezb_invoke] - BundleEvent STARTED.

//----------------------------------------------------------------------------------------------------------------------------



Thanks and Regards
Fernando Freitas


Re: Re: Re: Re: How use EJB Service in another bundle

by gembin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi Fernando,

    thank you very much for your sharing :-)

Best Regards,

Gembin

2009/3/3 Fernando Freitas <nandows@...>
Hi Gembi, 
     last year I created a small example with Ekke's help. 
I would like to share it with you.

I hope it helps on your development

Best Regards
Fernando Freitas


The email with the example that I have sent to this mailing list, follows below:



//----------------------------
----------------------------------------
Step 1

Follow the sequence of the blog of Ekke.

I've used a easybeans_target_minimal

http://ekkes-corner.blogspot.com/2008/06/easybeans-und-equinox.html

//------------------------------------------------------------------------

Step 2

Create two bundle/plugin projects:

ex..

br.com.test_ezb
    and
br.com.test_ezb_invoke

//-------------------------------------------------------------------------

  br.com.test_ezb

//----- Interface EJB

package br.com.test_ezb;

import javax.ejb.Local;
import javax.ejb.Remote;

@Local
@Remote
public interface Hello{
        public String sayHello(String str);
}

//--- Stateless EJB

package br.com.test_ezb;

import javax.ejb.Stateless;

@Stateless(mappedName="HelloBean")
public class HelloBean implements Hello{
        public String sayHello(String str){
                return str;
        }  
}



//---Manifest

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test_ezb3 Plug-in
Bundle-SymbolicName: br.com.test_ezb
Bundle-Version: 1.0.0
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Activator:  org.ow2.easybeans.osgi.ejbjar.Activator
Bundle-ActivationPolicy: lazy
Import-Package:  javax.ejb , org.ow2.easybeans.osgi.ejbjar , javax.annotation
Export-Package: br.com.test_ezb



//This bundle must have this Activator org.ow2.easybeans.osgi.ejbjar.Activator

//----------------------------------------------------------------------------------

br.com.test_ezb_invoke


//For this bundle to work, you must add in your easybeans_targed_minimal 
//this bundle  org.eclipse.osgi.source_3.4.0


//This bundle should have this Activator.
 
package br.com.test_ezb_invoke;

import javax.naming.Context;
import javax.naming.NamingException;
import java.util.Hashtable;
import javax.naming.InitialContext;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;


import br.com.test_ezb.Hello;

public class Activator implements BundleActivator {


      private static final String DEFAULT_INITIAL_CONTEXT_FACTORY = "org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory";
   

      private Hello hello = null;
     
      private static Context getInitialContext() throws NamingException {

            Hashtable<String, Object> env = new Hashtable<String, Object>();
            env.put(Context.INITIAL_CONTEXT_FACTORY, DEFAULT_INITIAL_CONTEXT_FACTORY);           
            return new InitialContext(env);}
     
     
    /*
     * (non-Javadoc)
     * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
     */
    public void start(BundleContext context) throws Exception {
              
       
        Context initialContext = getInitialContext();
        hello = (Hello) initialContext.lookup("HelloBean");
        System.out.println(hello.sayHello("Hello World"));     

    }

    /*
     * (non-Javadoc)
     * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
     */
    public void stop(BundleContext context) throws Exception {
    }

}

//--- manifest

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test_ezb_ivk2 Plug-in
Bundle-SymbolicName: br.com.test_ezb_invoke
Bundle-Version: 1.0.0
Bundle-Activator: br.com.test_ezb_invoke.Activator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: org.osgi.framework;version="1.3.0", javax.ejb, br.com.test_ezb, org.objectweb.carol.jndi.spi


//----------------------------------------------------

Step 3

 before your code is running you must be sure:
1) that EZB initializes all well

2) the EZB agent must be finished
3) and also Hibernate must be finsihed initiliazing

Console View



osgi> 29/10/08 15:22:09 (W) Activator.start : Cannot find User configuration (easybeans.xml) for Easybeans. Using default configuration
29/10/08 15:22:11 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-component-carol_1.0.2.jar/ [14]
29/10/08 15:22:12 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-component-jotm_1.0.2.jar/ [15]
INFO - 15:22:12 [B: org.ow2.easybeans.component.carol] - BundleEvent STARTED.
INFO - 15:22:12 [B: org.ow2.easybeans.component.jotm] - BundleEvent STARTED.
29/10/08 15:22:12 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-component-quartz_1.0.2.jar/ [2]
INFO - 15:22:12 [B: org.ow2.easybeans.component.quartz] - BundleEvent STARTED.
29/10/08 15:22:12 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-component-hsqldb_1.0.2.jar/ [6]
INFO - 15:22:12 [B: org.ow2.easybeans.component.hsqldb] - BundleEvent STARTED.
29/10/08 15:22:12 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-core_1.0.2.jar/ [10]
29/10/08 15:22:12 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-component-joram_1.0.2.jar/ [3]
INFO - 15:22:12 [B: org.ow2.easybeans.core] - BundleEvent STARTED.
29/10/08 15:22:12 (I) Activator.start : Starting Bundle initial@reference:file:easybeans-component-jdbcpool_1.0.2.jar/ [5]
INFO - 15:22:12 [B: org.ow2.easybeans.component.joram] - BundleEvent STARTED.
INFO - 15:22:12 [B: org.ow2.easybeans.component.jdbcpool] - BundleEvent STARTED.
INFO - 15:22:12 [B: org.ow2.easybeans.agent] - BundleEvent STARTED.
INFO - 15:22:12 [S: org.ow2.easybeans.component.carol.carolcomponent] - ServiceEvent REGISTERED.
INFO - 15:22:12 [B: org.eclipse.osgi] - FrameworkEvent STARTLEVEL CHANGED.
INFO - 15:22:12 [S: org.ow2.easybeans.component.hsqldb.hsqldbcomponent] - ServiceEvent REGISTERED.
29/10/08 15:22:12 (I) TraceCarol.infoCarol : Name service for jrmp is started on port 1099
INFO - 15:22:13 [S: org.ow2.easybeans.component.carol.carolcomponent-1225300931396-1] - ServiceEvent REGISTERED.
INFO - 15:22:13 [S: org.ow2.easybeans.component.jotm.jotmcomponent] - ServiceEvent REGISTERED.
INFO - 15:22:13 [S: org.ow2.easybeans.component.quartz.quartzcomponent] - ServiceEvent REGISTERED.
INFO - 15:22:13 [S: org.ow2.easybeans.core] - ServiceEvent REGISTERED.
29/10/08 15:22:13 (I) EZBCoreService.activate : Activating EasyBeans/OSGi/Core
29/10/08 15:22:13 (I) PolicyProvider.init : Using EasyBeans policy provider 'org.ow2.easybeans.security.jacc.provider.JPolicy'.
29/10/08 15:22:13 (I) PolicyProvider.init : Using EasyBeans PolicyConfigurationFactory provider and EasyBeans Policy provider
29/10/08 15:22:14 (I) JMXRemoteHelper.init : Creating JMXRemote connector with URL 'service:jmx:rmi:///jndi/rmi://localhost:1099/EasyBeansConnector'
29/10/08 15:22:14 (I) Embedded.start : Startup of EasyBeans '1.0.2' was done in '1.017' ms.
INFO - 15:22:14 [S: null] - ServiceEvent REGISTERED.
29/10/08 15:22:14 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.carol.carolcomponent-1225300931396-1 created
INFO - 15:22:14 [S: org.ow2.easybeans.component.jdbcpool.jdbcpoolcomponent] - ServiceEvent REGISTERED.
29/10/08 15:22:14 (I) HSQLDBComponent.start : Starting 'HSQLDB server' '1.8.0' on port '9002'
29/10/08 15:22:15 (I) HSQLDBComponent.start : HSQLDB server started with URL jdbc:hsqldb:hsql://localhost:9002/jdbc_2
INFO - 15:22:15 [S: org.ow2.easybeans.component.hsqldb.hsqldbcomponent-1225300931643-5] - ServiceEvent REGISTERED.
29/10/08 15:22:15 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.hsqldb.hsqldbcomponent-1225300931643-5 created
29/10/08 15:22:15 (I) HSQLDBComponent.start : Starting 'HSQLDB server' '1.8.0' on port '9001'
29/10/08 15:22:15 (I) HSQLDBComponent.start : HSQLDB server started with URL jdbc:hsqldb:hsql://localhost:9001/jdbc_1
INFO - 15:22:15 [S: org.ow2.easybeans.component.hsqldb.hsqldbcomponent-1225300931600-4] - ServiceEvent REGISTERED.
29/10/08 15:22:15 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.hsqldb.hsqldbcomponent-1225300931600-4 created
29/10/08 15:22:15 (I) Current.<init> : JOTM 2.0.10
29/10/08 15:22:15 (I) JOTMComponent.start : Register javax.transaction.UserTransaction as transaction manager object
INFO - 15:22:15 [S: org.ow2.easybeans.component.jotm.jotmcomponent-1225300931470-2] - ServiceEvent REGISTERED.
INFO - 15:22:15 [S: org.ow2.easybeans.component.joram.joramcomponent] - ServiceEvent REGISTERED.
29/10/08 15:22:15 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.jotm.jotmcomponent-1225300931470-2 created
29/10/08 15:22:16 (I) QuartzScheduler.<init> : Quartz Scheduler v.1.6.0 created.
29/10/08 15:22:16 (I) RAMJobStore.initialize : RAMJobStore initialized.
29/10/08 15:22:16 (I) StdSchedulerFactory.instantiate : Quartz scheduler 'EasyBeans' initialized from an externally provided properties instance.
29/10/08 15:22:16 (I) StdSchedulerFactory.instantiate : Quartz scheduler version: 1.6.0
29/10/08 15:22:16 (I) QuartzScheduler.start : Scheduler EasyBeans_$_NON_CLUSTERED started.
INFO - 15:22:16 [S: org.ow2.easybeans.component.quartz.quartzcomponent-1225300930552-0] - ServiceEvent REGISTERED.
29/10/08 15:22:16 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.quartz.quartzcomponent-1225300930552-0 created
29/10/08 15:22:16 (I) JDBCPoolComponent.start : DS 'jdbc_1', URL 'jdbc:hsqldb:hsql://localhost:9001/jdbc_1', Driver = 'org.hsqldb.jdbcDriver'.
INFO - 15:22:16 [S: org.ow2.easybeans.component.jdbcpool.jdbcpoolcomponent-1225300931753-7] - ServiceEvent REGISTERED.
29/10/08 15:22:16 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.jdbcpool.jdbcpoolcomponent-1225300931753-7 created
29/10/08 15:22:16 (I) JDBCPoolComponent.start : DS 'jdbc_2', URL 'jdbc:hsqldb:hsql://localhost:9002/jdbc_2', Driver = 'org.hsqldb.jdbcDriver'.
INFO - 15:22:16 [S: org.ow2.easybeans.component.jdbcpool.jdbcpoolcomponent-1225300931796-8] - ServiceEvent REGISTERED.
29/10/08 15:22:16 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.jdbcpool.jdbcpoolcomponent-1225300931796-8 created
29/10/08 15:22:17 (I) JoramComponent.start : Joram version '5.0.9' started on localhost:16030. WorkManager[minTx=5,maxTx=100,txTimeout=60s]
INFO - 15:22:17 [S: org.ow2.easybeans.component.joram.joramcomponent-1225300931532-3] - ServiceEvent REGISTERED.
29/10/08 15:22:17 (I) EZBComponentServiceFactory.updated : Component with pid org.ow2.easybeans.component.joram.joramcomponent-1225300931532-3 created
ss

Framework is launched.

id    State       Bundle
0    ACTIVE      org.eclipse.osgi_3.4.0.v20080529-1200
1    ACTIVE      org.eclipse.equinox.cm_1.0.0.v20080509-1800
2    ACTIVE      org.ow2.easybeans.component.quartz_1.0.2
3    ACTIVE      org.ow2.easybeans.component.joram_1.0.2
4    ACTIVE      org.eclipse.equinox.log_1.1.0.v20080414
5    ACTIVE      org.ow2.easybeans.component.jdbcpool_1.0.2
6    ACTIVE      org.ow2.easybeans.component.hsqldb_1.0.2
7    ACTIVE      org.eclipse.equinox.util_1.0.0.v20080414
8    ACTIVE      org.ow2.easybeans.agent_1.0.2
9    <<LAZY>>    br.com.test_ezb_1.0.0
10    ACTIVE      org.ow2.easybeans.core_1.0.2
11    <<LAZY>>    br.com.test_ezb_invoke_1.0.0
12    ACTIVE      org.eclipse.osgi.source_3.4.0.v20080529-1200
13    ACTIVE      org.eclipse.equinox.common_3.4.0.v20080421-2006
14    ACTIVE      org.ow2.easybeans.component.carol_1.0.2
15    ACTIVE      org.ow2.easybeans.component.jotm_1.0.2
16    ACTIVE      org.ow2.bundles.ow2-bundles-externals-commons-logging_1.0.5
17    ACTIVE      org.eclipse.equinox.ds_1.0.0.v20080427-0830
18    ACTIVE      org.eclipse.osgi.services_3.1.200.v20071203

osgi> start 9
29/10/08 15:22:45 (I) Activator.startContainer : Creating Container from the Bundle Archive 'bundleentry://9/'
29/10/08 15:22:46 (W) ContainerJNDIResolver.addJNDIName : Data already set for JNDIData[name=HelloBean, beanName=HelloBean] for the container URL bundleentry://9/.
29/10/08 15:22:46 (I) JContainer3.start : Container 'br.com.test_ezb' [1 SLSB, 0 SFSB, 0 MDB] started in 1.209 ms

osgi> INFO - 15:22:46 [S: null] - ServiceEvent REGISTERED.
INFO - 15:22:46 [B: br.com.test_ezb] - BundleEvent STARTED.
start 11
Hello World

osgi> INFO - 15:22:56 [B: br.com.test_ezb_invoke] - BundleEvent STARTED.

//----------------------------------------------------------------------------------------------------------------------------



Thanks and Regards
Fernando Freitas




--
Gembin
My Blog: http://www.blogjava.net/gembin