<p dir="ltr">Hi Rafael,</p>
<p dir="ltr">It seems that the following dependency needs to be removed:</p>
<p dir="ltr">&lt;dependency&gt;<br>
            &lt;groupId&gt;org.glassfish&lt;/groupId&gt;<br>
            &lt;artifactId&gt;javax.json&lt;/artifactId&gt;<br>
            &lt;version&gt;1.0.4&lt;/version&gt;<br>
        &lt;/dependency&gt;</p>
<p dir="ltr">Let me know how it goes.</p>
<div class="gmail_quote">Em 12/10/2015 01:13, &quot;Rafael Pestano&quot; &lt;<a href="mailto:rmpestano@gmail.com">rmpestano@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"><div><div><div><div>Hi everyone,<br><br></div>I&#39;m trying to manipulate json files using parser-json addon. I can save files but when I try to read them I receive a (classpath?) error:<br><br>Caused by: java.lang.LinkageError: loader constraint violation: when resolving interface method &quot;org.jboss.forge.addon.parser.json.resource.JsonResource.getJsonObject()Ljavax/json/JsonObject;&quot; the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, com/github/forge/addon/music/PlaylistManager, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for the method&#39;s defining class, org/jboss/forge/addon/parser/json/resource/JsonResource, have different Class objects for the type javax/json/JsonObject used in the signature<br>    at com.github.forge.addon.music.PlaylistManager.getAllPlaylists(PlaylistManager.java:178)<br>    at com.github.forge.addon.music.PlaylistManager.initPlayLists(PlaylistManager.java:57)<br><br></div>Here is the method which throws the exception:<br><br><pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:&quot;Source Code Pro&quot;;font-size:10.5pt"><span style="color:rgb(204,120,50)">public </span>List&lt;JsonObject&gt; <span style="color:rgb(255,198,109)">getAllPlaylists</span>() {<br>    List&lt;JsonObject&gt; playListsObject = <span style="color:rgb(204,120,50)">new </span>ArrayList&lt;&gt;()<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">    </span>List&lt;Resource&lt;?&gt;&gt; playListsFound = getPlayListHomeDir().listResources(<span style="color:rgb(204,120,50)">new </span>ResourceFilter() {<br>        <span style="color:rgb(187,181,41)">@Override<br></span><span style="color:rgb(187,181,41)">        </span><span style="color:rgb(204,120,50)">public boolean </span><span style="color:rgb(255,198,109)">accept</span>(Resource&lt;?&gt; resource) {<br>            <span style="color:rgb(204,120,50)">return </span>resource <span style="color:rgb(204,120,50)">instanceof </span>FileResource &amp;&amp; resource.getName().endsWith(<span style="color:rgb(106,135,89)">&quot;.json&quot;</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">        </span>}<br>    })<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">    for </span>(Resource&lt;?&gt; resource : playListsFound) {<br>        JsonResource jsonResource = resource.reify(JsonResource.<span style="color:rgb(204,120,50)">class</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">        </span>JsonObject jsonObject = jsonResource.getJsonObject()<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">        </span>playListsObject.add(jsonObject)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">    </span>}<br>    <span style="color:rgb(204,120,50)">return </span>playListsObject<span style="color:rgb(204,120,50)">;<br></span>}</pre><br></div><div>The exception is thrown in jsonResource.getJsonObject();<br><br></div>The code is here: <a href="https://github.com/rmpestano/music-addon" target="_blank">https://github.com/rmpestano/music-addon</a> and there is a test that reproduces the error.<br><br></div>Any help is appreciated, thanks in advance.<br clear="all"><div><div><div><div><div><div><br>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><a href="http://www.advancedit.com.br/" target="_blank"><span style="color:black;text-decoration:none"></span></a><span></span><span><span style="color:rgb(192,192,192)">Att,</span></span></div><div dir="ltr"><span><span style="color:rgb(192,192,192)"><br></span></span></div><div dir="ltr"><span><span style="color:rgb(192,192,192)">Rafael M. Pestano</span><br style="color:rgb(192,192,192)"><br style="color:rgb(192,192,192)"><span style="color:rgb(192,192,192)">Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul</span><br></span><div><font color="#c0c0c0"><a href="http://rpestano.wordpress.com/" target="_blank">http://rpestano.wordpress.com/</a></font><div><div><a href="https://twitter.com/realpestano" target="_blank"><span style="color:rgb(192,192,192)">@realpestano</span></a></div></div></div></div></div></div></div></div></div></div></div>
</div></div></div></div></div></div></div>
<br>_______________________________________________<br>
forge-users mailing list<br>
<a href="mailto:forge-users@lists.jboss.org">forge-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-users" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-users</a><br></blockquote></div>