[forge-dev] Project injection issue in a plugin and classloader

Lincoln Baxter, III lincolnbaxter at gmail.com
Tue Aug 28 10:57:09 EDT 2012


You can also try this configuration setting:

http://forge.jboss.org/docs/plugin_development/reference-libraries.html

To ensure all dependency libraries are loaded from the same classloader.

~Lincoln

On Fri, Aug 3, 2012 at 4:53 AM, Thomas Frühbeck <fruehbeck at aon.at> wrote:

>  Hello Jeremie,
>
> this looks like a "modularity" issue. The JBoss Modules class loading
> seems not to be exporting all the dependencies you require.
> I frequently ran into such problems when using classes that where not
> registered with Forge runtime.
> During standalone unit tests the modularity restrictions are not yet
> active, so you will not recognize the issue early.
> I couldnt go into details of your code but I would suspect something like:
>
>
> import org.apache.maven.model.Model;
>
>
> in EclipsePluginFacetImpl.java
>
> During plugin installation the dependencies of your plugin are rewritten
> to the allowed modules, you can verify this by having a look into the
> module.xml of your plugin after installation. If the classes cannot be
> resolved the facet will be silently ignored :-/
> Try to stick to the registered and exported classes of Forge runtime.
>
> Thomas
>
>  Am 03.08.2012 08:32, schrieb Jérémie:
>
> Hi all,
>
>  I want to inject the current project in my plugin.
> This works well when running my unit tests, but not after installation via
> "forge source-plugin" or "forge git-plugin".
>
>  This problem seems to come from a different classloader for the
> "javax.inject.Inject" class.
> At line 221 in org.jboss.weld.util.Bean:          for (WeldField<?, ?>
> annotatedField : t.getDeclaredWeldFields(Inject.class))
> We have Inject class with a different classloader of the key used in the
> map.
>
>  My code can be found here : https://github.com/jerr/forge-eclipse-plugins
>
>  The modules installed into the $${home}/.forge directory seem loaded
> beings in a different classloader.
>
>  Do you have a good practice for this?
> Thank you for your help.
>
>
>  Jeremie.
>
>
> _______________________________________________
> forge-dev mailing listforge-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/forge-dev
>
>
>
>
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>
>


-- 
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20120828/8c201fcf/attachment.html 


More information about the forge-dev mailing list