在我的 maven pom.xml 我有以下依赖项:
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>Chart.js</artifactId>
<version>2.0.2</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
当我构建它时,maven 加载 Version1.1.1而不是2.0.2. 我无法解释为什么会发生这种情况。mvn dependency:tree给我以下输出:
[INFO] my.group:mypackage:war:0.0.1-SNAPSHOT
[INFO] ...
[INFO] +- org.webjars.bower:Chart.js:jar:1.1.1:compile
[INFO] +- org.webjars.bower:angular-chart.js:jar:0.10.2:compile
[INFO] ...
Run Code Online (Sandbox Code Playgroud)
所以,Chart.js是我的项目的直接依赖项,没有其他依赖项依赖Chart.js并强制加载 version 1.1.1。即使我查看 IntelliJ 中的有效 pom,也没有对 version 的依赖1.1.1,只有对2.0.2.
知道为什么 maven 加载错误的版本吗?
使用时,我的(GWT)的日志输出RemoteServiceServlet未显示在日志文件或标准输出中getServletContext().log("anything");
对于依赖项注入,我使用Google Guice。对于我自己的日志输出,我使用slf4j-jdk14。我在 Tomcat 6 和 Jetty(GWT devmode)中尝试过。
为了清楚起见,我的 Servlet:
@Singleton
public class MyServiceServlet extends RemoteServiceServlet implements MyService {
private static final Logger log = LoggerFactory.getLogger(MyServiceServlet.class);
private final ADependency dep;
@Inject
public MyServiceServlet(ADependency dep) {
getServletContext().log("THIS IS NOT SHOWN IN MY LOGS");
log.error("THIS IS SHOWN IN MY LOGS");
this.dep = dep;
}
}
Run Code Online (Sandbox Code Playgroud)
那么,在哪里可以找到丢失的日志输出或者在哪里可以配置 ServletContext-Log?
尝试将分支合并到主干中时
svn merge "$SVN_ROOT/trunk@HEAD" "$SVN_ROOT/branches/foo@HEAD"
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
svn: '/' is not a working copy
Run Code Online (Sandbox Code Playgroud)
我需要一份工作副本吗?
请帮助我理解为什么image- div下面的代码中流出的box- div.
<body>
<div id="box" style="border: 2px solid green;">
<div id="image" style="height: 200px; width: 200px; background: red; float: left;"></div>
<div id="text" style="background: yellow;">This is some text</div>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
换句话说,我期望绿色边框完全包围内部divs而不仅是黄色边框.
当我访问我的Wicket应用程序的特定页面时,我得到一个NotSerializableException:
java.io.NotSerializableException: my.package.MyPanel$1
Run Code Online (Sandbox Code Playgroud)
但我无法解释为什么wicket应该尝试序列化Panel.任何的想法?
我不知道它是否有帮助,但这里是我用来添加面板的代码:
final User profileUser = ...;
final IModel<User> loggedInUser = ...;
add(new MyPanel("panelid", new Model<MyObject>(new MyObject()))
{
@Override
public boolean isVisible()
{
return profileUser != null && profileUser.equals(loggedInUser.getObject());
}
});
Run Code Online (Sandbox Code Playgroud) 我想为我的 Spring Boot 应用程序启用 JMX,并尝试了一切但没有成功。我认为问题是我正在repackage使用spring-boot-maven-plugin.
目前我做了以下事情:
export JAVA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1617 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=127.0.0.1"
java -jar target/myapp-1.0.0.jar
Run Code Online (Sandbox Code Playgroud)
但是当我启动应用程序时,它不会侦听端口 1617。我无法从 JMX 客户端进行连接,ss -tulpen也不会列出该端口。
我也尝试过-D...直接传递参数。我也尝试过--com.sun...,认为 Spring boot 可以这样处理它们。我还在多台机器上尝试了许多其他事情,但没有成功。
一些进一步的信息:
spring-boot父级。openjdk version "1.8.0_112"我做错了什么,在哪里可以找到有关该问题的帮助文档?
更新:我添加了一些用于读取和打印传递的行JAVA_OPTS(如此处所述)。当我通过 IntelliJ 启动应用程序并将 VM 选项设置为JAVA_OPTS上面的值时,它可以工作。打印传递的选项,并且虚拟机正在侦听端口 1617。当我使用java -jar my.jar -Dcom.sun....参数启动应用程序时,不会打印参数,虚拟机仍然没有侦听端口 1617。
我正在尝试将我的Prometheus指标迁移到千分尺,但现在我在这里遇到了一件事......
目前我的Prometheus直方图配置如下:
private static final Histogram REQUEST_DURATION = Histogram
.build("http_request_duration_milliseconds", "Duration in milliseconds for processing a request.")
.labelNames("http_method", "http_status", "java_class", "java_method")
.buckets(10, 25, 50, 100, 500, 1000)
.register();
Run Code Online (Sandbox Code Playgroud)
因此,为了切换到千分尺,我将其替换为如下:
Timer.builder("http.request.duration")
.description("Duration in seconds for processing a request.")
.sla(Duration.ofMillis(10), Duration.ofMillis(25), Duration.ofMillis(50), Duration.ofMillis(100), Duration.ofMillis(500), Duration.ofMillis(1000), Duration.ofMillis(5000))
.register(registry);
Run Code Online (Sandbox Code Playgroud)
好.让我们看看我想如何使用它...目前我只是打电话
REQUEST_DURATION.labels(httpMethod, httpStatus, javaClass, javaMethod).observe(milliseconds);
Run Code Online (Sandbox Code Playgroud)
所以我把它换成了
Metrics.timer("http.request.duration",
"http.method", httpMethod,
"http.status", httpStatus,
"java.class", javaClass,
"java.method", javaMethod)
.record(Duration.ofNanos(nanoseconds));
Run Code Online (Sandbox Code Playgroud)
但现在的问题是,Micrometer抱怨我以前配置了没有这些标签的指标.当然我做了,因为我不知道那时的价值观.这里的例外:
java.lang.IllegalArgumentException: Prometheus requires that all meters with the same name have the same set of tag keys. There …