我正在使用Spring创建一个服务器配置。我已经配置了POM.XML,并添加了安全性依赖项。此外,我还配置了application.yml和bootstrap.yml文件。当我使用encrypt命令调用服务器以返回已封装的密钥时,服务器响应:
白色标签错误页 此应用程序没有/error的显式映射,因此您认为这是一种退步。 清华7月23日10:20:46中欧时间2015年发生了一个意想不到的错误(type=Not Found,status=404)。没有可用的消息
呼吁:
http://user:s3cret@localhost:8888/encrypt -d s3cret
Maven控制台:
2015-07-23 11:02:05.217 INFO 7948 -主s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat启动于端口: 8888 (http) 2015-07-23 11:02:05.218 INFO 7948 --主nubbler.netflixserver.ConfigServerApp :启动ConfigServerApp在5.106秒内(JVM运行5.922) 2015-07-23 11:02:13.765 INFO 7948 - nio-8888-exec-1 o.a.c.c.C.Tomcat.localhost./ :初始化Spring FrameworkServlet 'dispatcherServlet‘2015-23 11:02:13.766 INFO 7948 -- nio-8888-exec-1 o.s.web.servlet.DispatcherServlet : FrameworkServlet’dispatcherServlet:初始化启动2015-07-23 11:02:13.785 INFO 7948 - nio-8888-exec-1 o.s.web.servlet.DispatcherServlet :data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@b364: FrameworkServlet 'dispatcherServlet':初始化以19 ms完成,2015-07-23 11:02:13.885 INFO 7948 --nio-8888- o.s.b.a.audit.listener.AuditListener : AuditEvent timestamp=Thu Jul 23 :02:13 CEST 2015,principal=user,type=AUTHENTICATION_SUCCESS,principal=user RemoteIpAddress: 0:0:0:0:0:1;SessionId: null}
有什么主意吗?我已经在jdk (jdk_1.8.0_40)中安装了JCE扩展,并检查了应用程序和maven是否使用此jdk。
application.yml:
server:
port: 8888
spring:
cloud:
config:
server:
git:
uri: https://github.com/xxxxx
basedir: target/config
security:
user:
password: s3cretbootstrap.yml:
spring:
encrypt:
key: foobarPOM.xml:
<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>nubbler</groupId>
<artifactId>netflixserver</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
</parent>
<name>netflixserver</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix</artifactId>
<version>1.0.3.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
</dependencies>
</project>发布于 2015-07-24 10:55:53
我在调用中使用卷曲解析它。
在我尝试使用浏览器(Chrome)和SoapUI之前,这两台服务器都会响应错误。
https://stackoverflow.com/questions/31582899
复制相似问题