随着我上次重启我的mac,我遇到了IntelliJ IDEA项目的问题:.iml文件被删除了,我有
加载项目时出错:无法加载模块汽车 - 服务详细信息....
在控制台中.
除此之外,该项目的结构视图已经消失.这是一个截图:
我正在使用angularjs应用程序前端开发一个应用程序作为后端dropwizard.我打算使用Nginx作为后端dropwizard服务器的网关,并作为资产服务器(图像和angularjs应用程序).
我的问题是什么是部署的最佳策略:
提前致谢,
我如何在java中创建一个带有自定义构造函数的actor?我搜索了文档,但没有找到它.
这是我的演员:
public class ResizePhotoActor extends UntypedActor {
private int width;
private int height;
private String caption;
public ResizePhotoActor(int width, int height, String caption) {
this.height = height;
this.width = width;
this.caption = caption;
}
public void onReceive(Object message) throws Exception {
}
}
Run Code Online (Sandbox Code Playgroud)
我试过这个:
ActorRef imageActorRef = system.actorOf(
Props.create(new ResizePhotoActor(1, 2, "")));
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
谢谢
我在我的服务器上使用gzip json文件静态文件(实际上,它是我的测试服务器),我收到的数据总是被压缩.
这是我的代码:
$http({
url :'app/assets/json/makes2v.json.gz',
method: "GET",
headers: { 'Accept-Encoding': 'gzip' }})
.success(function(data, status, headers, config) {
console.log(data);
});
Run Code Online (Sandbox Code Playgroud)
我使用angular 1.3.15和Chrome.
在控制台中我有这个错误:
Refused to set unsafe header "Accept-Encoding"
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激.
谢谢,
我正在使用sonarqube 4.5.4与mysql数据库.
在我的项目上运行分析时遇到了这个异常:
INFO o.d.m.sonar.runner.RunSonarVisitor - ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction
2016-02-23 04:05:40.091Z INFO o.d.m.sonar.runner.RunSonarVisitor - ### The error may involve org.sonar.core.user.RoleMapper.insertGroupRole-Inline
2016-02-23 04:05:40.091Z INFO o.d.m.sonar.runner.RunSonarVisitor - ### The error occurred while setting parameters
2016-02-23 04:05:40.091Z INFO o.d.m.sonar.runner.RunSonarVisitor - ### SQL: INSERT INTO group_roles (group_id, resource_id, role) VALUES (?, ?, ?)
Run Code Online (Sandbox Code Playgroud)
这是输出 SHOW ENGINE INNODB STATUS
:
=====================================
2016-02-23 11:54:18 2b4ff4306700 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated …
Run Code Online (Sandbox Code Playgroud) 我有一个spring boot(我使用Thymeleaf进行模板化)项目,我想使用一些jQuery库.
不幸的是,webjars根本没有加载.我尝试了很多配置,但都失败了.
这是我的HTML页面的代码片段:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head lang="en">
<title>JAC</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script src="http://cdn.jsdelivr.net/webjars/jquery/2.1.4/jquery.js"
th:src="@{/webjars/jquery/2.1.4/jquery.min.js}" type="text/javascript"></script>
<script src="http://cdn.jsdelivr.net/webjars/jquery-file-upload/9.10.1/jquery.fileupload.js" type="text/javascript"
th:src="@{/webjars/jquery-file-upload/9.10.1/jquery.fileupload.min.js}"></script>
<link href="http://cdn.jsdelivr.net/webjars/bootstrap/3.3.5/css/bootstrap.min.css"
th:href="@{/webjars/bootstrap/3.3.5/css/bootstrap.min.css}"
rel="stylesheet" media="screen" />
<link href="http://cdn.jsdelivr.net/webjars/jquery-file-upload/9.10.1/jquery.fileupload.css"
rel="stylesheet" media="screen" />
</head>
Run Code Online (Sandbox Code Playgroud)
我已将它们添加到pom文件中:
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>jquery</artifactId>
<version>2.1.4</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.5</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery-file-upload</artifactId>
<version>9.10.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
但是在调用页面时,我在jquery.min.js和jquery.fileupload.min.js上获得了404.
GET http://localhost:8888/webjars/jquery-file-upload/9.10.1/jquery.fileupload.min.js
2015-09-21 02:02:04.059 home:9
GET http://localhost:8888/webjars/jquery/2.1.4/jquery.min.js 404 (Not Found)
Run Code Online (Sandbox Code Playgroud) 我想使用 JGit 在存储库中获取最后一个提交元数据(按日期计算的最年轻的元数据)。
我知道我可以使用
try (RevWalk walk = new RevWalk(repository)) {
RevCommit commit = walk.parseCommit(repository.resolve(commitHash));
}
Run Code Online (Sandbox Code Playgroud)
但是如何获得最新的提交哈希?
有没有其他方法可以RevCommit
直接在存储库中获得最年轻的日期?
我正在创建一个java代理,用于对某些类进行一些字节码修改org.eclipse.jdt.core.JDTCompilerAdapter
就是其中之一.我正在使用javassit来修改一些execute()
方法org.eclipse.jdt.core.JDTCompilerAdapter
.所以我在我的代理项目中包含了ecj(使用gradle)
compile group: 'org.eclipse.jdt.core.compiler' ,name: 'ecj', version :'4.3.1'
Run Code Online (Sandbox Code Playgroud)
因为我需要使用ecj中的一些类.
代理的目标是拦截对execute方法的调用,修改execute方法以向我的某些类添加一些调用,以触发一些处理.
我正在针对具有2个类的Simple Java项目测试代理.该项目使用ant构建并JDTCompilerAdapter
用作编译器.
这是build.xml文件
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build" name="TestProject">
<property file="build.properties" />
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.7"/>
<property name="source" value="1.7"/>
<path id="PClasspath">
<pathelement location="bin"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="init" name="build">
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
<src path="src"/> …
Run Code Online (Sandbox Code Playgroud) 我有多项目 gradle 配置,它使用 java 7 进行构建。我正在添加一个必须使用 Java 6 构建的新项目。
从这个问答中,我尝试了提出的不同解决方案,但没有一个有效。
这是顶层的 build.gradle:
allprojects {
apply plugin: 'idea'
apply plugin: 'java'
repositories {
maven { url 'http://repo1.maven.org/maven2' }
mavenLocal()
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:-options"
}
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试在子项目中确保源兼容性,但似乎没有效果。
更新:
我创建了一个多模块 gradle 项目的示例,其中一个子项目使用 Java 6,另一个子项目使用 java 8。我为每个子项目使用了org.gradle.java.home
属性来gradle.properties
为每个子项目设置 Java 主目录。这是github 存储库。
子项目包含使用 Java 8 中的 API 的每个类,使用 java 6 的子项目预计会失败,但构建运行成功。
这是父 build.gradle 文件:
group 'com.test' …
Run Code Online (Sandbox Code Playgroud) 我有一个弹性搜索服务器,我正在使用Jest客户端通过Java服务器访问,我正在寻找每次更新文档的多个字段的最佳方法.
到目前为止,我已经查看了文档,我发现有两种方法可以做到:
我的问题是如何知道Jest只通过脚本提供更新来更新整个文档?
这是删除文档和索引更新版本的最佳方法吗?
提前致谢,
java ×6
angularjs ×2
akka ×1
ant ×1
build.gradle ×1
deadlock ×1
dropwizard ×1
ecj ×1
eclipse-jdt ×1
git ×1
gradle ×1
gzip ×1
jest ×1
jgit ×1
json ×1
mysql ×1
nginx ×1
sonar-runner ×1
sonarqube ×1
spring-boot ×1
thymeleaf ×1
webjars ×1