Coder Social home page Coder Social logo

pivotal-cf / spring-cloud-services-starters Goto Github PK

View Code? Open in Web Editor NEW
38.0 56.0 24.0 1.14 MB

Spring Cloud Starters for Spring Cloud Services on Pivotal Cloud Foundry

Home Page: http://docs.pivotal.io/spring-cloud-services

License: Apache License 2.0

Shell 2.81% Java 96.57% Dockerfile 0.62%

spring-cloud-services-starters's Introduction

Spring Cloud Services Starters

Spring Cloud Services Starters are a curated set of dependencies for use with Spring Cloud Services in a Pivotal Cloud Foundry environment.

Features

Easily take advantage of the various services by including the BOM and corresponding starter. See the example Maven POM and Gradle build files below.

  • spring-cloud-services-starter-config-client

  • spring-cloud-services-starter-service-registry

Build and Deploy

The release artifacts are available from Maven Central. You may also build and install the starter POMs to your local Maven repository:

./gradlew clean build publishToMavenLocal

Usage

Include the BOM and starter dependencies in your project using Maven or Gradle.

Maven BOM

pom.xml

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

    <groupId>org.demo</groupId>
    <artifactId>spring-cloud-services-demo</artifactId>
    <version>0.1.0</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>${spring-boot.version}</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>17</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.pivotal.spring.cloud</groupId>
            <artifactId>spring-cloud-services-starter-config-client</artifactId>
        </dependency>
        <dependency>
            <groupId>io.pivotal.spring.cloud</groupId>
            <artifactId>spring-cloud-services-starter-service-registry</artifactId>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.pivotal.spring.cloud</groupId>
                <artifactId>spring-cloud-services-dependencies</artifactId>
                <version>${spring-cloud-services.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

Gradle

build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        classpath("io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE")
    }
}

apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "spring-boot"
apply plugin: "io.spring.dependency-management"

jar {
    baseName = "spring-cloud-services-demo"
    version =  "0.1.0"
}

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
        mavenBom "io.pivotal.spring.cloud:spring-cloud-services-dependencies:${springCloudServicesVersion}"
    }
}

dependencies {
    compile("io.pivotal.spring.cloud:spring-cloud-services-starter-config-client")
    compile("io.pivotal.spring.cloud:spring-cloud-services-starter-service-registry")
}

repositories {
    mavenCentral()
}

Compatibility Matrix

SCS Starters Spring Cloud Spring Boot

4.1.x

2023.0.x

3.2.x

4.0.x

2022.0.x

3.0.x & 3.1.x

3.5.x

2021.0.x

2.7.x

3.4.x

2021.0.x

2.6.x

3.3.x

2020.0.x

2.5.x

License

Spring Cloud Services Starters is Open Source software released under the Apache 2.0 license.

spring-cloud-services-starters's People

Contributors

abelsromero avatar albertoimpl avatar anthonydahanne avatar candicenonsense avatar chrisjs avatar csterwa avatar daniellavoie avatar datagitlies avatar dependabot[bot] avatar dyroberts avatar glyn avatar habuma avatar kvmw avatar nhomble avatar ojhughes avatar pacphi avatar royclarkson avatar scottfrederick avatar spikymonkey avatar spring-builds avatar spring-operator avatar walliee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-cloud-services-starters's Issues

java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy


4.0.0

<groupId>com.example</groupId>
<artifactId>demo-9</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>demo-9</name>
<description>Demo project for Spring Boot</description>

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

<properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	<java.version>1.8</java.version>
	<spring-cloud-services.version>2.0.0.M1</spring-cloud-services.version>
	<spring-cloud.version>Finchley.M9</spring-cloud.version>
</properties>

<dependencies>
	<dependency>
		<groupId>io.pivotal.spring.cloud</groupId>
		<artifactId>spring-cloud-services-starter-service-registry</artifactId>
	</dependency>

	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>io.pivotal.spring.cloud</groupId>
		<artifactId>
			spring-cloud-services-cloudfoundry-connector
		</artifactId>
	</dependency>
</dependencies>

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dependencies</artifactId>
			<version>${spring-cloud.version}</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
		<dependency>
			<groupId>io.pivotal.spring.cloud</groupId>
			<artifactId>spring-cloud-services-dependencies</artifactId>
			<version>${spring-cloud-services.version}</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

<build>
	<plugins>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
		</plugin>
	</plugins>
</build>

