Tranquility Core - Scala Errors

333 views
Skip to first unread message

JagadeeshM

unread,
Apr 12, 2016, 12:50:39 AM4/12/16
to Druid Development
I am using the following maven dependency for Tranquility - 
<dependency>
       <groupId>io.druid</groupId>
<artifactId>tranquility-core_2.11</artifactId>
<version>0.7.4</version>
</dependency>

I see the following runtime error when the following line of code from the Java Example for Tranquility is executed - 


Line #  final TranquilityConfig<PropertiesBasedConfig> config = TranquilityConfig.read(configStream);

[pool-5-thread-5] 2016-04-12 00:44:17 ERROR:ServerStatsScheduler.pollServerStats():  polling pollServerStatsfailed: scala.Predef$.$conforms()Lscala/Predef$$less$colon$less; Exception--> scala.Predef$.$conforms()Lscala/Predef$$less$colon$less; Stacktrace--> java.lang.NoSuchMethodError: scala.Predef$.$conforms()Lscala/Predef$$less$colon$less;
at com.metamx.common.scala.untyped$$anonfun$dict$2.apply(untyped.scala:48)
at com.metamx.common.scala.untyped$$anonfun$dict$2.apply(untyped.scala:48)
at com.metamx.common.scala.untyped$$anonfun$tryCasts$1.apply(untyped.scala:73)
at com.metamx.common.scala.untyped$$anonfun$tryCasts$1.apply(untyped.scala:71)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
at com.metamx.common.scala.untyped$.tryCasts(untyped.scala:71)
at com.metamx.common.scala.untyped$.dict(untyped.scala:46)
at com.metamx.tranquility.config.TranquilityConfig$$anonfun$2.apply(TranquilityConfig.scala:63)
at com.metamx.tranquility.config.TranquilityConfig$$anonfun$2.apply(TranquilityConfig.scala:62)
at com.metamx.common.scala.Predef$FinallyOps$$anonfun$withFinally$1.apply(Predef.scala:56)
at com.metamx.common.scala.Predef$FinallyOps$$anonfun$withFinally$1.apply(Predef.scala:56)
at com.metamx.tranquility.config.TranquilityConfig$.read(TranquilityConfig.scala:62)
at com.metamx.tranquility.config.TranquilityConfig$.read(TranquilityConfig.scala:93)
at com.metamx.tranquility.config.TranquilityConfig.read(TranquilityConfig.scala)
at com.priceline.druid.monitor.index.processor.IndexProcessor.<init>(IndexProcessor.java:45)
at com.priceline.cashtlrates.htlrates.processors.ServerStatsScheduler.pollServerStats(ServerStatsScheduler.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Please point out correct version of jars to add as dependency for executing the java sample.

Thanks!

Gian Merlino

unread,
Apr 12, 2016, 1:37:01 AM4/12/16
to druid-de...@googlegroups.com
Hey Jagadeesh,

tranquility-core_2.11 is a Scala 2.11 artifact. Is it possible you're also depending on another Scala based library that pulls in a different version of Scala? If so you could try adjusting that one and/or tranquility so they both match. If you need to use Scala 2.10 then you can switch to tranquility-core_2.10.

Gian

--
You received this message because you are subscribed to the Google Groups "Druid Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to druid-developm...@googlegroups.com.
To post to this group, send email to druid-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/druid-development/993b863f-bbd9-408f-93ff-78c71490a0b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

JagadeeshM

unread,
Apr 12, 2016, 11:21:06 AM4/12/16
to Druid Development
Hi Merlino,

Thanks for the reply!

I changed tranquility version to 
               <dependency>
<groupId>io.druid</groupId>
<artifactId>tranquility-core_2.10</artifactId>
<version>0.7.4</version>
<exclusions>
<exclusion>
<artifactId>hibernate-validator</artifactId>
<groupId>org.hibernate</groupId>
</exclusion>

</exclusions>
</dependency>

But now, I see the following error - 


Caused by: com.fasterxml.jackson.databind.JsonMappingException: Incompatible Jackson version: 2.5.4
at com.fasterxml.jackson.module.scala.JacksonModule$class.setupModule(JacksonModule.scala:64)
at com.fasterxml.jackson.module.scala.DefaultScalaModule.setupModule(DefaultScalaModule.scala:18)
at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:653)
at com.metamx.common.scala.Jackson$$anonfun$newObjectMapper$1.apply(Jackson.scala:70)
at com.metamx.common.scala.Jackson$$anonfun$newObjectMapper$1.apply(Jackson.scala:68)
at com.metamx.common.scala.Predef$EffectOps.withEffect(Predef.scala:44)
at com.metamx.common.scala.Jackson$class.newObjectMapper(Jackson.scala:67)
at com.metamx.common.scala.Jackson$.newObjectMapper(Jackson.scala:10)
at com.metamx.common.scala.Jackson$class.newObjectMapper(Jackson.scala:64)
at com.metamx.common.scala.Jackson$.newObjectMapper(Jackson.scala:10)
at com.metamx.common.scala.Jackson$class.$init$(Jackson.scala:14)
at com.metamx.common.scala.Jackson$.<init>(Jackson.scala:10)
at com.metamx.common.scala.Jackson$.<clinit>(Jackson.scala)

