First off, just to make sure it's clear: I've never worked with Eclipse RAP, or
even the RCP. I'm not sure how some of these concepts are going to translate to
it. For our application, we control starting/stopping Felix/Equinox ourselves,
and we're able to make direct use of their configuration properties to modify
the FRAMEWORK_BOOTDELEGATION packages, which we use to push access to Shiro's
classes up into the parent classloader for our bundles (and the ultimate parent
classloader is our webapp's loader).
I'm assuming you're getting the Shiro jar susing Maven, or that you have
downloaded it yourself. The first thing I'd try would be to modify the
MANIFEST.MF in that and add the following OSGi directive:
Fragment-Host: system.bundle; extension:=framework
(See
http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Constants.html#EXTENSION_DIRECTIVE)
This should configure the Shiro jars (shiro-core, more specifically, and you
may have to modify shiro-web as well it sounds like) to load as OSGi fragment
bundles and attach to the system bundles. This is how, from what I see online,
core libraries like javax.servlet are configured for RAP.
Beyond this, I really don't know much more. Maybe somewhere in the RAP
documentation it details how to modify its FRAMEWORK_BOOTDELEGATION,
FRAMEWORK_SYSTEMPACKAGES and/or FRAMEWORK_SYSTEMPACKAGES_EXTRA properties, or
provides another way to augment the system bundles for the bridge.
Best regards,
Bryan Turner
> From: [email protected]
> To: [email protected]
> Subject: Re: Cant access subject with Eclipse RAP
> Date: Mon, 10 Jan 2011 17:41:03 -0800
> CC: [email protected]
>
> On Monday, January 10, 2011, Bryan Turner wrote:
> > Yes, we are deploying our OSGi container inside Tomcat (or Jetty, depending
> > on the day). The important distinction may be that we are not loading
> > Shiro as an OSGi bundle. It is a classpath dependency of our webapp
> > itself. When we start Felix (or Equinox), we export Shiro from the jars in
> > the webapp's classpath as a set of system-level bundles--common to the
> > entire OSGi container and available in every classloader.
> >
> > Best regards,
> > Bryan Turner
>
> That sounds like it should work for me, too. Can you elaborate a bit in more
> detail how you actually achieve this?
>
>
> Lothar