These are chat archives for spring-cloud/spring-cloud

2nd
Jan 2019
muhmadtabrez
@muhmadtabrez
Jan 02 05:35
@marcosbarbero could you please look in to my issue please
Marcos Barbero
@marcosbarbero
Jan 02 05:42
Hi @muhmadtabrez can you debug it and verify whether the request is going to the right adapter?
muhmadtabrez
@muhmadtabrez
Jan 02 06:30
@marcosbarbero yes i debug it and request is going through basic authentication adapter
is it important to login every time for calling an api if we are using zuul
can you also please suggest any good example on how to use oauth2 with basic authentication.
Marcos Barbero
@marcosbarbero
Jan 02 06:42
@muhmadtabrez what do you mean by use oauth2 with basic authentication?
muhmadtabrez
@muhmadtabrez
Jan 02 07:05

@marcosbarbero i mean to say. i have two cases where for accessing my apis(microservices) secured using external oauth2 server cloud foundry uaa

  1. using Zuul(api gateway) with csrf enabled for browser requests
  2. using Zuul(api gateway) without csrf token for mobile device.

I thought of createing two WebSecurityConfigurerAdapter one for enabling csrf and other disbale csrf but,i have enabled httbasic in second adapter.

Please let me know wether my approach is correct or not. Since i want to use the same apis for both mobile and browser.

Marcos Barbero
@marcosbarbero
Jan 02 07:10
You can pretty much do that, the adapters are probably misconfigured. If you could create a minimal project reproducing the issue that would be easier to help you out
Michael Tecourt
@michaeltecourt
Jan 02 12:47
Hej, Happy new year :tada:
I was about to ask a question here, but figured out it might benefit others so I posted it on StackOverflow : https://stackoverflow.com/questions/54006653/applicationcontextinitializer-loaded-twice-by-spring-cloud-bootstrap-context-s
BenEfrati
@BenEfrati
Jan 02 13:14
@michaeltecourt Consider different package name for bootstrap autoconfiguration classes that is not under @ComponentScan packages
Michael Tecourt
@michaeltecourt
Jan 02 13:36
The initializer is not component scanned, it is declared in a spring.factories file. Spring Cloud picks up the same key as Spring Boot (org.springframework.context.ApplicationContextInitializer) so the initializer gets loaded twice, and this is by design according to @spencergibb
dragontree101
@dragontree101
Jan 02 13:54
i use upgrade to springboot 2.1.1 and springcloud-G-RC2 , and use jdk11, when i use feign, i found exception
2019-01-02 21:50:44.029] [hystrix-partner-mono-1] [86062802987baaa8] [] WARN  o.s.c.a.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/boot/context/properties/EnableConfigurationPropertiesImportSelector$ConfigurationPropertiesBeanRegistrar.class] cannot be opened because it does not exist
[2019-01-02 21:50:44.032] [hystrix-partner-mono-2] [0dec060ff6ea02b6] [] WARN  o.s.c.a.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/boot/context/properties/EnableConfigurationPropertiesImportSelector$ConfigurationPropertiesBeanRegistrar.class] cannot be opened because it does not exist
[2019-01-02 21:50:44.035] [hystrix-increase-mono-1] [5a3b071cdcebdcba] [] WARN  o.s.c.a.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/boot/context/properties/EnableConfigurationPropertiesImportSelector$ConfigurationPropertiesBeanRegistrar.class] cannot be opened because it does not exist
[2019-01-02 21:50:44.042] [hystrix-increase-mono-1] [5a3b071cdcebdcba] [] INFO  c.h.t.u.i.increase.fallback.IncreaseApiFallback - hnUserId:1365297,调用getVipLevel失败
[2019-01-02 21:50:44.044] [hystrix-partner-mono-2] [0dec060ff6ea02b6] [] WARN  c.h.t.u.invoke.partner.fallback.PartnerApiFallback - Failed to process import candidates for configuration class [org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/boot/context/properties/EnableConfigurationPropertiesImportSelector$ConfigurationPropertiesBeanRegistrar.class] cannot be opened because it does not exist
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/boot/context/properties/EnableConfigurationPropertiesImportSelector$ConfigurationPropertiesBeanRegistrar.class] cannot be opened because it does not exist
    at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:599)
    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:302)
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:242)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:167)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:315)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
    at org.springframework.context.support.P
i found some issue in spring-cloud/spring-cloud-netflix#3101, but doesn't know how to slove this problem
and stack is
[2019-01-02 21:50:44.044] [hystrix-partner-mono-1] [86062802987baaa8] [] WARN  c.h.t.u.invoke.partner.fallback.PartnerApiFallback - Failed to process import candidates for configuration class [org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/boot/context/properties/EnableConfigurationPropertiesImportSelector$ConfigurationPropertiesBeanRegistrar.class] cannot be opened because it does not exist
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/boot/context/properties/EnableConfigurationPropertiesImportSelector$ConfigurationPropertiesBeanRegistrar.class] cannot be opened because it does not exist
    at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:599)
    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:302)
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:242)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:167)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:315)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:691)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:528)
    at org.springframework.cloud.context.named.NamedContextFactory.createContext(NamedContextFactory.java:120)
    at org.springframework.cloud.context.named.NamedContextFactory.getContext(NamedContextFactory.java:88)
    at org.springframework.cloud.netflix.ribbon.SpringClientFactory.getContext(SpringClientFactory.java:118)
    at org.springframework.cloud.context.named.NamedContextFactory.getInstance(NamedContextFactory.java:129)
    at org.springframework.cloud.netflix.ribbon.SpringClientFactory.getInstance(SpringClientFactory.java:108)
    at org.springframework.cloud.netflix.ribbon.SpringClientFactory.getClientConfig(SpringClientFactory.java:65)
    at org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient.getClientConfig(LoadBalancerFeignClient.java:80)
    at org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient.execute(LoadBalancerFeignClient.java:64)
    at org.springframework.cloud.sleuth.instrument.web.client.feign.TraceLoadBalancerFeignClient.execute(TraceLoadBalancerFeignClient.java:70)
    at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:108)
    at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:78)
    at feign.hystrix.HystrixInvocationHandler$1.run(HystrixInvocationHandler.java:106)
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:302)
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:298)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35)
    at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
    at rx.internal.operators.OnSubscribeLift.call(OnSu
Gilles Robert
@ask4gilles
Jan 02 15:49
Hi folks and happy New Year!
(Context: SB 2.1.1 and Spring Cloud Greenwich RC2)
I'm using the spring cloud config server to manage my properties.
Everything works fine, except that the changes I made (hikari pool size for example) are not reflected in my prometheus actuator endpoint.
Should I define my own CollectorRegistry bean with @RefeshScope for that? thx