users@glassfish.java.net

Re: lookup ejb (not a bundle) that deploy on the server from a bundle

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Wed, 21 Dec 2011 12:20:29 +0530

Hi Eyal,

The simple solution would be to turn the app with ejb into an OSGi
bundle as described in section #5 of [1]. Let me know if that's not
acceptable. Then we can try finding alternatives.

Sahoo

[1] http://glassfish.java.net/public/GF-OSGi-Features.pdf

On Wednesday 21 December 2011 12:03 PM, forums_at_java.net wrote:
> Hi Sahoo,
>
> we have two type of application on the same glassfish, one is an
> regular JEE
> Application with an exposed EJB and the second is Bundle inside the Felix
> framework (inside the glassfish server)
>
> now I am trying to lookup (with InitialContext) one of the EJB that
> exposed
> in the JEE app from the bundle.
>
> I tried to do it in several way none of them worked:
>
> 1- including the jar that exposed the EJB in the bundle (additional
> to the
> (ejb) jar that in the JEE app) -
>
> result: when I get the bean and try to cast it to the interface I got
> ClassCastException (another situation that also show up in this use case,
> is that the bundle try to load again the bean that already exist and get
> collision)
>
> 2- define the jar only as 'provided' inside the pom.xml
>
> result: the deploy passed ok but in run time I am getting
> ClassNotFoundError
> (even that I add the package to the osgi.system.framework list)
>
> Thanks In advance
>
> Eyal
>
>
>
>
>
> --
>
> [Message sent by forum member 'elevy30']
>
> View Post: http://forums.java.net/node/875956
>
>