<repositories>
	<repository>
		<id>spring-milestones</id>
		<name>Spring Milestones</name>
		<url>https://repo.spring.io/milestone</url>
		<snapshots>
			<enabled>false</enabled>
		</snapshots>
	</repository>
</repositories>

This is the default POM getting generated whenever I try to create service registry project in STS and try to push it to PCF,but getting below exception on application startup and then app shuts down.Earlier the same was working with boot-1.5.13 ,cloud -edgware and cloud service- 1.6.3

2018-04-23 16:41:14.989 INFO 13388 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@1018bde2: startup date [Mon Apr 23 16:41:14 EDT 2018]; root of context hierarchy
2018-04-23 16:41:15.188 INFO 13388 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-04-23 16:41:15.220 INFO 13388 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$e65df93a] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

. ____ _ __ _ _
/\ / ' __ _ () __ __ _ \ \ \
( ( )_
_ | '_ | '| | ' / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
' |
| .__|| ||| |_, | / / / /
=========|
|==============|/=////
:: Spring Boot :: (v2.0.1.RELEASE)

2018-04-23 16:41:15.619 INFO 13388 --- [ main] com.example.demo.Demo9Application : No active profile set, falling back to default profiles: default
2018-04-23 16:41:15.630 INFO 13388 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@30c93896: startup date [Mon Apr 23 16:41:15 EDT 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@1018bde2
2018-04-23 16:41:16.286 INFO 13388 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=d605ea19-f40b-3b54-a294-609729dde5b5
2018-04-23 16:41:16.302 INFO 13388 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-04-23 16:41:16.386 INFO 13388 --- [ main] o.s.core.annotation.AnnotationUtils : Failed to introspect annotations on class org.springframework.cloud.netflix.hystrix.HystrixAutoConfiguration$$EnhancerBySpringCGLIB$$79b257d5: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
2018-04-23 16:41:16.391 INFO 13388 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$e65df93a] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-04-23 16:41:16.627 INFO 13388 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-04-23 16:41:16.649 INFO 13388 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-04-23 16:41:16.649 INFO 13388 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.29
2018-04-23 16:41:16.654 INFO 13388 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_171\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_171/bin/server;C:/Program Files/Java/jre1.8.0_171/bin;C:/Program Files/Java/jre1.8.0_171/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\system32\wbem;C:\Windows\system32\windowspowershell\v1.0;c:\program files\citrix\icaservice;c:\program files\citrix\system32;c:\program files\citrix\virtual desktop agent;c:\program files (x86)\ibm\gsk8\lib;C:\IBM\SQLLIB\BIN;C:\IBM\SQLLIB\FUNCTION;C:\IBM\SQLLIB\SAMPLES\REPL;C:\Program Files\CollabNet\Subversion Client;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Enterprise Vault\EVClient;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\dev-dksc102876\AppData\Roaming\Cloud Foundry;C:\Program Files\nodejs;C:\Program Files\Java\jdk1.8.0_111\bin;C:\Program Files (x86)\Google\Chrome\Application\chrome.exe;C:\Program Files\Oracle\VirtualBox\VBoxManage.exe;C:\Program Files\Docker Toolbox;C:\Users\dev-dksc102876\AppData\Roaming\npm;C:\Users\dev-dksc102876\Desktop\spring-tool-suite-3.9.1.RELEASE-e4.7.1a-win32-x86_64\sts-bundle\sts-3.9.1.RELEASE;;.]
2018-04-23 16:41:16.853 INFO 13388 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-04-23 16:41:16.854 INFO 13388 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1224 ms
2018-04-23 16:41:17.052 INFO 13388 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/]
2018-04-23 16:41:17.052 INFO 13388 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/
]
2018-04-23 16:41:17.052 INFO 13388 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/]
2018-04-23 16:41:17.053 INFO 13388 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/
]
2018-04-23 16:41:17.053 INFO 13388 --- [ost-startStop-1] .s.DelegatingFilterProxyRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*]
2018-04-23 16:41:17.053 INFO 13388 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-04-23 16:41:17.115 WARN 13388 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2018-04-23 16:41:17.115 INFO 13388 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2018-04-23 16:41:17.120 WARN 13388 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2018-04-23 16:41:17.120 INFO 13388 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2018-04-23 16:41:17.216 INFO 13388 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-04-23 16:41:17.333 INFO 13388 --- [ main] o.s.core.annotation.AnnotationUtils : Failed to introspect annotations on class org.springframework.cloud.netflix.hystrix.HystrixAutoConfiguration$$EnhancerBySpringCGLIB$$79b257d5: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
2018-04-23 16:41:17.334 INFO 13388 --- [ main] o.s.core.annotation.AnnotationUtils : Failed to introspect annotations on class org.springframework.cloud.netflix.hystrix.HystrixAutoConfiguration$$EnhancerBySpringCGLIB$$79b257d5: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
2018-04-23 16:41:17.426 INFO 13388 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@30c93896: startup date [Mon Apr 23 16:41:15 EDT 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@1018bde2
2018-04-23 16:41:17.431 INFO 13388 --- [ main] o.s.core.annotation.AnnotationUtils : Failed to introspect annotations on class org.springframework.cloud.netflix.hystrix.HystrixAutoConfiguration$$EnhancerBySpringCGLIB$$79b257d5: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
2018-04-23 16:41:17.431 INFO 13388 --- [ main] o.s.core.annotation.AnnotationUtils : Failed to introspect annotations on class org.springframework.cloud.netflix.hystrix.HystrixAutoConfiguration$$EnhancerBySpringCGLIB$$79b257d5: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
2018-04-23 16:41:17.487 INFO 13388 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-04-23 16:41:17.488 INFO 13388 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-04-23 16:41:17.493 WARN 13388 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
2018-04-23 16:41:17.495 INFO 13388 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2018-04-23 16:41:17.510 INFO 13388 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-04-23 16:41:17.520 ERROR 13388 --- [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1702) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:579) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE]
at com.example.demo.Demo9Application.main(Demo9Application.java:10) [classes/:na]
Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724) ~[na:1.8.0_171]
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531) ~[na:1.8.0_171]
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355) ~[na:1.8.0_171]
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286) ~[na:1.8.0_171]
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120) ~[na:1.8.0_171]
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72) ~[na:1.8.0_171]
at java.lang.Class.createAnnotationData(Class.java:3521) ~[na:1.8.0_171]
at java.lang.Class.annotationData(Class.java:3510) ~[na:1.8.0_171]
at java.lang.Class.createAnnotationData(Class.java:3526) ~[na:1.8.0_171]
at java.lang.Class.annotationData(Class.java:3510) ~[na:1.8.0_171]
at java.lang.Class.getAnnotation(Class.java:3415) ~[na:1.8.0_171]
at java.lang.reflect.AnnotatedElement.isAnnotationPresent(AnnotatedElement.java:258) ~[na:1.8.0_171]
at java.lang.Class.isAnnotationPresent(Class.java:3425) ~[na:1.8.0_171]
at org.springframework.core.annotation.AnnotatedElementUtils.hasAnnotation(AnnotatedElementUtils.java:573) ~[spring-core-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.isHandler(RequestMappingHandlerMapping.java:177) ~[spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:217) ~[spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:188) ~[spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:129) ~[spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1761) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1698) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
... 16 common frames omitted

