小编Ram*_*Ram的帖子

ES可以从curl到达,但不能从Marvel/Sense到达

我在弹性搜索沉浸的2小时内.我使用Marvel成功安装了ES(marvel.agent.enabled: false在config/elasticsearch.yml中),并且能够从Sense成功发出请求.我重新启动了我的开发机器,现在当我在Sense上发出以下请求时,它会响应:

Request failed to get to the server (status code: 0):

Elasticsearch may not be reachable or you may need to check your CORS settings.If CORS is enabled, try turning off Sense's Basic Authentication support under Setting (cog icon).This will result in a less strict CORS enforcement by the browser.
Please check the marvel documentation for more information.
Run Code Online (Sandbox Code Playgroud)

要求(来源):

PUT /megacorp/employee/1
{
"first_name" : "John",
"last_name" :  "Smith",
"age" :        25,
"about" :      "I love …
Run Code Online (Sandbox Code Playgroud)

elasticsearch elasticsearch-marvel

13
推荐指数
2
解决办法
6265
查看次数

当搜索返回匹配时,无法在maven central repo中找到工件

我试图在我的pom中引入对castor库的依赖.由于我的项目处于初步阶段,所有工件都来自maven central.所以我在search.maven.org上搜索"castor".我取第一个结果,它给了我以下依赖片段:

<dependency>
    <groupId>org.codehaus.castor</groupId>
    <artifactId>castor</artifactId>
    <version>1.3.3</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

现在我"mvn clean install"并获得以下内容:

[ERROR] Failed to execute goal on project jaxb: Could not resolve dependencies for project org.test:jaxb:war:0.0.1-SNAPSHOT: Could not find artifact org.codehaus.castor:castor:jar:1.3.3 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
Run Code Online (Sandbox Code Playgroud)

为什么CLI无法找到可从Web界面找到的工件.我当然错过了一些东西.请求指出它可能是什么.

在其他帖子中,我已经调查了这个这个相关的帖子,但不是这个问题.

我的完整pom:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.test</groupId>
<artifactId>jaxb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<name>jaxb</name>
<description>jaxb</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.1.9.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId> …
Run Code Online (Sandbox Code Playgroud)

maven-3

12
推荐指数
1
解决办法
3万
查看次数

移动到application.properties时,系统属性将停止生效

我有一个Spring Boot应用程序,它使用Spring Data和Hibernate进行数据访问.我最初遇到了很长的应用程序启动时间.因此,根据这个答案,我将'hibernate.temp.use_jdbc_metadata_defaults'设置为'false'作为系统属性(-D).应用程序启动时间问题已解决.

现在,我将该配置从系统属性移动到application.properties.延迟的应用程序启动问题已经恢复.

我的application.properties:

hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=none
spring.datasource.validation-query=SELECT 1
spring.datasource.testOnBorrow=true
spring.datasource.testWhileIdle=true
Run Code Online (Sandbox Code Playgroud)

将"org.springframework.core.env"设置为"DEBUG"日志记录后,我看到该属性是从application.properties解析的(如预期的那样).

INFO   | jvm 1    | 2015/07/20 19:47:15 | 19:47:15.211 [WrapperJarAppMain] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Found key 'spring.jpa.database-platform' in [applicationConfig: [classpath:/application.properties]] with type [String] and value 'org.hibernate.dialect.PostgreSQLDialect'
...
INFO   | jvm 1    | 2015/07/20 19:47:15 | 19:47:15.226 [WrapperJarAppMain] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Found key 'hibernate.temp.use_jdbc_metadata_defaults' in [applicationConfig: [classpath:/application.properties]] with type [String] and value 'false'
...
INFO   | jvm 1    | 2015/07/20 19:47:15 | 19:47:15.229 [WrapperJarAppMain] DEBUG o.s.c.e.PropertySourcesPropertyResolver …
Run Code Online (Sandbox Code Playgroud)

spring hibernate spring-data spring-boot

4
推荐指数
1
解决办法
5041
查看次数