[forge-dev] Scaffolding and class loading

Luca Masini luca.masini at gmail.com
Tue Dec 4 09:04:34 EST 2012


Ok, I've found the problem, is with the "SimpleResourceResolver" that tries
to locate resources in a context where those are not available.

This works fine with the faces scaffold because it is part of the forge
standard modules (I think.....).

Any comments or better explanation ??



2012/12/4 Luca Masini <luca.masini at gmail.com>

> Hi guys, I'm facing a strange problem. Inside a facet which is a scaffold
> provider I need to load a resource for MetaWidget. I can see printing this
> from the method that needs the resource
>
>
> this.getClass().getClassLoader().getResource("scaffold/errai/metawidget-formbean.xml")
>
> that the file is available:
>
>
> file:/Users/lucamasini/.forge/plugins/org/jboss/forge/forge-scaffold-errai/1.0.6-SNAPSHOT-e0a249f3-6fe7-4ea1-8fd9-680f8e422af4/forge-scaffold-errai.jar!/scaffold/errai/metawidget-formbean.xml
>
> but inside the SimpleResourceResolver neither:
>
> ClassLoader loaderContext = Thread.currentThread().getContextClassLoader();
>
> or:
>
> InputStream stream = getClass().getResourceAsStream( resource );
>
> can find the resource because the "forge-scaffold-errai.jar" is not one of
> the JAR used by the current classloader (which is a JBoss's
> ModuleClassloader).
>
> The current implementation of scaffolding for faces works because is
> inside the forge itself, but I think we have some problems using it in an
> external plugin.
>
> Do you think I need to declare it in some kind of manifest ??
>
> Thank you
> L.
>
> --
> ****************************************
> http://www.lucamasini.net
> http://twitter.com/lmasini
> http://www.linkedin.com/pub/luca-masini/7/10/2b9
> ****************************************
>



-- 
****************************************
http://www.lucamasini.net
http://twitter.com/lmasini
http://www.linkedin.com/pub/luca-masini/7/10/2b9
****************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20121204/21145391/attachment.html 


More information about the forge-dev mailing list