Jose Antonio
Jose Antonio

Reputation: 598

Spring netflix server config not returns key encripted

I'm creating a server config with Spring Netflix. I have configured the POM.XML and I have added the security dependency. Also I have configured the application.yml and bootstrap.yml files. When I call to the server with the encrypt command for returns the key encripted, the server responses:

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Jul 23 10:20:46 CEST 2015 There was an unexpected error (type=Not Found, status=404). No message available

The call:

http://user:s3cret@localhost:8888/encrypt -d s3cret

Maven console:

2015-07-23 11:02:05.217 INFO 7948 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8888 (http) 2015-07-23 11:02:05.218 INFO 7948 --- [ main] nubbler.netflixserver.ConfigServerApp : Started ConfigServerApp in 5.106 seconds (JVM running for 5.922) 2015-07-23 11:02:13.765 INFO 7948 --- [nio-8888-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet' 2015-07-23 11:02:13.766 INFO 7948 --- [nio-8888-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started 2015-07-23 11:02:13.785 INFO 7948 --- [nio-8888-exec-1] o.s.web.servlet.DispatcherServlet
: FrameworkServlet 'dispatcherServlet': initialization completed in 19 ms 2015-07-23 11:02:13.885 INFO 7948 --- [nio-8888-exec-1] o.s.b.a.audit.listener.AuditListener : AuditEvent [timestamp=Thu Jul 23 11:02:13 CEST 2015, principal=user, type=AUTHENTICATION_SUCCESS, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@b364: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: null}]

¿Any idea? I have installed JCE extensions in the jdk (jdk_1.8.0_40) and I have checked that the application and maven use this jdk.

application.yml:

server:
  port: 8888

spring:
   cloud:
      config:
         server:
            git:
               uri: https://github.com/xxxxx
               basedir: target/config
   security:
      user:
         password: s3cret

bootstrap.yml:

spring:
  encrypt:
   key: foobar

POM.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>

Upvotes: 0

Views: 238

Answers (1)

Jose Antonio
Jose Antonio

Reputation: 598

I resolve it using Curl with the call.

Before I tried it with the browser (Chrome) and SoapUI, with both the server responses an error.

Upvotes: 0

Related Questions