Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.

Downgrading dependency to solve issue with conflicting json4s-core versions #28

Merged
merged 1 commit into from
May 20, 2017

Conversation

pdolega
Copy link
Contributor

@pdolega pdolega commented May 19, 2017

Issue is described here: sbt/sbt-bintray#104

Although I have actually added unit test I am admitting honestly that it doesn't really reproduce the issue. There is a conflict between two jar versions json4s-core_2.10-3.2.10.jar vs json4s-core_2.10-3.2.11.jar. It seems that version 3.2.11 lost method: emptyValueStrategy which is attempted to being used by json4s-native like here:

java.lang.NoSuchMethodError: org.json4s.Formats.emptyValueStrategy()Lorg/json4s/prefs/EmptyValueStrategy;
        at org.json4s.native.JsonMethods$class.render(JsonMethods.scala:29)
        at org.json4s.native.JsonMethods$.render(JsonMethods.scala:62)
        at bintry.Methods$json$.str(Methods.scala:19)
        at bintry.Methods$Repo$Package$Version$Attrs$.update(Methods.scala:147)
        at bintray.BintrayRepo$$anonfun$publishVersionAttributes$1.apply(BintrayRepo.scala:23)
        at bintray.BintrayRepo$$anonfun$publishVersionAttributes$1.apply(BintrayRepo.scala:23)
        at bintray.Bintray$await$.ready(Bintray.scala:119)
        at bintray.BintrayRepo.publishVersionAttributes(BintrayRepo.scala:22)
        at bintray.BintrayPlugin$$anonfun$publishVersionAttributesTask$1.apply(BintrayPlugin.scala:149)
        at bintray.BintrayPlugin$$anonfun$publishVersionAttributesTask$1.apply(BintrayPlugin.scala:147)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.Execute.work(Execute.scala:237)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)

The problem with reproducing is that sbt itself downloads json4s-core whatever you do (if you create empty build.sbt with bare minimum it will pull json4s-core_2.10-3.2.10.jar ). Therefore I wasn't able to reproduce it in unit testing - i think that it always works accidentally - by picking wrong jar version:

[pdolega@maracuja jars]$ pwd
/home/pdolega/.ivy2/cache/org.json4s/json4s-core_2.10/jars
[pdolega@maracuja jars]$ ls
json4s-core_2.10-3.2.10.jar  json4s-core_2.10-3.2.11.jar

With above in mind I am happy to remove this test case from the PR and just leave the fix in sbt (but I leave the decision for the person who would be reviewing this).

The most important part is - that this fixes the issue mentioned here: sbt/sbt-bintray#104 (and all related problems in other projects: EmilDafinov/scala-ad-sdk@3ccbcda or RMSone/slick-cats#26 )

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@eed3si9n eed3si9n merged commit ef49eaa into sbt:master May 20, 2017
@jvican
Copy link
Member

jvican commented Jun 19, 2017

@eed3si9n Can you release 0.6 of this?

@pdolega pdolega deleted the feature/downgrade-json4s-native branch July 25, 2017 04:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants