score:0
Accepted answer
i found the problem was using symbols for the binding identifier. i swapped them out for a solution using bindingid
s and everything worked :
object bindingkeys {
object location extends bindingid
}
object servermodule extends newbindingmodule (module => {
import module._
import bindingkeys._
bind[string] idby location tosingle {
play.current.configuration.getstring("file.location").getorelse (
throw new illegalstateexception("cannot find file")
)
}
bind[thirdpartylib] toprovider { implicit module =>
val liblocation = inject [string] (some(location))
thirdpartylib fromfile liblocation
}
bind[controller] toprovider { implicit module => new controller}})
Source: stackoverflow.com
Related Query
- Using Subcut to inject a string into a third party library
- Serializing a scala object into a JSon String using lift-json
- How do I parse a x-www-url-encoded string into a Map[String, String] using Lift?
- Scala : Way to use a function directly into the println(...) using string interpolation
- Turning a string into a sealed trait using scala chimney
- How to inject services into actors using the Play 2.4?
- Creating a AbstractModule to inject a dependency for a 3rd party library
- Can I use a third party scala library in java?
- Can I compile a string containing Scala code to machine code using Scala Native as a library of my program?
- Convert data frame into String using scala and save the ouput to a csv
- SBT: add third party library dependency but NoClassDefFoundError
- Writing a library that is optionally dependent on a third party library
- Converting a nested scala object into a JSON string using Play JSON
- Easiest way of getting third party database information into java objects
- How to parse a csv string into a Spark dataframe using scala?
- Scala Play Guice using injector to manually inject a singleton class that has configuration injected into its constructor
- splitting string column into multiple columns based on key value item using spark scala
- How to generate multivalue map with random values and inject into request body using a feeder in Gatling
- Third party library fails with NoSuchMethodError in Storm
- How do I deserialize a JSON file using json4s without reading into a string first?
- Is exporting third party library dependencies good programming practice?
- How to tokenize a String into its ngrams using Lucene in Scala?
- Passing parameter into sql string triple with using scala spark
- spilt a string into key value pairs with a deliminator using scala
- Scala: Elegant conversion of a string into a boolean
- How to use third party libraries with Scala REPL?
- How to insert double quotes into String with interpolation in scala
- How can I connect to a postgreSQL database into Apache Spark using scala?
- Does Scala have a library method to build Option-s that takes into account empty strings?
- Using a Java library with Scala reserved words
More Query from same tag
- Is it possible to find a common supertype on type-system level in Scala?
- Can I "pimp my library" with an analogue of TraversableLike.map that has nicely variant types?
- Suggestions on how to go about a simple example displaying scala's multiprocessor capabilities
- How to config gcs-connector in local environment properly
- upgrade from Scala 2.11.8 to 2.12.10 build fails at sbt due to conflicting cross-version suffixes
- Scala priority of method call on implicit object
- Play 2.6.13 having trouble running with Scaldi
- Scala: Function0 vs by-name parameters
- Inheritance in scala
- Scala Random Number
- What (exactly) are "First Class" modules?
- Scala slick query comparison of a custom user type (enumeration) gives error
- pattern match in curry function: which paramter to match against
- ClassNotFoundException on akka.remote.RemoteActorRefProvider
- Field 'age2' can only be read from 'application/x-www-form-urlencoded' form content
- Ignoring an entity field
- Using unboundid ldap in scala ... strange compile error
- Finatra access-control-allow-origin
- akka http: docker container is not connecting to the server
- Counting conccurent user sessions by time intervals
- How to test exception with Junit 4 and Scala?
- How to initialize members of App without running the App (main)?
- Functional way to implement a thread safe shared counter
- Working only when case class defined outside main method to create Dataset[case class] or Dataframe[case class]
- private[this] on mutable constructor parameter causing unexpected behavior
- Cannot connect to embedded Cassandra instance using Phantom
- How to pass a dataframe column to scala function
- Why Scala can't compile function chains with a mix of spaces and dots?
- How to unflatten RDD based on few columns
- Creating new column with values of looping through SparkSQL Dataframe