deltaspike-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John D. Ament" <john.d.am...@gmail.com>
Subject Re: Running deltaspike example in OSGi
Date Tue, 22 Jan 2013 12:31:15 GMT
HI Guillaume,

Perhaps it's best to move this discussion over to the weld forums
https://community.jboss.org/en/weld?view=discussions
However, I think perhaps doing this could cause some issues (potential
security problems).  Think about this.  If Weld added every extension it
found that you were dependent on, who's to say you wouldn't accidentally
activate a malicious extension?  I have a similar project structure, except
we're using Seam 3 and JBoss Modules.  You can activate all of the
extensions you want if you just list them in your module's
META-INF/services/javax.enterprise.inject.spi.Extension.  This is a more
portable solution when you're not putting your dependencies in your bean
archive.  (Now granted I'm not 100% sure this fixes your specific issue,
have to look at how this extension is built to ensure it's not expecting to
be in the bean archive).

John


On Tue, Jan 22, 2013 at 5:50 AM, Guillaume Nodet <gnodet@gmail.com> wrote:

> No, it's actually more complicated than that I think.
> The findEntries does not take Require-Bundle into account.
> I've raised https://issues.jboss.org/browse/WELD-1309
>
> We could leverage Require-Bundle and add the extensions in required bundles
> to the cdi container, but I'm not sure Require-Bundle is the best way.  The
> reason is that Require-Bundle has a real OSGi purpose and there may be
> cases where you need a Require-Bundle without wanting this side effect.
> Maybe a specific manifest header would be better, or even use the OSGi
> registry to expose Extension as OSGi services for bundles that act as
> extensions libraries such as Deltaspike.
>
>
> On Tue, Jan 22, 2013 at 11:33 AM, Charles Moulliard <ch007m@gmail.com
> >wrote:
>
> > Guillaume,
> >
> > Problem should be fixed in weld-osgi project where we should replace
> > bundle.getResources() with
> > bundle.findEntries().
> >
> >
> > On Tue, Jan 22, 2013 at 10:42 AM, Guillaume Nodet <gnodet@gmail.com>
> > wrote:
> >
> > > @Charles, I'm trying to deploy the jse-example from the deltaspike
> source
> > > code
> > >
> > >
> > >
> >
> https://github.com/apache/incubator-deltaspike/tree/master/deltaspike/examples/jse-examples
> > >
> > > @Romain  I'll double check, but given this is the only bit in the
> example
> > > that does not work, i don't think it's a classloader issue.
> > > I've debugged a bit and the problem seems to come from the fact that
> the
> > > deltaspike extensions are not loaded correctly.
> > > I think this is because weld-osgi uses the bundle.getResources()
> instead
> > of
> > > bundle.findEntries() to discover extensions.
> > > In my case, in order to have the deltaspike extensions loaded, I added
> a
> > > Require-Bundle header on the test bundle to point to the deltaspike
> > > implementation bundle.
> > > Unfortunately, getResources() uses the class space and thus the
> > deltaspike
> > > META-INF/services/javax.enterprise.inject.spi.Extension is shadowed by
> > the
> > > one in the bundle.
> > >
> > > Am I doing something wrong with the Require-Bundle or is that a bug in
> > > weld-osgi ?
> > > I'd be happy to provide a patch for any issue.
> > >
> > >
> > > On Tue, Jan 22, 2013 at 9:42 AM, Romain Manni-Bucau
> > > <rmannibucau@gmail.com>wrote:
> > >
> > > > Hi,
> > > >
> > > > can you check in the Validator the classloader(s) of @ConfigProperty?
> > > > wonder if both (scanned one from weld and the one from the app)
> aren't
> > > > different.
> > > >
> > > > 2013/1/22 Guillaume Nodet <gnodet@gmail.com>
> > > >
> > > > > ConfigProperty
> > > >
> > > >
> > > >
> > > >
> > > > *Romain Manni-Bucau*
> > > > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > > > *Blog: **http://rmannibucau.wordpress.com/*<
> > > > http://rmannibucau.wordpress.com/>
> > > > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > > > *Github: https://github.com/rmannibucau*
> > > >
> > >
> > >
> > >
> > > --
> > > ------------------------
> > > Guillaume Nodet
> > > ------------------------
> > > Blog: http://gnodet.blogspot.com/
> > > ------------------------
> > > FuseSource, Integration everywhere
> > > http://fusesource.com
> > >
> >
> >
> >
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> >
>
>
>
> --
> ------------------------
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> FuseSource, Integration everywhere
> http://fusesource.com
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message