question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

value jwtSession is not a member of play.api.mvc.Request

See original GitHub issue

Hi there,

after installing play-jwt I randomly get errors like:

Error:(22, 13) value jwtSession is not a member of play.api.mvc.Request[A]
    request.jwtSession.getAs[User]("user") match {
            ^

and I’ve to manually reload sbt dependencies. This is my build.sbt file

name := "Project"
version := "0.0.1"
inConfig(Compile)(mappings in packageBin <++= Defaults.sourceMappings)
lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.7"
libraryDependencies ++= {
  val postgresV              = "9.4.1207"
  val nscalaTimeV            = "2.6.0"
  val playSlickV             = "1.1.1"
  val slickPgV               = "0.10.2"
  val slickJodaMapperVersion = "2.1.0"

  Seq(
    cache,
    ws,
    specs2 % Test,
    "org.postgresql"              %  "postgresql"                           % postgresV,
    "com.github.tminglei"         %% "slick-pg"                             % slickPgV,
    "com.github.tminglei"         %% "slick-pg_play-json"                   % slickPgV,
    "com.typesafe.play"           %% "play-slick"                           % playSlickV,
    "com.typesafe.play"           %% "play-slick-evolutions"                % playSlickV,
    "com.github.nscala-time"      %% "nscala-time"                          % nscalaTimeV,
    "com.github.tototoshi"        %% "slick-joda-mapper"                    % slickJodaMapperVersion,
    "de.svenkubiak"               % "jBCrypt"                               % "0.4.1",
    "com.pauldijou"               %% "jwt-play"                             % "0.5.1",
    "com.amazonaws"               % "aws-java-sdk"                          % "1.10.64"
  )
}

resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"

// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator

// Newrelic configuration
enablePlugins(NewRelic)
newrelicVersion := "3.27.0"
newrelicAppName := "Project"

// Enable filters (to use CORS filter
libraryDependencies += filters

Everything seems correct, I’ve not idea on what could cause that.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13

github_iconTop GitHub Comments

6reactions
binkabircommented, Apr 5, 2017

Interestingly, import pdi.jwt.JwtSession._ fixed the issue

2reactions
egortsaryk9commented, Dec 2, 2016

+1 Have the same issue in Intellij IDEA… The code compiles via command line by “sbt compile” but in IDE it throws compiling errors…

UPDATE: I fixed it by adding “JwtPlayImplicits” trait (https://github.com/pauldijou/jwt-scala/blob/master/play/src/main/scala/JwtPlayImplicits.scala) for actions and my project started to compile in IntelliJ IDEA also

Read more comments on GitHub >

github_iconTop Results From Across the Web

value jwtSession is not a member of play.api.mvc.Request #19
Hi there, after installing play-jwt I randomly get errors like: Error:(22, 13) value jwtSession is not a member of play.api.mvc.Request[A] ...
Read more >
value withLang is not a member of play.api.mvc.Result
When the migration is complete, you will access your Teams at stackoverflowteams.com, and they will no longer appear in the left sidebar on ......
Read more >
JWT Scala: Play
Provides an API similar to the Play Session but using JsValue rather than String ... use the default values (which are all empty)...
Read more >
play.api.mvc.RequestHeader
Abstract Value Members. abstract def attrs: TypedMap. A map of typed attributes associated with the request. abstract def connection: RemoteConnection.
Read more >
Play will mysteriously will not compile. Anything in it is not ...
JsObjectimport play.api.libs.jsonimport java.util. ... _import play.api.mvc. ... object Actor is not a member of package akka.io[error] import akka.io.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found