Ok, I&#39;ve found the problem, is with the &quot;SimpleResourceResolver&quot; that tries to locate resources in a context where those are not available.<div><br></div><div>This works fine with the faces scaffold because it is part of the forge standard modules (I think.....).</div>

<div><br></div><div>Any comments or better explanation ??</div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/12/4 Luca Masini <span dir="ltr">&lt;<a href="mailto:luca.masini@gmail.com" target="_blank">luca.masini@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi guys, I&#39;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 <div>

<br></div><div>                this.getClass().getClassLoader().getResource(&quot;scaffold/errai/metawidget-formbean.xml&quot;)</div>
<div><br></div><div>that the file is available:<br></div><div><br></div><div>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</div>



<div><br></div><div>but inside the SimpleResourceResolver neither:</div><div><br></div><div><div><span style="white-space:pre-wrap">                </span>ClassLoader loaderContext = Thread.currentThread().getContextClassLoader();</div>


<div><br></div><div><span style="white-space:pre-wrap">or:</span></div><div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">                </span>InputStream stream = getClass().getResourceAsStream( resource );</div>


<div><br></div><div>can find the resource because the &quot;forge-scaffold-errai.jar&quot; is not one of the JAR used by the current classloader (which is a JBoss&#39;s ModuleClassloader).</div><div><br></div><div>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.</div>


<div><br></div><div>Do you think I need to declare it in some kind of manifest ??</div><div><br></div><div>Thank you</div><span class="HOEnZb"><font color="#888888"><div>L.</div><div><br></div>-- <br>****************************************<br>

<a href="http://www.lucamasini.net" target="_blank">http://www.lucamasini.net</a><br>
<a href="http://twitter.com/lmasini" target="_blank">http://twitter.com/lmasini</a><br>
<a href="http://www.linkedin.com/pub/luca-masini/7/10/2b9" target="_blank">http://www.linkedin.com/pub/luca-masini/7/10/2b9</a><br>****************************************<br>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>****************************************<br><a href="http://www.lucamasini.net">http://www.lucamasini.net</a><br><a href="http://twitter.com/lmasini">http://twitter.com/lmasini</a><br>

<a href="http://www.linkedin.com/pub/luca-masini/7/10/2b9">http://www.linkedin.com/pub/luca-masini/7/10/2b9</a><br>****************************************<br>
</div>