Cloud Foundry Certificate Truster

Is it really necessary for this package:

<dependency>
	<groupId>io.pivotal.spring.cloud</groupId>
	<artifactId>cloudfoundry-certificate-truster</artifactId>
</dependency>

to be a part of the starters such as the service registry starter?

My concern is taken from the library's GitHub repo:
"Use of this library is strongly discouraged. Providing a library that essentially disables or bypasses a major facet of inter-application communication security, while convenient for development, also makes it easy for developers to deploy insecure applications to production. Platforms like Cloud Foundry have made it easier to centralize SSL certificate management at an operations level, eliminating any need for a library like this. As such, this library is not being actively maintained and there are no plans to publish further releases of the library"

By including it with the service registry starter, you are unintentionally exposing anyone that uses it to a massive security risk if they accidentally leak out a TRUST_CERTS environment variable or a machine becomes compromised and that variable is set.

Developer wants to rotate private-key for ssh mirror access

Presently, once a mirror is created, its private-key can never be updated.
Consequently, create-service will drop/forget any private-key provided for an ssh mirror if mirror already exists.

If the private-key for an existing mirror is associated with a user that no longer exists, or is revoked, the mirror will be broken (not update-able).

Revisit starter dependencies

I realized yesterday a bit by accident that spring-cloud-services-starter-config-client alone was starting a web server.

The current project structure looks weird to me. I'd strongly recommend you not to add dependencies to a parent as it makes it extremely difficult to track down what the (direct) dependencies of a particular starter is. I guess that this arrangement is partially the reason why something that isn't web related relies on the web starter.

