users@glassfish.java.net

Re: OSGI Bundle and Domain Lib jar problem

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Thu, 05 Jan 2012 06:39:40 +0530

No, there is no way you can configure OSGi runtime in GlassFish to
export packages coming from domain/lib or glassfish/lib dir. Your only
choice is to package the EJB interfaces in the bundle where you are
consuming the EJBs. Since you said you are looking up the EJBs using
JNDI, those EJBs must be remote EJBs. In this case, you don't even have
to export the interface classes from the client bundle, as RMI/IIOP does
not require the client and server to use the same class object. You have
to add "DynamicImport-Package: *" for JNDI lookup of remote EJBs to work
in the client bundle, as the JNDI lookup results in generation of some
proxy classes at runtime that have dependency on GlassFish ejb container.

Thanks,
Sahoo
On Thursday 05 January 2012 02:07 AM, forums_at_java.net wrote:
> Hi Ladies and Gentlemen,
>
> I need your help on the following situation:
>
> I have a J2EE application deployed in a glassfish domain that has some
> jars
> in the domain\lib folder.
>
> Those jars register beans to the app server.
>
> In addition, I have some bundles deployed to the same domain.
>
> In those bundles i'm interested in consuming the EJBs registered via
> on the
> same domain.
>
> The problem I encounter is that even though i'm getting an instance of
> the
> EJB when i'm running the jndi lookup, an exception is thrown as soon
> as I'm
> casting the instance into the class type.
>
>
>
> *A little about the environment:*
>
> * The bundle imports the packages of the bean
>
> * The bean packages are exported as part of the config.properties. ( i am
> using the org.osgi.framework.system.packages.extra property to specify
> all
> the packages required from the bean)
>
> The org.osgi.framework.bundle.parent=app (by the way, i'm wondering
> what is
> the different between app and framework setting here)
>
>
>
> Any help would be highly appreciated..
>
> Thank you
>
>
> --
>
> [Message sent by forum member 'asaflahav']
>
> View Post: http://forums.java.net/node/880045
>
>