Right now if it works, do it. That&#39;s probably the only best practice I can give you for the Scaffold in Forge 1. It&#39;s really not a great design (my fault.) But it was also never designed to go this far without being re-written :) Most likely, we will need to wait to address this in Forge 2.<br>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Dec 6, 2012 at 3:06 PM, Luca Masini <span dir="ltr">&lt;<a href="mailto:luca.masini.mailing.list@gmail.com" target="_blank">luca.masini.mailing.list@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I used another approach, I overrided the <div><br></div><div>lookupClass( String className, ClassLoader classLoader )<br>
</div><div><br></div><div>in BaseConfigReader to lookup also in the current class ClassLoader, and this solved the problem (the Scaffolding class is always into the module ClassLoader).</div>

<div><br></div><div>But I would like to have a suggestion about the best approach, any suggestion ?</div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/12/6 Lincoln Baxter, III <span dir="ltr">&lt;<a href="mailto:lincolnbaxter@gmail.com" target="_blank">lincolnbaxter@gmail.com</a>&gt;</span><div>
<div class="h5"><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Well... we know this is a problem in Forge 1, which is one of the big reasons we are working on Forge 2. But you might want to take a look at the Spring MVC scaffold, which had to overcome this same issue: <br>


<br><a href="https://github.com/forge/plugin-spring-mvc/blob/master/src/main/java/org/jboss/forge/scaffold/spring/SpringScaffold.java#L208" target="_blank">https://github.com/forge/plugin-spring-mvc/blob/master/src/main/java/org/jboss/forge/scaffold/spring/SpringScaffold.java#L208</a><br>



<br>Note the special template resolver.<br><br>~Lincoln<br><br>PS. Sorry for the late reply.<br><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Tue, Dec 4, 2012 at 9:04 AM, Luca Masini <span dir="ltr">&lt;<a href="mailto:luca.masini@gmail.com" target="_blank">luca.masini@gmail.com</a>&gt;</span> wrote:<br>



</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>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><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><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" 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>
</div>
</div></div><br></div></div>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>&quot;Simpler is better.&quot;<br>


</font></span></div>
<br>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
<br></blockquote></div></div></div><div><div class="h5"><br><br clear="all"><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>
</div></div></div>
<br>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>&quot;Simpler is better.&quot;<br>
</div>