As a side note, having stronger opinion for the user never was a best practice and is even more problematic now that the user can choose between the Servlet (starter-web) and the Reactive (starter-webflux) stack.

2.0.0.M1 Enables Security even if that auto configuration is excluded

Version 2.0.0.M1 of these service connectors / starters autoconfigures Spring Security even though I have disabled it in the application.yml with the property below:

spring:
  autoconfigure:
    exclude: org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration

-- edit, more details --
Just to clarify, locally security gets disabled, so the property works, as soon as the application gets deployed to PCF, security is enabled again.
-- end edit --

As an aside, why do these connectors automatically autoconfigure Spring Security? I get that the connectors themselves need Spring Security to make the handshake with PCF provided services, however, shouldn't these connectors stay out of the way of the apex application and only autoconfigure security if the apex application has included security as a dependency?

Spring Cloud Services incorrectly handles Environment

In a nutshell, when the org.springframework.cloud:spring-cloud-services-starter-service-registry dependency is added to the CLASSPATH of a Spring Boot, Pivotal GemFire ClientCache application deployed to PCF, connected to PCC, the dependency loses critical, contextual information stored in the Environment by Spring Boot for Pivotal GemFire (SBDG) using a custom PropertySource.

As a result, the Spring Boot, Pivotal GemFire ClientCache application (based on SBDG) is unable to authenticate and connect to the PCC instance deployed in PCF.

You can successfully reproduce this issue by doing the following:

  1. Clone the SBDG project.

  2. Create a topic branch from 1.0.0.M3 (here).

NOTE: You cannot simply branch from the HEAD of master since I have already checked in a "workaround" to this issue in commit 2e26325.

  1. Add the org.springframework.cloud:spring-cloud-services-starter-service-registry to the CLASSPATH of the SBDG spring-geode-autoconfigure module (for example).

  2. Then, run the AutoConfiguredCloudSecurityContextIntegrationTest class and see the test fail!

Without the org.springframework.cloud:spring-cloud-services-starter-service-registry dependency on the CLASSPATH, the AutoConfiguredCloudSecurityContextIntegrationTest passes as expected.

After in-depth analysis, my debugging revealed the main culprit in this issue involves the BootstrapApplicationListener class.

In summary...

The BootstrapApplicationListener, as its name implies, creates a new (temporary) "bootstrap" ApplicationContext along with a new (also, temporary) Environment object. This "bootstrap" context becomes the "parent" of the main ApplicationContext started/initialized by the Spring Boot application on startup. The BootstrapApplicationListener additionally copies/removes critical information (e.g. a SBDG custom PropertySource) from the main Environment to the "bootstrap" Environment object, which is later discarded from the "bootstrap" Environment. This "bootstrap" Environment is somehow passed to the SDG Security configuration handling classes, thus causing the underlying SDG @Configuration class used to authenticate the GemFire ClientCache app instance with PCC in PCF to not have the necessary Security (auth) credentials available to it upon inspecting the Environment, leading to an eventual authentication error.

Anyway, I tracked the beginning of this issue down to this snippet of code.
Because SBDG used a PropertiesPropertySource to capture the Security (auth) credentials from the VCAP environment into a custom named PropertySource, and the Spring PropertiesPropertySource is an EnumerablePropertySource, this is how the SBDG custom name PropertySource gets copied and lost, unlike other PropertySources, which Spring Boot adds, that won't get lost because they are not EnumerablePropertySources. :(

Additional details for this problem will be provided below, in follow up comments.

Cloud config client - class not found when running in PCF and rabbit is not on the classpath

Using 1.6.2 in PCF, I am getting a 'class not found' exception when rabbit is not on the class path.

compile 'io.pivotal.spring.cloud:spring-cloud-services-starter-config-client:1.6.2.RELEASE'
java.lang.NoClassDefFoundError: org/springframework/amqp/rabbit/connection/ConnectionFactory
 at io.pivotal.spring.cloud.config.java.ServiceInfoPropertySourceAdapter.appIsBoundToRabbitMQ(ServiceInfoPropertySourceAdapter.java:91)
private boolean appIsBoundToRabbitMQ() {
	boolean hasEnvironmentBinding = environment.containsProperty("spring.rabbitmq.host") &&
			!environment.getProperty("spring.rabbitmq.host").equals("localhost");

	//Connection Factory is not on the class path, this line is causing the problem
	boolean hasCloudBinding = !cloud.getServiceInfos(ConnectionFactory.class).isEmpty();
	return hasEnvironmentBinding || hasCloudBinding;
}

