Problem with json-parser
by Rafael Pestano
Hi everyone,
I'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:
Caused by: java.lang.LinkageError: loader constraint violation: when
resolving interface method
"org.jboss.forge.addon.parser.json.resource.JsonResource.getJsonObject()Ljavax/json/JsonObject;"
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'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
at
com.github.forge.addon.music.PlaylistManager.getAllPlaylists(PlaylistManager.java:178)
at
com.github.forge.addon.music.PlaylistManager.initPlayLists(PlaylistManager.java:57)
Here is the method which throws the exception:
public List<JsonObject> getAllPlaylists() {
List<JsonObject> playListsObject = new ArrayList<>();
List<Resource<?>> playListsFound =
getPlayListHomeDir().listResources(new ResourceFilter() {
@Override
public boolean accept(Resource<?> resource) {
return resource instanceof FileResource &&
resource.getName().endsWith(".json");
}
});
for (Resource<?> resource : playListsFound) {
JsonResource jsonResource = resource.reify(JsonResource.class);
JsonObject jsonObject = jsonResource.getJsonObject();
playListsObject.add(jsonObject);
}
return playListsObject;
}
The exception is thrown in jsonResource.getJsonObject();
The code is here: https://github.com/rmpestano/music-addon and there is a
test that reproduces the error.
Any help is appreciated, thanks in advance.
--
<http://www.advancedit.com.br/>Att,
Rafael M. Pestano
Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
http://rpestano.wordpress.com/
@realpestano <https://twitter.com/realpestano>
9 years, 1 month
JDK 8
by George Gastaldi
Hello Forge users,
For the next minor release, I'd like to make JDK8 the minimum requirement.
The JBoss Tools team is already using JDK8 as the minimum requirement for
their new versions. We are already running our build in JDK8 (with sources
set to 1.7 still)
Is there any objection? Say it now or forever hold your peace, because the
Forge train never stops ;)
Best Regards, love you all!
George Gastaldi
9 years, 2 months
Re: [forge-users] [forge-dev] JDK 8
by George Gastaldi
I created a poll to gather feedback and help in our decision to upgrade the
minimum JDK version to 8: http://goo.gl/forms/yqGss6gxOA
I appreciate if you could help us by answering just those 2 questions, it
should take some seconds.
Thank you!
On Wed, Oct 7, 2015 at 7:05 AM, George Gastaldi <ggastald(a)redhat.com> wrote:
> Hi Ivan, thanks for the feedback.
>
> Yeah, I was thinking of removing that or move it to a maven profile that
> is activated when the project builds on JDK7 only (that can be done now).
>
> So far the only objection I have received about moving to JDK8 is from the
> Fabric8 team asking that this should be done in Forge 3:
> https://twitter.com/davsclaus/status/651632079566950400?s=09
>
> Best Regards,
> Em 07/10/2015 04:36, "Ivan St. Ivanov" <ivan.st.ivanov(a)gmail.com>
> escreveu:
>
>> The problem with Java 9 is that you can't run tests, because the JVM that
>> runs them won't start. If you want to run with Java 9, you have to either
>> run the build with -DskipTests or remove this from pom.xml.
>>
>> On Wed, Oct 7, 2015 at 10:10 AM, Daniel Cunha <danielsoro(a)gmail.com>
>> wrote:
>>
>>> Make sense remove it from the pom if we go to Java 8. :)
>>> Can you share your problem with Java 9? (even though we don't have a
>>> final version of Java 9 ATM)
>>>
>>> On Wed, Oct 7, 2015 at 3:40 AM, Ivan St. Ivanov <
>>> ivan.st.ivanov(a)gmail.com> wrote:
>>>
>>>> Hi Geroge,
>>>>
>>>> That's wonderful! Finally we can rewrite all those anonymous inner
>>>> classes with lambdas. And use streams. And sometimes Optional in the APIs :)
>>>>
>>>> Do you plan to remove this from the root pom:
>>>>
>>>> <plugin>
>>>> <groupId>org.apache.maven.plugins</groupId>
>>>> <artifactId>maven-surefire-plugin</artifactId>
>>>> <configuration>
>>>> <argLine>-Xms256m -Xmx512m -XX:MaxPermSize=160m</argLine>
>>>> </configuration>
>>>> </plugin>
>>>>
>>>> It doesn't make sense anymore. But has been bugging me all the time
>>>> when I try to build Forge with Java 9 (it's an error there).
>>>>
>>>> Cheers,
>>>> Ivan
>>>>
>>>>
>>>> On Wed, Oct 7, 2015 at 8:43 AM, Daniel Cunha <danielsoro(a)gmail.com>
>>>> wrote:
>>>>
>>>>> I agree with that! :)
>>>>>
>>>>> +1 for Java 8.
>>>>>
>>>>> On Wed, Oct 7, 2015 at 2:23 AM, George Gastaldi <ggastald(a)redhat.com>
>>>>> wrote:
>>>>>
>>>>>> Hello Forge users,
>>>>>>
>>>>>> For the next minor release, I'd like to make JDK8 the minimum
>>>>>> requirement.
>>>>>>
>>>>>> The JBoss Tools team is already using JDK8 as the minimum requirement
>>>>>> for their new versions. We are already running our build in JDK8 (with
>>>>>> sources set to 1.7 still)
>>>>>>
>>>>>> Is there any objection? Say it now or forever hold your peace,
>>>>>> because the Forge train never stops ;)
>>>>>>
>>>>>> Best Regards, love you all!
>>>>>>
>>>>>> George Gastaldi
>>>>>>
>>>>>> _______________________________________________
>>>>>> forge-dev mailing list
>>>>>> forge-dev(a)lists.jboss.org
>>>>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Daniel Cunha (soro)
>>>>> https://twitter.com/dvlc_
>>>>> http://www.tomitribe.com
>>>>>
>>>>> _______________________________________________
>>>>> forge-dev mailing list
>>>>> forge-dev(a)lists.jboss.org
>>>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> forge-dev mailing list
>>>> forge-dev(a)lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>>
>>>
>>>
>>>
>>> --
>>> Daniel Cunha (soro)
>>> https://twitter.com/dvlc_
>>> http://www.tomitribe.com
>>>
>>> _______________________________________________
>>> forge-dev mailing list
>>> forge-dev(a)lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>>
>>
>>
>> _______________________________________________
>> forge-dev mailing list
>> forge-dev(a)lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/forge-dev
>>
>
--
*George Gastaldi | Senior Software Engineer*
JBoss Forge Team
T: +55 11 3524-6169
M: +55 47 9711-1000
9 years, 2 months