WS.url("https://api.humanapi.co/v1/human"+url+"?updated_since="+updatedSince).setHeader("Authorization", "Bearer "+accessToken)
.setHeader("Accept", "application/json").get().map(
new Function<WSResponse, JsonNode>() {
public JsonNode apply(WSResponse response) {
JsonNode json = response.asJson();
success(json);
return json;
}
}
);
Run Code Online (Sandbox Code Playgroud)
这会显示错误"无法解析类型scala.concurrent.ExecutionContext.它是从所需的.class文件间接引用的".
我试过添加
import scala.concurrent.ExecutionContext;
Run Code Online (Sandbox Code Playgroud)
但是然后错误只是从承诺所在的行"移动"到文件的顶部,但仍然无法编译.
我也尝试过添加
import play.api.libs.concurrent.Execution.Implicit.defaultContext;
Run Code Online (Sandbox Code Playgroud)
但没有这样的东西可以进口.
Play Framework使用的是2.4.2.
SBT档案:
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayJava)
scalaVersion := "2.11.6"
resolvers ++= Seq(
"Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
"sonatype snapshots" at "https://oss.sonatype.org/content/repositories/releases/"
)
checksums := Nil
libraryDependencies ++= Seq(
javaJdbc,
cache,
javaWs,
"org.mockito" % "mockito-all" % "1.10.19",
"commons-codec" % "commons-codec" % "1.10", …Run Code Online (Sandbox Code Playgroud) 我想用Cognito测试自定义用户授权,并从简单的Java代码中进行.问题是,CognitoCachingCredentialsProvider需要Android ApplicationContext并且不接受null.
整个流程应该是这样的:
有什么我缺少或做我只是让整个概念错了吗?关于这个的任何好的教程?我已经浏览了AWS上的所有可能的文档,但我发现很难解决它并且普通Java上没有单一的材料,只有Android.
我想使用slick-util的教程在我的openGL应用程序之上呈现一串文本:http:// lwjgl.org/wiki/index.php?title=Slick-Util_Library_-_Part_3_-_TrueType_Fonts_for_LWJGL
这是我的初始代码:
private void init() {
try {
Display.setDisplayMode(new DisplayMode(640, 480));
Display.setVSyncEnabled(true);
Display.setTitle(this.windowTitle);
Display.create();
Keyboard.create();
} catch (LWJGLException e) {
Sys.alert("Error", "Initialization failed!\n\n" + e.getMessage());
System.exit(0);
}
/* OpenGL */
int width = Display.getDisplayMode().getWidth();
int height = Display.getDisplayMode().getHeight();
GL11.glViewport(0, 0, width, height); // Reset The Current Viewport
GL11.glMatrixMode(GL11.GL_PROJECTION); // Select The Projection Matrix
GL11.glLoadIdentity(); // Reset The Projection Matrix
GLU.gluPerspective(45.0f, ((float) width / (float) height), 0.1f, 100.0f); // Calculate The Aspect Ratio Of The Window
GL11.glMatrixMode(GL11.GL_MODELVIEW); // Select The …Run Code Online (Sandbox Code Playgroud)