obevo icon indicating copy to clipboard operation
obevo copied to clipboard

commons-text NoSuchMethod due to version conflict

Open olwett opened this issue 3 years ago • 2 comments

I get this Exception in Obevo 8.2.1. Version 8.0.0 is working

java.lang.NoSuchMethodError: org.apache.commons.text.lookup.StringLookupFactory.base64DecoderStringLookup()Lorg/apache/commons/text/lookup/StringLookup;

at org.apache.commons.configuration2.interpol.DefaultLookups.<clinit>(DefaultLookups.java:68)
at org.apache.commons.configuration2.interpol.ConfigurationInterpolator.<clinit>(ConfigurationInterpolator.java:111)
at org.apache.commons.configuration2.convert.DefaultConversionHandler.<clinit>(DefaultConversionHandler.java:72)
at org.apache.commons.configuration2.beanutils.DefaultBeanFactory.<init>(DefaultBeanFactory.java:84)
at org.apache.commons.configuration2.beanutils.DefaultBeanFactory.<init>(DefaultBeanFactory.java:71)
at org.apache.commons.configuration2.beanutils.DefaultBeanFactory.<clinit>(DefaultBeanFactory.java:56)
at org.apache.commons.configuration2.beanutils.BeanHelper.<init>(BeanHelper.java:118)
at org.apache.commons.configuration2.beanutils.BeanHelper.<init>(BeanHelper.java:106)
at org.apache.commons.configuration2.beanutils.BeanHelper.<clinit>(BeanHelper.java:80)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at com.sun.proxy.$Proxy45.<clinit>(Unknown Source)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1022)
at java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1008)
at org.apache.commons.configuration2.builder.fluent.Parameters.createParametersProxy(Parameters.java:306)
at org.apache.commons.configuration2.builder.fluent.Parameters.hierarchical(Parameters.java:220)
at com.gs.obevo.api.factory.PlatformConfigReader.loadPropertiesFromUrl(PlatformConfigReader.java:182)
at com.gs.obevo.api.factory.PlatformConfigReader.readConfigPackages(PlatformConfigReader.java:112)
at com.gs.obevo.api.factory.PlatformConfigReader.readPlatformProperties(PlatformConfigReader.java:58)
at com.gs.obevo.api.factory.PlatformConfiguration.<init>(PlatformConfiguration.java:51)
at com.gs.obevo.api.factory.PlatformConfiguration.<clinit>(PlatformConfiguration.java:38)
at com.gs.obevo.api.appdata.Environment.<init>(Environment.java:62)
at com.gs.obevo.db.api.appdata.DbEnvironment.<init>(DbEnvironment.java:71)

The cause seems to be that commons-text is ommited as a transitive dependency of commons-configuration2 because of conflict with commons-text which org.jgrapht dependes on. From maven dependency:tree: [INFO] +- com.goldmansachs.obevo:obevo-core:jar:8.2.1:compile [INFO] | +- (org.slf4j:slf4j-api:jar:1.7.18:compile - omitted for conflict with 1.7.30) [INFO] | +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.3.61:compile [INFO] | | +- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.3.61:compile [INFO] | | - org.jetbrains:annotations:jar:13.0:compile [INFO] | +- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.3.61:compile [INFO] | | +- (org.jetbrains.kotlin:kotlin-stdlib:jar:1.3.61:compile - omitted for duplicate) [INFO] | | - org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.3.61:compile [INFO] | | - (org.jetbrains.kotlin:kotlin-stdlib:jar:1.3.61:compile - omitted for duplicate) [INFO] | +- org.jgrapht:jgrapht-core:jar:1.3.0:compile [INFO] | | - org.jheaps:jheaps:jar:0.9:compile [INFO] | +- org.jgrapht:jgrapht-io:jar:1.3.0:compile [INFO] | | +- (org.jgrapht:jgrapht-core:jar:1.3.0:compile - omitted for duplicate) [INFO] | | - org.apache.commons:commons-text:jar:1.5:compile [INFO] | | - (org.apache.commons:commons-lang3:jar:3.8.1:compile - omitted for conflict with 3.9) [INFO] | +- commons-io:commons-io:jar:2.0:compile [INFO] | +- com.google.code.cli-parser:cli:jar:7:compile [INFO] | +- org.apache.commons:commons-configuration2:jar:2.7:compile [INFO] | | +- (org.apache.commons:commons-lang3:jar:3.9:compile - omitted for conflict with 3.1) [INFO] | | - (org.apache.commons:commons-text:jar:1.8:compile - omitted for conflict with 1.5) [INFO] | +- (commons-beanutils:commons-beanutils:jar:1.9.4:compile - scope updated from runtime; omitted for duplicate)

olwett avatar Jun 08 '21 08:06 olwett

from https://issues.apache.org/jira/browse/CONFIGURATION-796?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

It looks like your classpath is messed up. Check you command line or POM. You have an old version of Apche Commons Text that kicks in before the one specified by Commons Configuration.

mohrezaei avatar Jun 08 '21 08:06 mohrezaei

I don't have dependencies to any commons libraries in my project. I think the solution here is that obevo should update the org.jgrapth-dependency to 1.5.1, which also has a transitive dependency on commons-text:1.8

olwett avatar Jun 08 '21 08:06 olwett