Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instantiationerror when using with scala-logging #99

Closed
concerned3rdparty opened this issue Mar 1, 2016 · 8 comments
Closed

Instantiationerror when using with scala-logging #99

concerned3rdparty opened this issue Mar 1, 2016 · 8 comments

Comments

@concerned3rdparty
Copy link

After sbt assembly , when i try to run the app from jar , it gives the error below .Is this about dependency version conflict? Any suggestions for the problem?
dependencies:
libraryDependencies += "com.softwaremill.reactivekafka" %% "reactive-kafka-core" % "0.10.0"
libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.1.0"
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.1.3"

Exception in thread "main" java.lang.InstantiationError: com.typesafe.scalalogging.Logger
at com.typesafe.scalalogging.Logger$.apply(Logger.scala:31)
at com.typesafe.scalalogging.LazyLogging$class.logger(Logging.scala:28)
at io.tazi.featureengineering.FeatureEngineering.logger$lzycompute(FeatureEngineering.scala:24)
at io.tazi.featureengineering.FeatureEngineering.logger(FeatureEngineering.scala:24)

@13h3r
Copy link
Member

13h3r commented Mar 1, 2016

Looks like version of scala logging that we use in reactive kafka already deprecated. We use "com.typesafe.scala-logging" %% "scala-logging-slf4j" % "2.1.2", but now 3.1.0 available and artifact id named "com.typesafe.scala-logging" %% "scala-logging".

@kciesielski I see no reason to keep this version and suggest to use new one. What do you think?

@kciesielski
Copy link
Contributor

@13h3r We kept 2.1.2 because 3.x was not compatible with Scala 2.10. As we switched to Scala 2.11, we should also switch to scala-logging 3. However, until it's released, it looks like reactive-kafka users also have to work with scala-logging-slf4j % 2.1.2 because 3.x is not backward compatible. Unless there's some kind of bridge that I'm not aware of?

@13h3r
Copy link
Member

13h3r commented Mar 1, 2016

Got it. First of all lets ensure that problem is in scala logging version.
@concerned3rdparty could you try to build it with "com.typesafe.scala-logging" %% "scala-logging-slf4j" % "2.1.2"?

@kciesielski
Copy link
Contributor

Ok, I'm preparing a PR in the meantime (#100)

@concerned3rdparty
Copy link
Author

"com.typesafe.scala-logging" %% "scala-logging-slf4j" % "2.1.2" seems to work fine when running both from sbt and jar .

@kciesielski
Copy link
Contributor

@concerned3rdparty Doesn't that break your own logging code? Can you show some examples how you import/use scala logging?

@concerned3rdparty
Copy link
Author

After a change in import statement , it worked for version "2.1.2".

import com.typesafe.scalalogging.slf4j.LazyLogging

object A extends  App with LazyLogging{
    logger.info("nothing")
}

@13h3r 13h3r closed this as completed Mar 8, 2016
@13h3r
Copy link
Member

13h3r commented Mar 8, 2016

Please leave comment if any

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants