Classpath error - java.lang.NoSuchMethodError: org.json4s.JsonMethods.render
See original GitHub issueHi,
I was trying to use the PgJson4sSupport example from https://github.com/tminglei/slick-pg/blob/master/src/test/scala/com/github/tminglei/slickpg/addon/PgJson4sSupportTest.scala
And I am getting the following error. I believe this has got to do with some classpath issue (with a version mismatch possibly)?
java.lang.NoSuchMethodError: org.json4s.JsonMethods.render(Lorg/json4s/JsonAST$JValue;)Ljava/lang/Object;
at com.github.tminglei.slickpg.PgJson4sSupport$Json4sJsonImplicits$$anonfun$2.apply(PgJson4sSupport.scala:23)
at com.github.tminglei.slickpg.PgJson4sSupport$Json4sJsonImplicits$$anonfun$2.apply(PgJson4sSupport.scala:23)
at com.github.tminglei.slickpg.utils.PgCommonJdbcTypes$GenericJdbcType.mkPgObject(PgCommonJdbcTypes.scala:30)
at com.github.tminglei.slickpg.utils.PgCommonJdbcTypes$GenericJdbcType.setValue(PgCommonJdbcTypes.scala:23)
at scala.slick.jdbc.BaseResultConverter.set(JdbcResultConverter.scala:19)
at scala.slick.jdbc.BaseResultConverter.set(JdbcResultConverter.scala:11)
[ERROR] [03/15/2015 03:13:50.158] [on-spray-can-akka.actor.default-dispatcher-4] [ActorSystem(on-spray-can)] Uncaught error from thread [on-spray-can-akka.actor.default-dispatcher-4] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.NoSuchMethodError: org.json4s.JsonMethods.render(Lorg/json4s/JsonAST$JValue;)Ljava/lang/Object;
at com.github.tminglei.slickpg.PgJson4sSupport$Json4sJsonImplicits$$anonfun$2.apply(PgJson4sSupport.scala:23)
at com.github.tminglei.slickpg.PgJson4sSupport$Json4sJsonImplicits$$anonfun$2.apply(PgJson4sSupport.scala:23)
at com.github.tminglei.slickpg.utils.PgCommonJdbcTypes$GenericJdbcType.mkPgObject(PgCommonJdbcTypes.scala:30)
at com.github.tminglei.slickpg.utils.PgCommonJdbcTypes$GenericJdbcType.setValue(PgCommonJdbcTypes.scala:23)
Not sure if it is under your scope, but I think you might find the following links relevant.
- https://github.com/json4s/json4s/issues/147
- http://stackoverflow.com/questions/24877062/receiving-bad-symbolic-reference-to-org-json4s-jsonast-in-eclipse-scala-ide (suggesting you add your dependency “org.json4s” %% “json4s-ast” % “3.2.11”)
Any help would be much appreciated.
Thanks
Issue Analytics
- State:
- Created 9 years ago
- Comments:19 (9 by maintainers)
Top Results From Across the Web
org.json4s.jackson.JsonMethods$.parse$default$3()Z - Stack ...
I am getting error while running spark using spark submit , but this works perfectly fine when I run a test using test...
Read more >Re: Spark reading from Hbase throws ... - Apache Mail Archives
NoSuchMethodError : org.json4s.jackson. ... Now I still get the same error! scala> val df = withCatalog(catalog) java.lang. ... JsonMethods in your classpath.
Read more >IntelliJ Debugging - Exception thrown during train
Exception in thread "main " java.lang.NoSuchMethodError: org.json4s.native.JsonMethods$.render(Lorg/json4s/JsonAST$JValue;)Lscala/text/Document;
Read more >Json4s by json4s
Json4s. One AST to rule them all. JSON4S. At this moment there are at least 6 json libraries for scala, not counting the...
Read more >Solved: SHC on HDP 3.0 With spark 2.4 - Cloudera Community
... with below error java.lang.NoSuchMethodError: org.json4s.jackson. ... loadV1Source(DataFrameReader.scala:223) at org.apache.spark.sql.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I thought that you can do it yourself. But, ok, there is another special version for json4s v3.2.11. 😃
pls update your dependency as below to use it:
Yes, it should be
"com.github.tminglei" %% "slick-pg" % "0.8.5_json4s-3.2.11". It’s still an all-in-one jar for 0.8.x.