What version of Jackson is required ?

JagadeeshM

unread,
Apr 12, 2016, 11:38:19 AM4/12/16
to Druid Development
Looks like Tranqulity-core_2.10 requires Jackson 2.4.6. 

I see another error now [woh its like a treasure hunt :-)]

Could not initialize class com.metamx.tranquility.druid.DruidGuicer$ Exception--> Could not initialize class com.metamx.tranquility.druid.DruidGuicer$ Stacktrace--> java.lang.NoClassDefFoundError: Could not initialize class com.metamx.tranquility.druid.DruidGuicer$

Any advice, what am I missing?


On Tuesday, April 12, 2016 at 1:37:01 AM UTC-4, Gian Merlino wrote:

Gian Merlino

unread,
Apr 12, 2016, 3:39:25 PM4/12/16
to druid-de...@googlegroups.com
Oh boy, that one can mean a lot of things. What that *might* be telling you is that the injector failed to initialize, and since it's a static on DruidGuicer$, the class couldn't be loaded. Some suggestions,

1) Back up a bit and try to confirm that your dependencies are all aligned. Do a mvn dependency:list or mvn dependency:tree, make sure that all your io.druid jars are consistent with each other, all your com.fasterxml.jackson jars are consistent with each other, and all your scala versions match up.

2) Try to get a more meaningful error by adding a try/catch to the "private val injector" initializer in DruidGuicer.scala, and have that do an e.printStackTrace. (you'd have to build a custom tranquility for this)


Gian

JagadeeshM

unread,
Apr 12, 2016, 5:32:08 PM4/12/16
to Druid Development
Hi Merlino,

Thanks for the reply!

I was able to resolve the above issue. It has to do a combination of jar version issues. But they are now resolved.

My test application is now running but, tranquility is unable to send tasks to overlord. In the json spec, I have the following - 

 "properties":{
      "zookeeper.connect": "127.0.0.1:2181",
      "druid.selectors.indexing.serviceName": "overlord",
      "druid.discovery.curator.path": "/druid/discovery",
      "druidBeam.taskLocator": "overlord",
      "druidBeam.overlordPollPeriod": "PT5S"
   }

I don't think I am using Beam, do I need those 2 properties? I have stand alone nodes (zookeeper, real time node, broker, coordinator, historical, pivot) running in my local with their default configuration including ports. That being said, how should I configure my curator.path? What other properties files need to be in classpath?


And looking here [https://github.com/druid-io/tranquility/tree/master/core/src/test/resources], it seems to have several properties file in classpath, do I need to create them seperately in my app? Any advice will be of great help.

Are you available on a IRC by any chance?

Thanks once again!

JagadeeshM

unread,
Apr 12, 2016, 10:18:01 PM4/12/16
to Druid Development
OK! After some digging and making changes in some of the config files, I see my client is able to establish connection with Overlord and Zookeper...how ever in my logs, I see something like - ---

Apr 12, 2016 10:10:07 PM com.twitter.finagle.loadbalancer.LoadBalancerFactory$StackModule$$anonfun$5 apply
INFO: druidTask!overlord!index_realtime_ServerStats_2016-04-13T02:09:00.000Z_0_0: name resolution is negative (local dtab: Dtab())

Followed by a bunch of 

com.metamx.tranquility.tranquilizer.MessageDroppedException: Message dropped
at com.twitter.finagle.NoStacktrace(Unknown Source)

I am wondering why are my messages being dropped ?


JM
Reply all
Reply to author
Forward
0 new messages