Compile Error when killing topology from storm bolt programatically: object and package with same name

旧时模样 提交于 2019-12-04 05:23:17

问题


I was looking for how to kill a topology from a storm bolt in storm 1.2.1 in my scala project. From this answer, I wrote following code to do it:

  private def shutTopology(){
    import org.apache.storm.utils.Utils
    import org.apache.storm.utils.NimbusClient
    val conf = Utils.readStormConfig
    val nimbusClient = 
NimbusClient.getConfiguredClient(conf).getClient
    nimbusClient.deactivate(topology_name)
  }

But it given following error in line: val conf = Utils.readStormConfig, How to resolve this?

Error:(46, 17) package daemon contains object and package with same name: nimbus

one of them needs to be removed from classpath

val conf = Utils.readStormConfig

I get above error by compiling via both sbt and mvn. I see some description for this here but not much help on how to resolve this.

Edit:

Based on the answer here, I was able to compile this in sbt using following scalac options:

"-Yresolve-term-conflict:object"

I am stil not able to get this done how to resolve this error when compiling with maven.


回答1:


Based on the answer here, I was able to compile this in sbt using following scalac options:

"-Yresolve-term-conflict:object"

to get this compiled with maven, I did following changes in my pom.xml as suggested here:

<configuration>
      <scalaVersion>${scala.version}</scalaVersion>
      <args>
        <arg>-Yresolve-term-conflict:object</arg> //this was added
      </args>
      <jvmArgs>
        <jvmArg>-Xms2048m</jvmArg>
        <jvmArg>-Xmx4096m</jvmArg>
      </jvmArgs>
</configuration>


来源:https://stackoverflow.com/questions/51493328/compile-error-when-killing-topology-from-storm-bolt-programatically-object-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!