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

Problem when integrating with spray session #4

Open
nguyenxuantuong opened this issue Jun 11, 2015 · 1 comment
Open

Problem when integrating with spray session #4

nguyenxuantuong opened this issue Jun 11, 2015 · 1 comment

Comments

@nguyenxuantuong
Copy link

Hi,
I keep getting the error:

not enough arguments for method cookieSession: (magnet: com.abcd.rest.session.WithStatefulManagerMagnet[Unit,Int])spray.routing.Directive[shapeless.::[String,shapeless.::[Map[String,Int],shapeless.HNil]]]

when trying to integrate spray session with my code. It seems that it's because my code is lack of some implicit parameter so the compiler is unable to find the suitable conversation. I am pretty new to Scala and spray (magnet directive pattern). Can you take a look and suggest where I made the mistake.

Here is the code what I am using:

trait BootedCore extends HttpService with HttpsDirectives with SettingsProvider with PageDirectives with StatefulSessionManagerDirectives[Int]{
  implicit val system = ActorSystem("user-services")
 ....
  implicit def actorRefFactory: ActorRefFactory = system
 implicit val timeout = new Timeout(Duration(2, SECONDS))

implicit val manager = new RedisSessionManager[Int](ConfigFactory.load())

  //merge both routes together + enforce https if needed
  val routes = {
    cookieSession() { (id, map) =>
      decompressCompressIfRequested {
        enforceHttpsIf(settings.Http.EnforceHttps) {
          apiRoutes ~ websiteRoutes
        }
      }
    }
  }
....

Thanks.

@satabin
Copy link
Member

satabin commented Jun 12, 2015

Hi,

Aren't you missing an implicit ExecutionContext in scope?

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

2 participants