Kawoold
Kawoold

Reputation: 21

Google Guava with WSO2 Application Server 4.1.0

I'm trying to use Google guava with Application Server 4.1.0, but I'm running into conflicts. I'm including the guava jar in the .aar file that uses it, but I get an error saying that com.google.common.collect.ImmutableList does not have a method called copyOf. After looking around, WSO2 has a jar in the repository/components/plugins directory called google-collect-1.0.0.wso2v2.jar. This jar contains com.google.common.collect.ImmutableList, but does not have the copyOf method. It looks like jars from the plugin directory get loaded before jars in the .aar when I try to access the service.

What would need to be done so that WSO2 uses the jar included in the .aar file instead of the jar in the plugins folder?

Upvotes: 2

Views: 199

Answers (1)

Pradeep Fernando
Pradeep Fernando

Reputation: 659

Did you try, enabling the ChildFirstClassLoading in your axis2, .aar file. If you haven't you can enable it in service level by putting the parameter,

<parameter name="EnableChildFirstClassLoading">true</parameter>

in your .aar, services.xml file.

Can you please try this and get back with the result ?

Cheers.

Upvotes: 1

Related Questions