2

I just downloaded the Scala eclipse IDE but am getting some errors after importing my project

method getTableConfig is defined twice conflicting symbols both originated in file '....'

Here is the sample code, any reason why this error pops up - code compiled successfully though

package com.mavencode.app.config

import java.io.{BufferedReader, File, InputStream, InputStreamReader}

import ...

object ConfigUtil
{
  def getTableConfig(configKey:String) (implicit config: Config) : ConnectionConfig = {
    val report: Config = config.getConfig(s"tables.$configKey")
    val db: Config = config.getConfig(s"db.${report.getString("db")}")
    ConnectionConfig(
      db.getString("host"),
      db.getInt("port"),
      db.getString("database"),
      similarity.getString("table"),
      db.getString("user"),
      db.getString("password"),
      report.getInt("lowerBound"),
      report.getInt("upperBound"),
      report.getInt("numPartitions")
    )
  }
Philip K. Adetiloye
  • 3,102
  • 4
  • 37
  • 63
  • it compiles using command line sbt? but on intellij no? Try to refresh sbt on intellij, it may have some problem in a dependency (http://stackoverflow.com/questions/20413605/how-to-force-intellij-idea-to-reload-dependencies-from-build-sbt-after-they-chan) – pedrorijo91 Jan 19 '17 at 19:13
  • Try to clean and re-compile. This sometimes happens when you move some code - but it goes away if you clean & re-compile – radumanolescu Jan 19 '17 at 19:21
  • @pedrorijo91 interestingly, am using maven not sbt for this particular project. – Philip K. Adetiloye Jan 20 '17 at 03:06

2 Answers2

2

I think it's a bug in the latest version of Scala IDE I downloaded, I opened my project on an older scala IDE and it worked fine

Bug with this version

Scala IDE build of Eclipse SDK
Build id: 4.5.0-vfinal-2016-12-13T10:59:29Z-Typesafe

Worked on older version

Scala IDE build of Eclipse SDK
Build id: 4.4.1-vfinal-2016-05-04T11:16:00Z-Typesafe
Philip K. Adetiloye
  • 3,102
  • 4
  • 37
  • 63
0

There is a Scala project creating wizard coming with the Scala-ide. This does not work so well with SBT. If you are using SBT you are better off creating the Scala project yourself. You can use Giter8 for that. Here are the Giter8 templates:

https://github.com/foundweekends/giter8/wiki/giter8-templates

Then generate the Eclipse project using the Sbt Eclipse plugin:

https://github.com/typesafehub/sbteclipse

Run

sbt eclipse

Import the existing project into Eclipse

Here is a more detailed description of the process:

http://www.nodalpoint.com/development-and-deployment-of-spark-applications-with-scala-eclipse-and-sbt-part-1-installation-configuration/

Sami Badawi
  • 977
  • 1
  • 10
  • 22
  • I forgot to mention that the project was a maven-based scala project. Works fine in IDEA but complains with the above error in latest Scala-IDE – Philip K. Adetiloye Jan 20 '17 at 06:03
  • I did see package com.mavencode.app.config, which made me a little uneasy. I don't know. I rarely use Maven these days. – Sami Badawi Jan 20 '17 at 10:33