3
votes

I am receiving the following error after simply copying the example from github example into my project. I am able to compile the github example project. I feel sbt must be messing me up some how. I am using sbt 0.13

[error] .scala:13: too many arguments for constructor Object: ()Object
[error]   class Suppliers(tag: Tag) extends Table[(Int, String, String, String, String,   String)](tag, "SUPPLIERS") {
[error]                  ^
[error].scala:14: object column does not take type parameters.
[error]     def id = column[Int]("SUP_ID", O.PrimaryKey) // This is the primary key column

My build.sbt looks like

import AssemblyKeys._

name := "myproject"

version := "1.0"

scalaVersion := "2.10.3"

assemblySettings

seq(Revolver.settings: _*)

libraryDependencies <+= (scalaVersion)("org.scala-lang" % "scala-compiler" % _)

resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"

resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"

resolvers += "Sonatype Releases" at "http://oss.sonatype.org/content/repositories/releases"

resolvers += "CDH4" at "https://repository.cloudera.com/artifactory/cloudera-repos/"

resolvers += "glassfish" at "https://repository.jboss.org/nexus/content/repositories/glassfish"

resolvers += "spray repo" at "http://repo.spray.io"

resolvers += "anormcypher" at "http://repo.anormcypher.org/"

libraryDependencies +="com.typesafe.akka" %% "akka-actor" % "2.2.0"

libraryDependencies +="com.typesafe.akka" %% "akka-testkit" % "2.2.0"

libraryDependencies +="com.typesafe.akka" %% "akka-transactor" % "2.2.0"

libraryDependencies += "io.spray" % "spray-can" % "1.2-RC2"

libraryDependencies += "io.spray" % "spray-routing" % "1.2-RC2"

libraryDependencies += "io.spray" % "spray-testkit" % "1.2-RC2"

libraryDependencies += "io.spray" %% "spray-json" % "1.2.3"

libraryDependencies += "org.scalatest" % "scalatest_2.10" % "1.9.2"

libraryDependencies += "org.anormcypher" %% "anormcypher" % "0.4.4"

libraryDependencies += "com.h2database" % "h2" % "1.3.166"

libraryDependencies += "com.typesafe.slick" %% "slick" % "2.0.0-M3"

libraryDependencies += "org.postgresql" % "postgresql" % "9.2-1002-jdbc4"

1
strange error message. please push the whole code of your example project somewhere.cvogt
I can't push the project as it's corporate. I literally just copied the linked file into my project and changed the module name. I made a gist of the file gist.github.com/bearrito/7923873bearrito
Only other error that might be relevant : .scala:23: type arguments [Suppliers] conform to the bounds of none of the overloaded alternatives of [error] value apply: [E <: scala.slick.lifted.AbstractTable[]]=> scala.slick.lifted.TableQuery[E,E#TableElementType] <and> [E <: scala.slick.lifted.AbstractTable[]](cons: scala.slick.lifted.Tag => E)scala.slick.lifted.TableQuery[E,E#TableElementType]bearrito
My best guess is you may have included Slick 1 and Slick 2 in your dependencies. If you included play-slick it loads Slick 1. Remove one of them. But that's a wild guess. I can't be more specific without seeing the code of your project. Even if it is corporate you could perhaps create a minimized reproduction of the problem.cvogt
I recreated an entirely new project github.com/bearrito/replicate-slick-issue I can replicate it there. Do you have an email. I can send some logs.bearrito

1 Answers

5
votes

Your imports are wrong. Seems like you used some tool to autocomplete them based on their name (or you were guessing wildly). In any case you import the wrong things. Just import

import scala.slick.driver.H2Driver.simple._

And you are set. See http://slick.typesafe.com/doc/2.0.0-M3/gettingstarted.html#imports