Secrets from "default" CredHub profile should be served for all client profiles

The CredHub backend for config server treats the "default" profile as a fallback if no other profiles are specified.

This, however, is inconsistent with how the default profile is used with Git backends (and I believe Vault backends as well). In those backends, the "default" profile is always available, regardless of which profiles are active in the config client. Properties from the default profile just take lower precedence than those from active profiles.

For example, if a client requests properties from config server for an application named "myapp" and a profile named "default", then the secrets stored in CredHub in the "default" profile will be served. (This works now.) But if the client requests properties with a profile named "cloud", then the results should contain two property sources, one for "cloud" (with higher precedence) as well as one for "default".

This is similar to #1017 for secrets shared across applications from the default "application" should be available to all applications regardless of their name.

Vulnerability issue CVE-2019-3778

We have a dependency on spring-cloud-services-dependencies, which depends on org.springframework.security.oauth:spring-security-oauth2:jar:2.3.4.RELEASE. This oauth version is vulnerable to issue CVE-2019-3778. Could you please upgrade to 2.3.5, which does not seem to have this issue.

RESEARCH: Vault kvVersion support

There is a reported issue that suggests that SCS (presumably 2.x) may not support the kvVersion configuration property which allows Spring Cloud Config Server to operate against a version of Vault greater than 0.10.0.

To get to the bottom of this, we should:

  • Test SCS 2.0.7's config-server against a newer version of Vault, verifying that you can set kvVersion when specifying the configuration for the config server.
  • Test SCS 3.0's config-server against a newer version of Vault, verifying that you can set kvVersion when specifying the configuration for the config server.
  • If either of the above fail, create relevant issues to fix support for kvVersion.
  • If either of the above fail, test the workaround option of specifying the kvVersion as an environment variable on the backing app.
  • Consider adding a newer version of Vault to support our ATs, either in addition to the older instance of Vault at scs-vault.af.pivotal.io or as a replacement for that instance. The replace/add decision comes down to whether we want to continue supporting Vault versions older than 0.10.0. (The current version is 1.1.2.)

RabbitMQ configuration failure with version 1.5.0.RELEASE for service registery

My application uses the 1.5.0.RELEASE for service registry depencency. Whenever I deploy the application to PCF the application is unable to create any exchange or queues. It works well with 1.4.0.RELEASE so i think something in the latter release is breaking it. I also noticed that having the connection params for rabbit (host, port, virtualhost, username, password) in the user provided environment variables resolves the issue but that is not the right way to do it.

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId> </dependency>

<dependency> <groupId>io.pivotal.spring.cloud</groupId> <artifactId>spring-cloud-services-starter-service-registry</artifactId> <version>1.5.0.RELEASE</version> </dependency>

Properties not resolved on FactoryBean initialization

Hi,
I've just finished with a bug in spring-cloud-context which loaded FactoryBeans too early when using the Config Server.
The demo project I added there shows that the bug is fixed using a snapshot build of spring-cloud-context.

But when I add the fixed artifact to my project that is deployed to PCF, the bug is not fixed.
I use the io.pivotal.spring.cloud:spring-cloud-services-starter-config-client:2.0.2.RELEASE dependency in this project with org.springframework.cloud:spring-cloud-context:2.0.3.BUILD-SNAPSHOT set in dependency management, so it should fix the bug. I've also verified it to be physically present in the Spring Boot jar when pushing to PCF.

Seems to me it could be that the same issue is located somewhere in the pivotal-cf code, or the RefreshAutoConfiguration is not used or overridden when running on PCF.

Jersey Not Defined in Spring Cloud Edgware

I upgraded one of our Spring Boot services from looking like this in the POMs:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.5.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<dependency>
    <groupId>io.pivotal.spring.cloud</groupId>
    <artifactId>spring-cloud-services-dependencies</artifactId>
    <version>1.5.0.RELEASE</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-dependencies</artifactId>
    <version>Dalston.SR5</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

to this:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.10.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<dependency>
    <groupId>io.pivotal.spring.cloud</groupId>
    <artifactId>spring-cloud-services-dependencies</artifactId>
    <version>1.6.3.RELEASE</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-dependencies</artifactId>
    <version>Edgware.SR3</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

Now we get the following error when we try to reach out to another service inside of Cloud Foundry.

