<p dir="ltr">Ivan, </p>
<p dir="ltr">Remove the addClass(ProjectFactory.class) from your test. This is provided by the projects addon, so you can&#39;t do that.</p>
<div class="gmail_quote">Em 16/08/2015 03:41, &quot;Ivan St. Ivanov&quot; &lt;<a href="mailto:ivan.st.ivanov@gmail.com">ivan.st.ivanov@gmail.com</a>&gt; escreveu:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks, Gastaldi!<div><br></div><div>I added a new branch for the test:</div><div><br></div><div><a href="https://github.com/bgjug/spring-boot-forge-addon/tree/BOOT-FORGE-9" target="_blank">https://github.com/bgjug/spring-boot-forge-addon/tree/BOOT-FORGE-9</a><br></div><div><br></div><div>Cheers,</div><div>Ivan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 16, 2015 at 12:49 AM, George Gastaldi <span dir="ltr">&lt;<a href="mailto:ggastald@redhat.com" target="_blank">ggastald@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">This is really odd. Can you push this changes to the addon github repository? I&#39;ll try to debug it during the week.</p><div><div>
<div class="gmail_quote">Em 15/08/2015 18:05, &quot;Ivan St. Ivanov&quot; &lt;<a href="mailto:ivan.st.ivanov@gmail.com" target="_blank">ivan.st.ivanov@gmail.com</a>&gt; escreveu:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I removed the dependency to core and added to some other addons that we depend on. Attached is the new pom.xml.<div><br></div><div>The exception when I run the test still exists. I cleaned up the .forge directory and installed the addon. And it is the only thing that goes in the addons directory.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 15, 2015 at 11:34 PM, George Gastaldi <span dir="ltr">&lt;<a href="mailto:ggastald@redhat.com" target="_blank">ggastald@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">It looks like your addon might be bundling classes that shouldn&#39;t be there. Try installing your addon in forge and see what goes in your ~/.forge/addons.</p>
<p dir="ltr">Also try removing the dependency to core (as it is not needed).</p><div><div>
<div class="gmail_quote">Em 15/08/2015 17:09, &quot;Ivan St. Ivanov&quot; &lt;<a href="mailto:ivan.st.ivanov@gmail.com" target="_blank">ivan.st.ivanov@gmail.com</a>&gt; escreveu:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi George,<div><br></div><div>I am afraid this did not help. Here is the exception again:</div><div><br></div><div><div><font face="monospace, monospace" size="1">Caused by: java.lang.LinkageError: loader constraint violation: when resolving overridden method &quot;org.jboss.forge.addon.springboot.ui.SpringBootSetupCommand.getProjectFactory()Lorg/jboss/forge/addon/projects/ProjectFactory;&quot; the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/jboss/forge/addon/springboot/ui/SpringBootSetupCommand, and its superclass loader (instance of org/jboss/modules/ModuleClassLoader), have different Class objects for the type tupCommand.getProjectFactory()Lorg/jboss/forge/addon/projects/ProjectFactory; used in the signature</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.lang.Class.getDeclaredMethods0(Native Method)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.lang.Class.getDeclaredMethods(Class.java:1860)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.lang.Class.getEnclosingMethod(Class.java:937)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.util.reflection.Reflections.isNonStaticInnerClass(Reflections.java:401)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.util.Beans.isTypeManagedBeanOrDecoratorOrInterceptor(Beans.java:492)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.bootstrap.BeanDeployer.createClassBean(BeanDeployer.java:213)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.bootstrap.BeanDeployer.createClassBeans(BeanDeployer.java:191)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:262)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:373)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:83)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.environment.se.Weld.initialize(Weld.java:134)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.forge.furnace.container.cdi.lifecycle.WeldAddonLifecycleProvider.start(WeldAddonLifecycleProvider.java:77)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.forge.furnace.impl.addons.AddonRunnable$2.call(AddonRunnable.java:92)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.forge.furnace.impl.addons.AddonRunnable$2.call(AddonRunnable.java:86)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.forge.furnace.impl.addons.AddonRunnable.run(AddonRunnable.java:85)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.util.concurrent.FutureTask.run(FutureTask.java:262)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.lang.Thread.run(Thread.java:745)</font></div></div><div><br></div><div>Cheers,</div><div>Ivan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 15, 2015 at 10:42 PM, George Gastaldi <span dir="ltr">&lt;<a href="mailto:ggastald@redhat.com" target="_blank">ggastald@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">I think the solution in your case is to remove the provided scope from your addons. </p>
<p dir="ltr">Here is where this is better explained : <a href="https://github.com/forge/core/blob/master/README.asciidoc#what-scope-should-my-addon-dependencies-be" target="_blank">https://github.com/forge/core/blob/master/README.asciidoc#what-scope-should-my-addon-dependencies-be</a></p>
<p dir="ltr">Best Regards,</p>
<p dir="ltr">George Gastaldi</p>
<div class="gmail_quote"><div><div>Em 15/08/2015 16:28, &quot;Ivan St. Ivanov&quot; &lt;<a href="mailto:ivan.st.ivanov@gmail.com" target="_blank">ivan.st.ivanov@gmail.com</a>&gt; escreveu:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hi folks,<div><br></div><div>I am now working on a test of the Spring Boot addon setup command. I was really happy with the changes that you did in the Forge test infrastructure that allow avoiding listing all the addons that my command depends on in the @AddonDependencies annotation as well as repeating some of them in the deployment method body. I was finally able to <a href="https://github.com/forge/core/blob/master/javaee/tests/src/test/java/org/jboss/forge/addon/javaee/security/ui/AbstractSecurityCommandTest.java" target="_blank">write tests like that</a>:</div><div><pre style="color:rgb(0,0,0);font-family:Inconsolata"><font size="4"><span style="color:rgb(128,128,0)">@Deployment<br></span><span style="color:rgb(128,128,0)">@AddonDependencies<br></span><span style="color:rgb(0,0,128);font-weight:bold">public static </span>AddonArchive getDeployment()<br>{<br>   <span style="color:rgb(0,0,128);font-weight:bold">return </span>ShrinkWrap<br>            .<span style="font-style:italic">create</span>(AddonArchive.<span style="color:rgb(0,0,128);font-weight:bold">class</span>)<br>            .addBeansXML()<br>            .addClass(ProjectHelper.<span style="color:rgb(0,0,128);font-weight:bold">class</span>)<br>            .addClass(AbstractSecurityCommandTest.<span style="color:rgb(0,0,128);font-weight:bold">class</span>);<br>}</font><span style="font-size:16.5pt"><br></span></pre></div><div>So I tried the same thing with the <a href="https://github.com/bgjug/spring-boot-forge-addon" target="_blank">Spring Boot addon</a> that we started developing in our JUG. However the test failed. I have attached both the test and the whole log file. I will here just paste the exception that stands out:</div><div><br></div><div><div><font face="monospace, monospace" size="1">Caused by: java.lang.LinkageError: loader constraint violation: when resolving overridden method &quot;org.jboss.forge.addon.springboot.ui.SpringBootSetupCommand.getProjectFactory()Lorg/jboss/forge/addon/projects/ProjectFactory;&quot; the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/jboss/forge/addon/springboot/ui/SpringBootSetupCommand, and its superclass loader (instance of org/jboss/modules/ModuleClassLoader), have different Class objects for the type tupCommand.getProjectFactory()Lorg/jboss/forge/addon/projects/ProjectFactory; used in the signature</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.lang.Class.getDeclaredMethods0(Native Method)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.lang.Class.getDeclaredMethods(Class.java:1860)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.lang.Class.getEnclosingMethod(Class.java:937)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.util.reflection.Reflections.isNonStaticInnerClass(Reflections.java:401)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.util.Beans.isTypeManagedBeanOrDecoratorOrInterceptor(Beans.java:492)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.bootstrap.BeanDeployer.createClassBean(BeanDeployer.java:213)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.bootstrap.BeanDeployer.createClassBeans(BeanDeployer.java:191)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:262)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:373)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:83)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.weld.environment.se.Weld.initialize(Weld.java:134)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.forge.furnace.container.cdi.lifecycle.WeldAddonLifecycleProvider.start(WeldAddonLifecycleProvider.java:77)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.forge.furnace.impl.addons.AddonRunnable$2.call(AddonRunnable.java:92)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.forge.furnace.impl.addons.AddonRunnable$2.call(AddonRunnable.java:86)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at org.jboss.forge.furnace.impl.addons.AddonRunnable.run(AddonRunnable.java:85)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.util.concurrent.FutureTask.run(FutureTask.java:262)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)</font></div><div><font face="monospace, monospace" size="1"><span style="white-space:pre-wrap">        </span>at java.lang.Thread.run(Thread.java:745)</font></div></div><div><br></div><div>What I see different between the spring boot addon and the java ee addon, where the referenced test belongs to, is that our addon has its pom.xml dependencies in <i>provided</i> scope. </div><div><br></div><div>Is that the possible cause? Would you please give us advise how to write tests outside the core addons?</div><div><br></div><div>Thanks and regards,</div><div>Ivan</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" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></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" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></div><br></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" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></div>
</div></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" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></div><br></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" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></div>
</div></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" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></div><br></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" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></div>