Error creating bean with name 'ribbonRestClient' defined in org.springframework.cloud.netflix.ribbon.RestClientRibbonConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.niws.client.http.RestClient]: Factory method 'ribbonRestClient' threw exception; nested exception is java.lang.NoClassDefFoundError: com/sun/jersey/api/client/config/ClientConfig

We are deploying our service into on premise Pivotal Cloud Foundry and we are using the Service Registry service built into PCF ("tile").

This is the specific stack trace we're getting:

2018-04-09_20:05:42.590 ERROR org.apache.juli.logging.DirectJDKLog.log ln182  Message: Servlet.service() for servlet [dispatcherServlet] in context with path [/api/v1] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ribbonRestClient' defined in org.springframework.cloud.netflix.ribbon.RestClientRibbonConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.niws.client.http.RestClient]: Factory method 'ribbonRestClient' threw exception; nested exception is java.lang.NoClassDefFoundError: com/sun/jersey/api/client/config/ClientConfig] with root cause
java.lang.ClassNotFoundException: com.sun.jersey.api.client.config.ClientConfig
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.springframework.cloud.netflix.ribbon.RestClientRibbonConfiguration.ribbonRestClient(RestClientRibbonConfiguration.java:58)
at org.springframework.cloud.netflix.ribbon.RestClientRibbonConfiguration$$EnhancerBySpringCGLIB$$4a284cff.CGLIB$ribbonRestClient$0(<generated>)
at org.springframework.cloud.netflix.ribbon.RestClientRibbonConfiguration$$EnhancerBySpringCGLIB$$4a284cff$$FastClassBySpringCGLIB$$ab36db6.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
at org.springframework.cloud.netflix.ribbon.RestClientRibbonConfiguration$$EnhancerBySpringCGLIB$$4a284cff.ribbonRestClient(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:220)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1018)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:340)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:345)
at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:89)
at org.springframework.cloud.netflix.ribbon.SpringClientFactory.getInstance(SpringClientFactory.java:110)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1092)
at org.springframework.cloud.context.named.NamedContextFactory.getInstance(NamedContextFactory.java:124)
at org.springframework.cloud.netflix.ribbon.SpringClientFactory.getClient(SpringClientFactory.java:51)
at org.springframework.cloud.netflix.ribbon.RibbonClientHttpRequestFactory.createRequest(RibbonClientHttpRequestFactory.java:51)
at <custom>.RequestCorrelationClientHttpRequestInterceptor.intercept(RequestCorrelationClientHttpRequestInterceptor.java:61)
at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:86)
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53)
at org.springframework.http.client.InterceptingClientHttpRequest.executeInternal(InterceptingClientHttpRequest.java:70)
at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:660)
at org.springframework.cloud.netflix.metrics.MetricsClientHttpRequestInterceptor.intercept(MetricsClientHttpRequestInterceptor.java:64)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at <custom>.JwtForwardingClientHttpRequestInterceptor.intercept(JwtForwardingClientHttpRequestInterceptor.java:53)
at org.springframework.web.client.RestTemplate$$FastClassBySpringCGLIB$$aa4e9ed0.invoke(<generated>)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
at org.springframework.cloud.netflix.metrics.RestTemplateUrlTemplateCapturingAspect.captureUrlTemplate(RestTemplateUrlTemplateCapturingAspect.java:33)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:621)
at org.springframework.web.client.RestTemplate.getForEntity(RestTemplate.java:320)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.web.client.RestTemplate$$EnhancerBySpringCGLIB$$2ffd02d3.getForEntity(<generated>)
at <custom>.Controller.doStuff(Controller.java:45)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
at <custom>.Service.doStuff(Service.java:25)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:208)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at ch.qos.logback.classic.helpers.MDCInsertingServletFilter.doFilter(MDCInsertingServletFilter.java:49)
at <custom>.doFilter(Filter.java:56)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:677)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.lang.Thread.run(Thread.java:748)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.cloudfoundry.router.ClientCertificateMapper.doFilter(ClientCertificateMapper.java:77)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

These are gists for the maven dependency trees for before and after:
maven dependency trees

Here's a link to my stack overflow question with a comment from @wilkinsona
stack overflow

Is including the ribbon starter he references the new, recommended approach after 1.6.0 of spring cloud services dependencies or is there something else to do?

Spring Boot 2 Support

I am working on upgrading one of our services that runs inside PCF to SB 2 and ran into an issue with this not having a working version for SB 2. Is there an ETA on that or a better place to track that? Thanks.

spring-cloud-starter-oauth2 issue with spring-cloud-services-dependencies

My project is using spring-cloud-services-starter-config-client and spring-cloud-starter-oauth2. I try to configure oauth2 client (client credentials grant type) by adding @EnableOAuth2Client annotation. My IDE (IntelliJ) is not able to find it. screenshot

When I remove this dependency management, it's working.

        <dependency>
                <groupId>io.pivotal.spring.cloud</groupId>
                <artifactId>spring-cloud-services-dependencies</artifactId>
                <version>${spring-cloud-services.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

Versions:
Spring-boot.version: 2.1.4.RELEASE
spring-cloud-services.version: 2.1.2.RELEASE
spring-cloud.version: Greenwich.SR1

Have you seen this issue before?

Here my github repo

Spring Cloud Services Starter Service Registry Issue with Version 1.6.x series

Hi ,

There is a Multi DC Scenario:

Using 1.3.1.RELEASE will register Application with Diego IP(198.x.x.x series) ( CROSS DC is possible ) Meaning, Zuul from one DC can connect to App in another DC

Using 1.6.1.RELEASE will register Application with Container IP (10.x.x.x series), ( CROSS DC is NOT possible ) Meaning, Zuul from one DC CANNOT connect to App in another DC... I/O Exception .

HA is not possible in this case 1.6.1.RELEASE ...

No point of using Peer Replication if this is the case..

I want Application to register with Diego IP with the latest Version as well for High Availability

Can anyone please help,

SCS Starters 2.1.0.RELEASE build against Greenwich.RC2

Although Connectors are building against Greenwich.RELEASE, starters refer to Greenwich.RC2. This may result in some users having the wrong version of Spring Cloud in their project.

The workaround (I think) is to have them explicitly declare Greenwich.RELEASE in their own build.

Should we cut a new starters release to fix this? And, if so, should we also cut a connectors release so that the versions are in sync?

Discovery-first approach for Config server failing with Http error 401

There are couple of Spring Cloud services available in Pivotal Cloud Foundry (CF):

  1. p-service-registry (Spring Cloud Eureka)
  2. p-config-server (Spring Cloud Config Server)

Here, we are aiming to build discovery-first approach for our Springboot client applications.

What we have done so far in CF is:

a. Bring up Eureka CF service (works OK)

  • Using CF Service p-service-registry
  • This by default, requires OAuth2 authentication by client application

b. Bring up Config Server (works OK)

  • This is our own Springboot annotated application (using @EnableConfigServer), which connects to our own Git repository to serve the configuration
  • It registers itself with Eureka during startup
    • uses spring-cloud-services-starter-service-registry
    • uses @EnableDiscoveryClient
    • flag eureka.client.enabled = true
  • registers with Eureka with name as "sb-config-server"
  • Config Server requires Http Basic Authentication by Client application wanting to fetch the configuration

c. Bring up Client application (Fails with Error 401)

  • This is our own Springboot annotated client application
  • It registers itself with Eureka during startup
    • uses spring-cloud-services-starter-service-registry
    • uses @EnableDiscoveryClient
    • flag eureka.client.enabled = true
  • what we additionally require is, Config Server should also be discovered during Eureka registration process [This is where the problem is]
    • we added dependency on spring-cloud-services-starter-service-registry
    • we have set spring.cloud.config.discovery.enabled to true
    • we have set spring.cloud.config.discovery.serviceId correctly to "sb-config-server"
    • for Config Server, we have set Http Basic Authentication parameters - eureka.instance.metadataMap.username to "user" and eureka.instance.metadataMap.password to <>
  • Problem is we are getting Http Error code 401 during Config Server discovery process (as a result, Eureka registration fails)

Error 401:

:
2017-10-18T10:33:25.97+0530 [APP/PROC/WEB/0]OUT 2017-10-18 05:03:25,971 DEBUG [main] com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient (<init>:42) - Created client for url: https://eureka-4ad7d239-9023-4a8c-a11f-18ad4afd4d02.cfapps.io/eureka/
2017-10-18T10:33:26.29+0530 [APP/PROC/WEB/0]ERR 	at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:444) [eureka-client-1.4.12.jar!/:1.4.12]
2017-10-18T10:33:26.28+0530 [APP/PROC/WEB/0]OUT 2017-10-18 05:03:26,289 DEBUG [main] com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient (executeOnNewServer:121) - Pinning to endpoint null
2017-10-18T10:33:26.29+0530 [APP/PROC/WEB/0]OUT 2017-10-18 05:03:26,289 WARN  [main] com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient (execute:127) - Request execution failure with status code 401; retrying on another server if available
2017-10-18T10:33:26.29+0530 [APP/PROC/WEB/0]ERR 2017-10-18 05:03:26,289 WARN  [main] com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient (execute:127) - Request execution failure with status code 401; retrying on another server if available
2017-10-18T10:33:26.29+0530 [APP/PROC/WEB/0]OUT 2017-10-18 05:03:26,290 ERROR [main] com.netflix.discovery.DiscoveryClient (fetchRegistry:951) - DiscoveryClient_SB-CLIENT/94ba527c-51b6-4050-46d8-bf4e - was unable to refresh its cache! status = Cannot execute request on any known server
2017-10-18T10:33:26.29+0530 [APP/PROC/WEB/0]OUT com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
2017-10-18T10:33:26.29+0530 [APP/PROC/WEB/0]OUT 	at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:111) ~[eureka-client-1.4.12.jar!/:1.4.12]
:

Other observation is, if we disable Config Server discovery (i.e. if we comment flag spring.cloud.config.discovery.enabled) , then error 401 goes away. Client application registers successfully with Eureka (but without Config Server discovery).

:
2017-10-18T10:38:51.73+0530 [APP/PROC/WEB/0]OUT 2017-10-18 05:08:51,739 DEBUG [main] com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient (<init>:42) - Created client for url: https://eureka-4ad7d239-9023-4a8c-a11f-18ad4afd4d02.cfapps.io/eureka/
2017-10-18T10:38:52.21+0530 [APP/PROC/WEB/0]OUT 2017-10-18 05:08:52,215 DEBUG [main] com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient (getApplicationsInternal:206) - Jersey HTTP GET https://eureka-4ad7d239-9023-4a8c-a11f-18ad4afd4d02.cfapps.io/eureka//apps/?; statusCode=200
2017-10-18T10:38:52.21+0530 [APP/PROC/WEB/0]OUT 2017-10-18 05:08:52,216 DEBUG [main] com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient (executeOnNewServer:121) - Pinning to endpoint null
2017-10-18T10:38:52.21+0530 [APP/PROC/WEB/0]OUT 2017-10-18 05:08:52,216 INFO  [main] com.netflix.discovery.DiscoveryClient (getAndStoreFullRegistry:1035) - The response status is 200
2017-10-18T10:38:52.21+0530 [APP/PROC/WEB/0]OUT 2017-10-18 05:08:52,216 DEBUG [main] com.netflix.discovery.DiscoveryClient (getAndStoreFullRegistry:1041) - Got full registry with apps hashcode UP_1_
:

service-registry


What could be the issue here?

Is there any limitation with "spring-cloud-services-starter-service-registry" that prevents us from discovering our own Config Server? (resulting in error 401)

Is there any working example of Discovery-first approach that works with Eureka and Custom Spring Config Server?

Error with dependencies in version 2.1.1.RELEASE of spring-cloud-services-starter-service-registry

Hi everyone!

I'm trying to use in my project the following BOM for Pivotal Spring Cloud:

<dependency>
    <groupId>io.pivotal.spring.cloud</groupId>
    <artifactId>spring-cloud-services-dependencies</artifactId>
    <version>2.1.2.RELEASE</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

But, when I import the starter for the Service Registry:

<dependency>
    <groupId>io.pivotal.spring.cloud</groupId>
    <artifactId>spring-cloud-services-starter-service-registry</artifactId>
</dependency>

I'm getting an error because Maven can't download the following transitive artifact, as it's not available on Maven Central:
io.pivotal.spring.cloud:spring-cloud-services-cloudfoundry-connector:jar:2.1.1.RELEASE.

This error happens because the only available versions are 2.1.2.RELEASE and 2.1.0.RELEASE. Shouldn't it be pointing to the first one instead of the 2.1.1.RELEASE?

Thanks and regards,

Esteban

Extract autoconfig from connectors/cfenv into new module(s)

Extract scs client-side autoconfig from connectors/cfenv into new modules that will be included in scs starters.

Background: In moving our scs client-side functionality from connectors to java-cfenv, it's become clear that most of this functionality lives in autoconfig that does not belong in java-cfenv.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.