text:
BeanCreationException when using context-resource-loader

I’m encountering the exception below when trying to use the <context-resource-loader /> in my application.  I’ve narrowed it down to the following line of code in ResourceLoaderBeanPostProcessor:
beanFactory.registerResolvableDependency(BeanFactory.class, this.applicationContext);
When I comment this line out, the application deploys successfully and I’m able to leverage the SimpleStorageResourceLoader injected via:
@Inject
private ResourceLoader resourceLoader;

I’m not going to pretend to fully understand what is going on but it seems like any BeanPostProcessor that gets applied after the ResourceLoaderBeanPostProcessor fails.  I’m working on putting a smaller test case together to demonstrate the issue but wanted to log the ticket in case anyone has encountered it.
Spring Cloud AWS config:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:aws-context="http://www.springframework.org/schema/cloud/aws/context"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/cloud/aws/context
        http://www.springframework.org/schema/cloud/aws/context/spring-cloud-aws-context-1.0.xsd">

  <aws-context:context-region region="us-west-2" />
  <aws-context:context-credentials />
  <aws-context:context-resource-loader />
</beans>

Relevant Spring dependencies:
    <spring.version>4.1.4.RELEASE</spring.version>
    <spring-cloud-aws-context.version>1.0.0.RC2</spring-cloud-aws-context.version>
    <spring-data-commons.version>1.9.2.RELEASE</spring-data-commons.version>
    <spring-data-jpa.version>1.7.2.RELEASE</spring-data-jpa.version>
    <spring-integration.version>4.1.2.RELEASE</spring-integration.version>
    <spring-mobile-device.version>1.1.3.RELEASE</spring-mobile-device.version>
    <spring-security.version>3.2.5.RELEASE</spring-security.version>

Exception (happens on start up):
Wrapped by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.expression.IntegrationEvaluationContextAwareBeanPostProcessor#0': BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration.setObjectPostProcessor(org.springframework.security.config.annotation.ObjectPostProcessor); nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'objectPostProcessor' defined in class org.springframework.security.config.annotation.configuration.ObjectPostProcessorConfiguration: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.beans.factory.config.AutowireCapableBeanFactory]: : No qualifying bean of type [org.springframework.beans.factory.config.AutowireCapableBeanFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.beans.factory.config.AutowireCapableBeanFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:472) ~[AbstractAutowireCapableBeanFactory.class:4.1.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[AbstractBeanFactory$1.class:4.1.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[DefaultSingletonBeanRegistry.class:4.1.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[AbstractBeanFactory.class:4.1.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[AbstractBeanFactory.class:4.1.4.RELEASE]
	at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:232) ~[PostProcessorRegistrationDelegate.class:4.1.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:615) ~[AbstractApplicationContext.class:4.1.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:465) ~[AbstractApplicationContext.class:4.1.4.RELEASE]
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) ~[ContextLoader.class:4.1.4.RELEASE]
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) ~[ContextLoader.class:4.1.4.RELEASE]
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [ContextLoaderListener.class:4.1.4.RELEASE]
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4795) [catalina.jar:8.0.14]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5221) [catalina.jar:8.0.14]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.0.14]
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724) [catalina.jar:8.0.14]
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700) [catalina.jar:8.0.14]
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714) [catalina.jar:8.0.14]
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:919) [catalina.jar:8.0.14]
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:461) [catalina.jar:8.0.14]
	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1495) [catalina.jar:8.0.14]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_20]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_20]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_20]
	at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_20]
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) [tomcat-coyote.jar:8.0.14]
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) [na:1.8.0_20]
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) [na:1.8.0_20]
	at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1432) [catalina.jar:8.0.14]
	at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:711) [catalina.jar:8.0.14]
	at org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:423) [catalina.jar:8.0.14]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) [servlet-api.jar:na]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) [servlet-api.jar:na]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) [catalina.jar:8.0.14]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.14]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-websocket.jar:8.0.14]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.14]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.14]
	at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) [catalina.jar:8.0.14]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [catalina.jar:8.0.14]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:8.0.14]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) [catalina.jar:8.0.14]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [catalina.jar:8.0.14]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:618) [catalina.jar:8.0.14]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) [catalina.jar:8.0.14]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:8.0.14]
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610) [catalina.jar:8.0.14]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [catalina.jar:8.0.14]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537) [catalina.jar:8.0.14]
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081) [tomcat-coyote.jar:8.0.14]
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658) [tomcat-coyote.jar:8.0.14]
	at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) [tomcat-coyote.jar:8.0.14]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566) [tomcat-coyote.jar:8.0.14]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523) [tomcat-coyote.jar:8.0.14]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_20]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_20]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.0.14]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_20]

Hello @noomkram thanks for reporting. As far as I am aware nobody else had this issue. Would be great if you can provide a test case so that we can fix.
The mentionend line is basically there to allow the use of the resource loader if you inject yourself an application context or a bean factory.

Attached is a web project when deployed will generate the noted exception.
If I remove WebSecurityConfig.java from the array of root config classes, the error goes away.
  @Override
  protected Class[] getRootConfigClasses() {
    return new Class[] { ApplicationConfiguration.class, WebSecurityConfig.class };
  }
 On Thursday, February 12, 2015 7:08 AM, Agim Emruli <notifications@github.com> wrote:

Hello @noomkram thanks for reporting. As far as I am aware nobody else had this issue. Would be great if you can provide a test case so that we can fix. The mentionend line is basically there to allow the use of the resource loader if you inject yourself an application context or a bean factory.—
Reply to this email directly or view it on GitHub.

My apologies, the file

Thanks will try to reproduce and fix that with rc3

Am 12.02.2015 um 11:00 schrieb noomkram notifications@github.com:
My apologies, the file
—
Reply to this email directly or view it on GitHub.

@noomkram thanks for poviding your sample. With the fixes I did in the linked commit I am not receiving this error any more. Your app starts but fails due to a missing authentication manager in Spring Security.
RC3 should be available in just a few hours, would be great if you can test that.

Tested and working with no issues.  Thank you.

authors: aemruli noomkram


text:
config server does not point out proper git clone errors

I have migrated from spring cloud edgware to finchley. The config server stopped serving configuration with a 404 and JSON response
{
"timestamp": "2018-10-09T11:41:55.500+0000",
"status": 404,
"error": "Not Found",
"message": "Cannot clone or checkout repository: MYREPOSITORYURI",
"path": "/application/development/develop"
}
I could not figure out what is wrong, so I have started debugging. It turned out that there is a certificate validation issue in JGitEnvironmentRepository, GitAPIException is being caught in line 562 and is theoretically rethrown further up the stack. The problem was that there is a new property 'skipSslValidation' which I had to set. In edgeware that was a default and such property did not exist. Obviously this property is not a problem, except that I did not know that its SSL that is a problem.
What is the real problem, its that the certificate exception was swallowed and did not show up anywhere. I even turned on log level TRACE before I started debugging and still was not able to figure out what is the problem. It seemed like the repository is not found, and I would have assumed that If I didnt know the supplied URI did work on edgeware....
So I believe there is a need for some additional logging or additional REST responses, so whoever needs to figure out what is wrong with their repository does not need to debug the entire spring cloud config server code to find out the location where its failing and see the real exception....

Closed via 2e5933a

source: gharchive/issue

authors: maslano ryanjbaxter

repo: spring-cloud/spring-cloud-config

license_type: permissive

license_source: bigquery


text:
Config Server - Git Repository Gets Corrupted

version: 1.4.4
java version: 1.8.0_161
Sometimes it happens that the git repository gets corrupted. When this happens and config server client asks for configuration through REST API, an exception arrises all the time.
I suspect that the corrupted git repository might be because of quite old version of jgit. Unfortunately in 1.4.x version it is not easily possible to update.
The exception that arises is:
 2018-10-16 10:09:48.693 ERROR 10791 --- [o-8888-exec-553] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with   org.eclipse.jgit.errors.MissingObjectException: Missing unknown c8985cab0c8348ee44bc221e177e005cfde6bb2b          at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:148) ~[org.eclipse.jgit-3.6.1.201501031845-r.jar!/:3.6.1.201501031845-r]          at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:229) ~[org.eclipse.jgit-3.6.1.201501031845-r.jar!/:3.6.1.201501031845-r]          at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:840) ~[org.eclipse.jgit-3.6.1.201501031845-r.jar!/:3.6.1.201501031845-r]          at org.eclipse.jgit.revwalk.RevWalk.parseTree(RevWalk.java:780) ~[org.eclipse.jgit-3.6.1.201501031845-r.jar!/:3.6.1.201501031845-r]          at org.eclipse.jgit.lib.IndexDiff.<init>(IndexDiff.java:312) ~[org.eclipse.jgit-3.6.1.201501031845-r.jar!/:3.6.1.201501031845-r]          at org.eclipse.jgit.lib.IndexDiff.<init>(IndexDiff.java:295) ~[org.eclipse.jgit-3.6.1.201501031845-r.jar!/:3.6.1.201501031845-r]          at org.eclipse.jgit.api.StatusCommand.call(StatusCommand.java:142) ~[org.eclipse.jgit-3.6.1.201501031845-r.jar!/:3.6.1.201501031845-r]          at org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.shouldPull(JGitEnvironmentRepository.java:389) ~[classes!/:1.4.4.RELEASE]          at org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.refresh(JGitEnvironmentRepository.java:239) ~[classes!/:1.4.4.RELEASE]          at org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.getLocations(JGitEnvironmentRepository.java:217) ~[classes!/:1.4.4.RELEASE]          at org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.getLocations(MultipleJGitEnvironmentRepository.java:149) ~[spring-clou          at org.springframework.cloud.config.server.environment.AbstractScmEnvironmentRepository.findOne(AbstractScmEnvironmentRepository.java:42) ~[spring-cloud-config          at org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.findOne(MultipleJGitEnvironmentRepository.java:189) ~[spring-cloud-con          at org.springframework.cloud.config.server.environment.CompositeEnvironmentRepository.findOne(CompositeEnvironmentRepository.java:45) ~[spring-cloud-config-ser          at org.springframework.cloud.config.server.environment.EnvironmentEncryptorEnvironmentRepository.findOne(EnvironmentEncryptorEnvironmentRepository.java:53) ~[s          at org.springframework.cloud.config.server.environment.EnvironmentController.labelled(EnvironmentController.java:112) ~[spring-cloud-config-server-1.4.4.RELEAS          at org.springframework.cloud.config.server.environment.EnvironmentController.defaultLabel(EnvironmentController.java:96) ~[spring-cloud-config-server-1.4.4.REL          at sun.reflect.GeneratedMethodAccessor1820.invoke(Unknown Source) ~[na:na]          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]          at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]          at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.REL          at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) ~[spring-webmvc-4          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmv          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3          at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.17.RELEASE.jar!/:4.          at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) ~[spring-webmvc-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) ~[spring-webmvc-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) ~[spring-webmvc-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55) ~[spring-boot-1.5.13.RELEASE.jar          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:111) ~[spring-boot-actuator-1.5.13.RELEASE.jar!/:1.          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.REL          at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) ~[spring-security-web-4.2.6.RELEASE.j          at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) ~[spring-security-web-4.2.6.RELEASE.          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.REL          at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) ~[spring-security-web-4.2.6.RELEASE.jar!/:4          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.REL          at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.REL          at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) ~[spring-security-web-4.2.6.R          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.REL          at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) ~[spring-secu          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.REL          at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.REL          at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:215) ~[spring-security-web-4.2          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.REL          at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.RELEASE]          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.REL          at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.RELE          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.REL          at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) ~[spring-security-web-4.2.6.RE          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.REL          at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) ~[spring-          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.REL          at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.RELEASE]          at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177) ~[spring-security-web-4.2.6.RELEASE.jar!/:4.2.6.RELEASE]          at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106) ~[spring-boot-actuator-1.5.13.RELEASE.jar!/:1.5.13.REL          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.17.RELEASE.jar!/:4.3.17.RELEASE]          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) [tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) [tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468) [tomcat-embed-core-8.5.31.jar!/:8.5.31]          at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.31.jar!/:8.5.31]          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_161]          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_161]          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.31.jar!/:8.5.31]          at java.lang.Thread.run(Thread.java:748) [na:1.8.0_161]
When this happens the solution is to delete the whole repository on the file system so the config server can make a clean copy/clone.
I would like to create a PR for this issue. Would like to remove the corrupted git repository automatically when the problem arises.

I would think we would see a lot more reports of this if it was truly related to GJit, is there an issue in GJit that correlates to the problem you are seeing?

You're right. I made another inspection round across the logs and it looks like different problem.
Our cloud-config-server instance is embedded inside of Spring Boot App (it is not the spring-cloud-config-server JAR only). The exception mentioned before starts to occur when following actions happens in parallel:

There is a regular fetch through JGitEnvironmentRepository.getLocations metod (someone loads the configuration)
There is a Spring Refresh Context update

This calls JGitEnvironmentRepository.afterPropertiesSet
because we have cloneOnStart set to true, this deletes and clones the git base repository
this code block is not synchronized as the getLocations method so it can probably delete the directory at the same time as the fetch operation is done.

I can probably fix this by changing the cloneOnStart to false. But, it would be probably nicer to create PR with integration test that simulates the issue and then to fix that (e.g. by synchronisation).
What do you think, @ryanjbaxter ? Can I start to work on that?

Sure PRe are always welcome

Is there a possibility of 1.4.6? :)

Yes

Closed via be4155e

Thanks :)

authors: LukasVyhlidka ryanjbaxter


text:
SpringCloudConfig run error when "java -jar myconfigserver.jar"

My Env: SpringBoot2.1.3, SpringCloud Grenwich, Jdk 1.8, Native repository(I use my local disk as my config repo rather than git or svn..)
It runs ok when I use Eclipse to start directly.However, when I use "java -jar myconfigserver.jar", Error occurred:
Exception encountered during context initialization - cancelling refresh attempt:
org.springframework.boot.context.properties.ConfigurationPropertiesBindException:
Error creating bean with name 'multipleJGitEnvironmentProperties':
Could not bind properties to 'MultipleJGitEnvironmentProperties' :
prefix=spring.cloud.config.server.git, ignoreInvalidFields=false, ignoreUnknownFields=true;
nested exception is org.springframework.boot.context.properties.bind.BindException:
Failed to bind properties under 'spring.cloud.config.server.git' to org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentProperties
Waiting for your answer.

Please add your configuration

Hey, guy, I tried again on my company's PC and tried on my house's PC. And those project codes are same(copy). Unexpectedly, it runs successfully on my house's PC. And it runs unsuccessfully on my company's PC.
My env on my house's PC: jdk 1.8(same with company's PC), Eclipse Mars2(differ from company's PC Mars1), Maven 3.xx(I forgot it. Company's Maven is 3.6.0).
And I compared house's jar with company's jar. I discovered that company's jar lacks 3 jars(JavaEWAH-1.1.6.jar, jsch-0.1.54.jar, jzlib-1.1.1.jar). Then I check my pom.xml, those scope are compile. However, those three haven't been packaged in company's jar. Maybe this is my env's problem rather than a bug of SpringCloudConfig...
My pom.xml:
`

4.0.0

org.springframework.boot
spring-boot-starter-parent
2.1.3.RELEASE

com.cjia
spider-config
1.0.0
config
SpringCloudConfig for spider
<properties>
	<java.version>1.8</java.version>
</properties>

<dependencies>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter</artifactId>
		<exclusions>
			<exclusion>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-logging</artifactId>
			</exclusion>
		</exclusions>
	</dependency>
	<!-- log4j -->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-log4j</artifactId>
		<version>1.3.8.RELEASE</version>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-config-server</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
	</dependency>
	<!-- spring-security -->
	<!-- <dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-security</artifactId>
	</dependency> -->
	<!-- 消息总线 -->
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-starter-bus-kafka</artifactId>
	</dependency>
</dependencies>

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dependencies</artifactId>
			<version>Greenwich.SR2</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>

`
My application.properties:
`spring.application.name=spider-config
server.port=7001
#配置服务注册中心
eureka.client.serviceUrl.defaultZone=http://peer1:1111/eureka/,http://peer2:1112/eureka/
##本地文件系统
#本地文件系统的存储方式来保存配置信息，设置native，会默认从应用的src/main/resource目录下搜索配置文件
spring.profiles.active=native
#指定具体的配置文件位置
spring.cloud.config.server.native.searchLocations=E:/codes_svn/spider_trunk/spider-config/src/main/resources/properties
#对配置中心的访问增加安全验证，同时需要在config客户端增加验证配置
#若开启安全认证，访问/bus-refresh报401或403，疑似bug
#spring.security.user.name=cjiaspider
#spring.security.user.password=spider_123
#management.security.enabled=false
#Spring Cloud Bus配置
spring.kafka.bootstrap-servers=10.1.4.17:9092
#开启mq的日志追踪
spring.cloud.bus.trace.enabled=true
#通过总线refresh
management.endpoints.web.exposure.include=bus-refresh
`
Finally, maybe I can forcely and directly add those three dependences to resolve my problem. But I hope to find its root cause.

Add another point, I could run successfully on my company's PC and run in Eclipse. If I try it by 'java -jar xx.jar', it's always lose.

I have discovered the root cause by using 'mvn -X'. I delete sth(download Incomplete bad pom) in mvn repo. Then those three jars are packaged.
This is not a bug. Please close it.

authors: oaHeZgnoS spencergibb


text:
2.4.x + Ilford + spring.cloud.config.tls.enabled=true

Hello Team,
This following PR:
https://github.com/spring-cloud/spring-cloud-config/pull/1679/files
Is a great feature and allow mTLS between Spring Cloud Config Server and Client (and even having to override a custom rest template beans or ConfigServicePropertySourceLocator bean.
It is working fine with 2.3.x
With the breaking change introduce with 2.4, it seems those properties are not taken effect.
Before: 2.3.x + Hoxton.SRx + properties in bootstrap = 😃
After: 2.4.x + Ilford + properties in application.yml = 😭
The properties are:
spring.cloud.config.tls.enabled=true
spring.cloud.config.tls.key-store=/path/to/my/keystore
(and the two passwords for key/keystore)

May I as kid it is a bug introduced by the breaking change from 2.4 please? (Or simply, I misunderstood and those are not the correct properties anymore?
Thank you

The current workaround is to add spring-cloud-starter-bootstrap. This was not added due to time constraints.
Also see https://github.com/spring-cloud/spring-cloud-config/issues/1689

The current workaround is to add spring-cloud-starter-bootstrap. This was not added due to time constraints.
Also see https://github.com/spring-cloud/spring-cloud-config/issues/1689

Many thanks. @spencergibb
Closing in favor of https://github.com/spring-cloud/spring-cloud-config/issues/1689

Many thanks. @spencergibb
Closing in favor of https://github.com/spring-cloud/spring-cloud-config/issues/1689


text:
Uses ACL token when get servers.

Uses ACL token when get servers.

@bomee Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.

@bomee Thank you for signing the Contributor License Agreement!

The feature depend on consul server and an acl_rule, i pass the code in my environment

We have existing tests that use ACLs see https://github.com/spring-cloud/spring-cloud-consul/blob/master/spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/ConsulDiscoveryClientAclTests.java and https://github.com/spring-cloud/spring-cloud-consul/tree/master/src/test/resources/consul_acl

Thanks.I refer to the existing test to complete the test.

source: gharchive/pull-request

authors: bomee pivotal-issuemaster spencergibb

repo: spring-cloud/spring-cloud-consul


text:
dynamic url support is required

Is your feature request related to a problem? Please describe.
There is a need to route requests based on their attributes - different users to different backends. So for purpose, users service is called inside of extended AbstractGatewayFilterFactory - returned url should be set in request. Found one possible solution:
exchange.getAttributes().put(ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR, new URI(userUrl));

but set url doesn't replace url set in request.
Now for me only one option - use reflection:
            Route route = (Route) exchange.getAttributes().get(GATEWAY_ROUTE_ATTR);

            try {
                Field uriField = route.getClass().getDeclaredField("uri");
                uriField.setAccessible(true);
                uriField.set(route, uri);
                uriField.setAccessible(false);
            } catch (NoSuchFieldException | IllegalAccessException e) {
                e.printStackTrace();
            }

            exchange.getAttributes().put(GATEWAY_ROUTE_ATTR, route);

Describe the solution you'd like
Provide a setter for the uri field in Route.
Describe alternatives you've considered
Continue use reflection.

The url is already dynamic, but is likely an ordering issue. Make sure your filter runs after RouteToRequestUrlFilter.ROUTE_TO_URL_FILTER_ORDER

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

the version of mine is 3.1.5  ,the RouteToRequestUrlFilter can't change url, url doesn't replace url set in request
this is origi code :
URI mergedUrl = UriComponentsBuilder.fromUri(uri).scheme(routeUri.getScheme()).host(routeUri.getHost()).port(routeUri.getPort()).build(encoded).toUri();
exchange.getAttributes().put(ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR, mergedUrl);

repo: spring-cloud/spring-cloud-gateway

license_source: github-api


text:
Instance info is not adjusted to the registered vip context path

While pulling information from hostname/eureka/apps I can see the following:
http://serviceAHost/
http://serviceAHost/info
http://serviceAHost/health
serviceA
when I would expect urls to point context specific url, something like that
http://serviceAHost/serviceA
http://serviceAHost/serviceA/info
http://serviceAHost/serviceA/health
both info and health endpoints only available in the context of the service. Is it right?
I am not sure if this is related but when I get "uri" from the ServiceInstance instance it does not have service (vipAddress ?) embedded there either.

How are you setting the context of the service?  Is it deployed via a war or are you setting the servletPath via config?  The docs say you can customize those:
eureka:
  instance:
    homePageUrlPath: ${server.servletPath}/
    statusPageUrlPath: ${server.servletPath}/info
    healthCheckUrlPath: ${server.servletPath}/health

Please show what you are experiencing from the "uri" of the ServiceInstance.

Thanks, application/service is deployed via a war file in a a container. After adjusting eureka.instance... per your suggestion it comes out in eureka/apps as expected.
When I do something like - discoveryClient.getInstances("serviceA").get(0).getUri() - for my services deployed as a war file I am getting just "http://hostname:port" without the context/servletPath.

@bagerman currently that is how things function.  Service clients need to know about the context.

got it, thanks

authors: bagerman spencergibb

repo: spring-cloud/spring-cloud-netflix


text:
Ability to combine Hystrix and Feign

Currently there is no way to wrap a FeignClient with Hystrix but to have an extra class/bean. In newer versions (e.g. 8.11.) of feign there is Hystrix support (HystrixFeign). An alternative might be to support @HystrixCommand on Feign clients.

Just seen, this is fixed with the upgrade of Feign to 8.11


text:
Support slice testing of zuul components

Supports #2419 - Slice testing of Zuul filter and properties. If this looks good I can send another PR to update the documentation.

Codecov Report

Merging #2437 into master will increase coverage by 3.96%.
The diff coverage is 93.75%.

@@            Coverage Diff             @@
##           master    #2437      +/-   ##
==========================================
+ Coverage   68.43%   72.39%   +3.96%
==========================================
  Files         234      197      -37
  Lines        8218     6659    -1559
  Branches     1020      877     -143
==========================================
- Hits         5624     4821     -803
+ Misses       2210     1512     -698
+ Partials      384      326      -58

Impacted Files
Coverage Δ

...etflix/zuul/slice/ZuulTestContextBootstrapper.java
100% <100%> (ø)

...loud/netflix/zuul/slice/ZuulTypeExcludeFilter.java
91.66% <91.66%> (ø)

...ework/cloud/netflix/sidecar/SidecarProperties.java

...etflix/turbine/stream/HystrixStreamAggregator.java

...ka/server/event/EurekaInstanceRegisteredEvent.java

...tflix/eureka/server/EurekaDashboardProperties.java

...eureka/server/EurekaServerMarkerConfiguration.java

...d/netflix/eureka/server/EurekaServerBootstrap.java

...s/spectator/SpectatorMetricsAutoConfiguration.java

...rk/cloud/netflix/sidecar/SidecarConfiguration.java

... and 33 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89441ac...e123f03. Read the comment docs.

Note that Discovery based Ribbon ServerList is disabled for the slice test, this way there is no dependency on needing any registry for these slice tests and the target zuul endpoint needs to be explicitly specified for tests using listOfServers - serviceId.ribbon.listOfServers=localhost:${wiremock.server.port}. If we absolutely need to support Discovery for Ribbon an option could be to hook up SimpleDiscoveryClient based ServerList and use it instead(such an auto-configuration does not exist but can be added if desired)

Is there some kind advantage to doing it this way as opposed to using spring cloud contract?

Yes, good point @ryanjbaxter.  S-C-Contract  would assume that we have contract's defined for all downstream services that Zuul is fronting, which likely may not be available + typically since Zuul is used for hiding legacy services typically those may be say SOAP based services.
The approach in the PR is to leave it to the user during test to define a stub behavior for the downstream service (using @AutoConfigureWireMock) and then test purely using MockMvc

OK maybe I misunderstood the use case.  This is not for testing our Zuul implementation in SC Netflix its for testing apps using Zuul, right?

Yes, that is correct @ryanjbaxter - I faced an issue at a customer location where we added Zuul proxy to an existing application and this application uses some shared libraries with its own set of auto-configurations. Now to test the Zuul specific configuration we could exclude all the auto-configurations that the customer has OR test it by activating only Zuul specific auto-configurations.
These specific auto-configurations which worked for at the customer location are now part of this slice test

Makes sense, could we get some documentation then on how its used?

Oh yes, sounds good @ryanjbaxter, will update the PR with documentation on how to use this

Added in documentation now @ryanjbaxter

authors: bijukunjummen codecov-io ryanjbaxter


text:
Consumer pause & resume not working with multiple Kafka binders

https://github.com/s-sathish/SampleKafkaProducerConsumer
I have a sample Kafka producer consumer application in Spring boot, cloud stream (Above link)
Scenario:

Multiple Kafka binders: Different zookeeper/Kafka broker
kafka1 - zkNode = localhost:2181, broker = localhost:9092
kafka2 - zkNode = localhost:2182, broker = localhost:9093

Producer produces a message to consumer

Consumer(autoCommitOffset = false, relying on manual ack) receives the message

Intentionally fail the processing logic and putting the message to two DLQ's

Each DLQ consumer have different idleEventInterval

On first message posting, the processing logic fails intentionally and then the message goes to DLQ. The DLQ's receives the message. Till this point everything is working fine.

After this, the consumer pause & resume logic doesn't seems to be working

consumer.pause(Collections.singleton(new TopicPartition(TOPIC, PARTITION)));

@Bean
public ApplicationListener<ListenerContainerIdleEvent> wakingUpAllDLQConsumerAsPerRetryLogic() {
    return event -> {
        if (event.getConsumer().paused().size() > 0) {
            event.getConsumer().resume(event.getConsumer().paused());
        }
    };
}

Spring cloud stream version: "Greenwich.RELEASE"

Hi @olegz
Following is the application properties:
spring:
  cloud:
    stream:
      bindings:
        in:
          destination: producer-consumer-topic
          group: producer-consumer-group
          binder: kafka1
        out:
          destination: producer-consumer-topic
          binder: kafka1
        dlq-out-1:
          destination: producer-consumer-topic-dlq-1
          binder: kafka2
        dlq-out-2:
          destination: producer-consumer-topic-dlq-2
          binder: kafka2
        dlq-in-1:
          destination: producer-consumer-topic-dlq-1
          group: producer-consumer-group-dlq
          binder: kafka2
        dlq-in-2:
          destination: producer-consumer-topic-dlq-2
          group: producer-consumer-group-dlq
          binder: kafka2
      binders:
        kafka1:
          type: kafka
          environment:
            spring.cloud.stream.kafka.binder.brokers: localhost:9092
            spring.cloud.stream.kafka.binder.zkNodes: localhost:2181
        kafka2:
          type: kafka
          environment:
            spring.cloud.stream.kafka.binder.brokers: localhost:9093
            spring.cloud.stream.kafka.binder.zkNodes: localhost:2182
      kafka:
        binder:
          health-timeout: 60
        bindings:
          in:
            consumer:
              autoCommitOffset: false
          dlq-in-1:
            consumer:
              idleEventInterval: 10000
              autoCommitOffset: true
              enableDlq: true
              dlqName: producer-consumer-topic-error
          dlq-in-2:
            consumer:
              idleEventInterval: 15000
              autoCommitOffset: true
              enableDlq: true
              dlqName: producer-consumer-topic-error

As you can see,

I'm having multiple Kafka binders (kafka1, kafka2). Some topics gets registered to kafka1 binder and other topics gets registered to kafka binder2

For two consumers, I've set the bindings property "idleEventInterval", so that I can try out the consumer.pause() & consumer.resume() functionalities as below

@StreamListener(value = Stream.DLQ_CONSUME_1)
public void messageConsumer1DLQ(@Valid Message<ConsumerData> consumerData, @Header(KafkaHeaders.CONSUMER) Consumer<?, ?> consumer) {
    log.info("DLQ 1 message consumer Info = {}", consumer);

    log.info("Received(From DLQ 1) message event in consumer, message = {}", consumerData);

    consumer.pause(Collections.singleton(new TopicPartition(DLQ_TOPIC_NAME_1, DLQ_TOPIC_PARTITION)));
}

@StreamListener(value = Stream.DLQ_CONSUME_2)
public void messageConsumer2DLQ(@Valid Message<ConsumerData> consumerData, @Header(KafkaHeaders.CONSUMER) Consumer<?, ?> consumer) {
    log.info("DLQ 2 message consumer Info = {}", consumer);

    log.info("Received(From DLQ 2) message event in consumer, message = {}", consumerData);

    consumer.pause(Collections.singleton(new TopicPartition(DLQ_TOPIC_NAME_2, DLQ_TOPIC_PARTITION)));
}

@Bean
public ApplicationListener<ListenerContainerIdleEvent> wakingUpAllDLQConsumerAsPerRetryLogic() {
    return event -> {
        Collection<TopicPartition> topicPartitions = event.getTopicPartitions();
        for(TopicPartition topicPartition : topicPartitions) {
            if(topicPartition.toString().equals(DLQ_TOPIC_NAME_1_PARTITION)
                    || topicPartition.toString().equals(DLQ_TOPIC_NAME_2_PARTITION)) {
                log.info("Resuming the DLQ Consumers as per each topic logic's, event = {}", event);

                if(event.getConsumer().paused().size() > 0) {
                    log.info("Found new events in DLQ. Waking up and gonna process the messages...");
                    event.getConsumer().resume(event.getConsumer().paused());
                } else {
                    log.info("No new events posted to DLQ. Gonna sleep again ZZZ...");
                }
            }
        }
    };
}

So, once the above two consumer receives the message, it is supposed to go into paused state and then resume as per the "idleEventInterval" property set for each consumer, But none of the pause or resume events seems to be happening.
Let me know if the above explanation makes it clear.

Now I tried the following scenario - Just a single named Kafka binder. Below is the application properties
spring:
  cloud:
    stream:
      bindings:
        in:
          destination: producer-consumer-topic
          group: producer-consumer-group
          binder: kafka1
        out:
          destination: producer-consumer-topic
          binder: kafka1
        dlq-out-1:
          destination: producer-consumer-topic-dlq-1
          binder: kafka1
        dlq-out-2:
          destination: producer-consumer-topic-dlq-2
          binder: kafka1
        dlq-in-1:
          destination: producer-consumer-topic-dlq-1
          group: producer-consumer-group-dlq
          binder: kafka1
        dlq-in-2:
          destination: producer-consumer-topic-dlq-2
          group: producer-consumer-group-dlq
          binder: kafka1
      binders:
        kafka1:
          type: kafka
          environment:
            spring.cloud.stream.kafka.binder.brokers: localhost:9092
            spring.cloud.stream.kafka.binder.zkNodes: localhost:2181
      kafka:
        bindings:
          in:
            consumer:
              autoCommitOffset: false
          dlq-in-1:
            consumer:
              idleEventInterval: 10000
              autoCommitOffset: true
              enableDlq: true
              dlqName: producer-consumer-topic-error
          dlq-in-2:
            consumer:
              idleEventInterval: 15000
              autoCommitOffset: true
              enableDlq: true
              dlqName: producer-consumer-topic-error

logging:
  level:
    org.springframework.integration: DEBUG

So, even with single named Kafka binder, the consumer pause/resume events doesn't seems to be happening.
And once I stop my application, I can see the following WARN messages in the logs as part of the shutdown process -
2019-10-17 12:02:34.394  WARN 3294 --- [       Thread-8] o.s.cloud.stream.binding.BindingService  : Trying to unbind 'in', but no binding found.
2019-10-17 12:02:34.404  WARN 3294 --- [      Thread-11] o.s.cloud.stream.binding.BindingService  : Trying to unbind 'dlq-in-1', but no binding found.
2019-10-17 12:02:34.404  WARN 3294 --- [      Thread-11] o.s.cloud.stream.binding.BindingService  : Trying to unbind 'dlq-in-2', but no binding found.

Looks like the consumer properties bindings itself haven't happened at first place.

@s-sathish if you comment out this section below, I think it starts to work (provided that you have Kafka running on the default ports locally)
binders:
        kafka1:
          type: kafka
#          environment:
#            spring.cloud.stream.kafka.binder.brokers: localhost:9092
#            spring.cloud.stream.kafka.binder.zkNodes: localhost:2181

This indicates that somewhere along the chain, the multi binder environment properties are not carried forward. We will investigate further.

@sobychacko Yeah, Commenting out the part that you suggested made it work for "single named Kafka binder" - consumer pause(), resume() events are working properly now.
Yes, Looks like the problem is with -
Named Kafka binder environment properties being not processed correctly in the flow.
I think if the binder environment properties is carried forward correctly, then the same should work for multiple named binders as well.

@s-sathish I spent some time on it with @artembilan and he was able to identify the problem. The issue is that when you have a multi binder scenario (or binder context initialized through a custom environment), the application listener bean is not visible to the binder context as this is only available in the parent context. When you have a custom environment, SCSt does not propagate beans from the parent context into the binder context. In order to get around this, you have to explicitly add the configuration class to the binder context in your application's configuration. I changed your settings as below and I am seeing that pause/resume is working. Can you confirm if it addresses your issues?
spring:
  cloud:
    stream:
      bindings:
        in:
          destination: producer-consumer-topic
          group: producer-consumer-group
          binder: kafka1
        out:
          destination: producer-consumer-topic
          binder: kafka1
        dlq-out-1:
          destination: producer-consumer-topic-dlq-1
          binder: kafka2
        dlq-out-2:
          destination: producer-consumer-topic-dlq-2
          binder: kafka2
        dlq-in-1:
          destination: producer-consumer-topic-dlq-1
          group: producer-consumer-group-dlq
          binder: kafka2
        dlq-in-2:
          destination: producer-consumer-topic-dlq-2
          group: producer-consumer-group-dlq
          binder: kafka2
      binders:
        kafka1:
          type: kafka
          environment:
            spring.cloud.stream.kafka.binder.brokers: localhost:9092
            spring.main.sources: com.sathish.KPC.consumer.DLQConsumer
        kafka2:
          type: kafka
          environment:
            spring.cloud.stream.kafka.binder.brokers: localhost:9092
            spring.main.sources: com.sathish.KPC.consumer.DLQConsumer

Hi @sobychacko @artembilan, Yes. Changed the application properties as you suggested and the consumer pause/resume is working now. Thanks.
Confirming that the above workaround addresses my issue.

Great! Thank you for confirmation, but keep in mind that this is not a workaround. This is the way to go when you have multi-binder environment and would like to make something available in the particular binder configuration.
See more in docs: https://cloud.spring.io/spring-cloud-static/spring-cloud-stream/3.0.0.M4/reference/html/spring-cloud-stream.html#multiple-binders
I would consider this as Fixed or rather Answered because it is a question of a configuration and doesn't look like a bug 😉

@s-sathish Thank you for the confirmation. Yes, as @artembilan mentioned, this is not really a workaround, but a documented way to address these types of issues. Closing this issue, please feel free to re-open if need be.

authors: artembilan s-sathish sobychacko


text:
gh-1059 : Added health indicator for kafka messages listener containers created via kafka binder

Before I jump into tests, please let me know whether the approach is acceptable for you guys @garyrussell @sobychacko

Hey @garyrussell @sobychacko, super kind reminder =)

@tdanylchuk Is the PR ready for final review and merge? I thought I saw the WIP label on the title, thus thinking that you were still working on it.

nope, i've removed it, you may review now =)

Thank you @tdanylchuk for the PR. It is now merged upstream.

Thanks @sobychacko ! Also wonder, is there any chance we can port this change into 3.0.x?

@tdanylchuk It is now backported to 3.0.x.

awesome, thanks again!

authors: sobychacko tdanylchuk


text:
Consider adding an Avro starter for schema client support

See http://stackoverflow.com/questions/42207864/activating-avro-message-converter-in-spring-cloud-dataflow
Avro is currently an optional dependency for the Schema support, which is fine for the core project, but we could have a starter pull it in.

out of date

authors: mbogoevici olegz

repo: spring-cloud/spring-cloud-stream


text:
guide is giving 500 error

https://spring.io/guides/

Works for me.

yes it is working now

Appears to have been a spring.io issue now resolved.
https://twitter.com/springops/status/919906247138308096

repo: spring-guides/gs-rest-service


text:
MuleToJavaDSLDwlTransformTest throws exception

Describe the bug
Stacktrace
[INFO] Running org.springframework.sbm.mule.actions.MuleToJavaDSLDwlTransformTest
10:00:17.413 [ForkJoinPool-1-worker-1] ERROR o.s.s.o.RewriteExecutionContext - Exception occured!
org.openrewrite.UncaughtVisitorException: java.lang.NullPointerException: Cannot invoke "org.openrewrite.java.tree.JRightPadded.getElement()" because "l" is null
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:253)
        at org.openrewrite.java.format.BlankLinesVisitor.visit(BlankLinesVisitor.java:299)
        at org.openrewrite.java.format.BlankLinesVisitor.visit(BlankLinesVisitor.java:30)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:145)
        at org.openrewrite.java.format.AutoFormatVisitor.visit(AutoFormatVisitor.java:56)
        at org.openrewrite.java.JavaVisitor.autoFormat(JavaVisitor.java:92)
        at org.openrewrite.java.JavaVisitor.autoFormat(JavaVisitor.java:87)
        at org.openrewrite.java.JavaTemplate$2.lambda$visitBlock$0(JavaTemplate.java:145)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:123)
        at org.openrewrite.java.JavaTemplate$2.visitBlock(JavaTemplate.java:145)
        at org.openrewrite.java.JavaTemplate$2.visitBlock(JavaTemplate.java:102)
        at org.openrewrite.java.tree.J$Block.acceptJava(J.java:745)
        at org.openrewrite.java.tree.J.accept(J.java:60)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:206)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:285)
        at org.openrewrite.java.JavaVisitor.visitClassDeclaration(JavaVisitor.java:447)
        at org.openrewrite.java.JavaTemplate$2.visitClassDeclaration(JavaTemplate.java:264)
        at org.openrewrite.java.JavaTemplate$2.visitClassDeclaration(JavaTemplate.java:102)
        at org.openrewrite.java.tree.J$ClassDeclaration.acceptJava(J.java:1069)
        at org.openrewrite.java.tree.J.accept(J.java:60)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:206)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:145)
        at org.openrewrite.java.JavaTemplate.withTemplate(JavaTemplate.java:520)
        at org.openrewrite.java.JavaTemplate.withTemplate(JavaTemplate.java:42)
        at org.openrewrite.java.tree.J.withTemplate(J.java:87)
        at org.springframework.sbm.java.impl.OpenRewriteType$1.visitClassDeclaration(OpenRewriteType.java:170)
        at org.springframework.sbm.java.impl.OpenRewriteType$1.visitClassDeclaration(OpenRewriteType.java:156)
        at org.openrewrite.java.tree.J$ClassDeclaration.acceptJava(J.java:1069)
        at org.openrewrite.java.tree.J.accept(J.java:60)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:206)
        at org.openrewrite.TreeVisitor.visitAndCast(TreeVisitor.java:285)
        at org.openrewrite.java.JavaVisitor.lambda$visitCompilationUnit$10(JavaVisitor.java:466)
        at org.openrewrite.internal.ListUtils.lambda$map$0(ListUtils.java:141)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:123)
        at org.openrewrite.internal.ListUtils.map(ListUtils.java:141)
        at org.openrewrite.java.JavaVisitor.visitCompilationUnit(JavaVisitor.java:466)
        at org.openrewrite.java.JavaIsoVisitor.visitCompilationUnit(JavaIsoVisitor.java:119)
        at org.openrewrite.java.JavaIsoVisitor.visitCompilationUnit(JavaIsoVisitor.java:31)
        at org.openrewrite.java.JavaVisitor.visitJavaSourceFile(JavaVisitor.java:454)
        at org.openrewrite.java.JavaIsoVisitor.visitJavaSourceFile(JavaIsoVisitor.java:39)
        at org.openrewrite.java.JavaIsoVisitor.visitJavaSourceFile(JavaIsoVisitor.java:31)
        at org.openrewrite.java.tree.J$CompilationUnit.acceptJava(J.java:1351)
        at org.openrewrite.java.tree.J.accept(J.java:60)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:206)
        at org.openrewrite.RecipeScheduler.lambda$scheduleVisit$5(RecipeScheduler.java:241)
        at org.openrewrite.RecipeScheduler.lambda$mapAsync$0(RecipeScheduler.java:49)
        at org.openrewrite.scheduling.ForkJoinScheduler.lambda$schedule$0(ForkJoinScheduler.java:41)
        at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1375)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.NullPointerException: Cannot invoke "org.openrewrite.java.tree.JRightPadded.getElement()" because "l" is null
        at org.openrewrite.java.tree.JRightPadded.getElements(JRightPadded.java:102)
        at org.openrewrite.java.tree.J$Block.getStatements(J.java:732)
        at org.openrewrite.java.format.BlankLinesVisitor.visitMethodDeclaration(BlankLinesVisitor.java:149)
        at org.openrewrite.java.format.BlankLinesVisitor.visitMethodDeclaration(BlankLinesVisitor.java:30)
        at org.openrewrite.java.tree.J$MethodDeclaration.acceptJava(J.java:3221)
        at org.openrewrite.java.tree.J.accept(J.java:60)
        at org.openrewrite.TreeVisitor.visit(TreeVisitor.java:206)
        ... 52 common frames omitted

@fabapp2 I think the implementation of Triggermesh is flawed, the reason we are seeing an exception is because the xml supplied in the test is not valid,
The test that is causing the exception is this: MuleToJavaDSLDwlTransformTest.multipleDWLTransformInSameFlowShouldProduceMultipleClassesWithTriggerMeshEnabled
The exception is due to the fact that the input xml supplied is invalid, there is no input and corresponding output mentioned in xml for a channel adapter hence the exception.
I supplied a simple input xml with transformation for to test with trigger mesh, following were the results:
Input:
<?xml version="1.0" encoding="UTF-8"?>

            <mule xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
                xmlns:spring="http://www.springframework.org/schema/beans"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
            http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
            http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
            http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd">
                <flow name="dwlFlow">
                    <http:listener config-ref="HTTP_Listener_Configuration" path="/dwl" doc:name="HTTP"/>

                    <logger message="payload to be sent: #[new String(payload)]" level="INFO" doc:name="Log the message content to be sent"/>

                    <dw:transform-message doc:name="action transform">
                        <dw:set-payload><![CDATA[%dw 1.0
            %output application/json
            ---
            {
                action_Code: 10,
                returnCode:  20
            }]]></dw:set-payload>
                    </dw:transform-message>

                     <logger message="payload to be sent: #[new String(payload)]" level="INFO" doc:name="Log the message content to be sent"/>
                </flow>
            </mule>

output:
package com.example.javadsl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.handler.LoggingHandler;
import org.springframework.integration.http.dsl.Http;

@Configuration
public class FlowConfigurations {
    @Bean
    IntegrationFlow dwlFlow() {
        return IntegrationFlows.from(Http.inboundChannelAdapter("/dwl")).handle((p, h) -> p)
                .log(LoggingHandler.Level.INFO, "payload to be sent: #[new String(payload)]")
                .handle((p, h) -> {
                    TmDwPayload dwPayload = new TmDwPayload();
                    String contentType = "application/json";
                    if (h.get("contentType") != null) {
                        contentType = h.get("contentType").toString();
                    }
                    dwPayload.setId(h.getId().toString());
                    dwPayload.setSourceType(contentType);
                    dwPayload.setSource(h.get("http_requestUrl").toString());
                    dwPayload.setPayload(p.toString());
                    return dwPayload;
                })
                .transform(DwlFlowTransformTM_2::transform)
                .log(LoggingHandler.Level.INFO, "payload to be sent: #[new String(payload)]")
                .get();
    }
}

package com.example.javadsl;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class DwlFlowTransformTM_2 {
    public static class DataWeavePayload {
        public String input_data;
        public String spell;
        public String input_content_type;
        public String output_content_type;
    };

    public static String transform(TmDwPayload payload) {
        String uuid = payload.getId();
        String url = System.getenv("K_SINK");
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest.Builder requestBuilder;
        DataWeavePayload dwPayload = new DataWeavePayload();

        if (payload.getSourceType().contains(";")) {
            dwPayload.input_content_type = payload.getSourceType().split(";")[0];
        } else {
            dwPayload.input_content_type = payload.getSourceType();
        }
        dwPayload.output_content_type = "application/json";

        //TODO: Verify the spell conforms to Dataweave 2.x: https://docs.mulesoft.com/mule-runtime/4.4/migration-dataweave
        dwPayload.spell = "%dw 1.0\n%output application/json\n---\n{\n    action_Code: 10,\n    returnCode:  20\n}";
        dwPayload.input_data = payload.getPayload();
        String body;

        try {
            requestBuilder = HttpRequest.newBuilder(new URI(url));
            ObjectMapper om = new ObjectMapper();
            body = om.writeValueAsString(dwPayload);
        } catch (Exception e) {
            System.out.println("Error sending request: " + e.toString());
            return null;
        }

        requestBuilder.setHeader("content-type", "application/json");
        requestBuilder.setHeader("ce-specversion", "1.0");
        requestBuilder.setHeader("ce-source", payload.getSource());
        requestBuilder.setHeader("ce-type", "io.triggermesh.dataweave.transform");
        requestBuilder.setHeader("ce-id", payload.getId());

        HttpRequest request = requestBuilder.POST(HttpRequest.BodyPublishers.ofString(body)).build();

        try {
            HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
            // TODO: verify the response status and body
            return response.body();
        } catch (Exception e) {
            System.out.println("Error sending event: " + e.toString());
            return null;
        }
    }
}

I was under the impression trigger mesh will package the DWL payload into an http request and a service translates it, if we see the generated classes above, the dwl content is not sent into http request at all:
          <dw:set-payload><![CDATA[%dw 1.0
            %output application/json
            ---
            {
                action_Code: 10,
                returnCode:  20
            }]]></dw:set-payload>


text:
save dosn't preserve order using List with key position

When trying to save an aggregate with a list entity, we had a side effect on the list order.
class A {
  @Id int a;
  @MappedCollection(idColumn = "b", keyColumn = "b_order")
  List<B> blist;
}

class B {
  @Id int b;
}

A init = new A(List.of(b1, b2, b3));
A saved = repoA.save(init);
Assertions.assertThat(saved.blist).isEqual(init.blist); // is KO

A result = repoA.findById(saved.a);
Assertions.assertThat(result.blist).isEqual(init.blist); // is OK

I'm i doing something wrong ? Or maybe it's not supposed to preserve order as a function ?

The order should be preserved, but actually with the code you posted the object returned by save should be the same instance as the one you put it.
But you are comparing to some a which you don't declare anywhere. Also if the id of B can't be set but requires a new B to be instantiated your assertion will fail because although the B's will be semantically the same the will not be equal according to the default implementation of equals.
Please check the actual elements, and provide a reproducer if the problem persists.

My bad it's the init wich i tried to save, but yes the problem persist, The save loose the order in JdbcAggregateChangeExecutionContext.stage

The presence of the ID in the relationship B cause the issue, when removing the @ID, it works. I think it's still an issue though.

As mentioned before we would need a reproducer to work on this.

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

authors: B-hamza schauder spring-projects-issues

repo: spring-projects/spring-data-jdbc


text:
Generated keys are retrieved even if the primary key value is defined

Method DefaultDataAccessStrategy.insert(...) invokes method JdbcOperations.update(PreparedStatementCreator, KeyHolder) even in case, that the primary key is defined by the user. This creates probably some overhead and also fails on JDBC drivers, which don't support retrieving of generated keys.
The method should rather invoke JdbcOperations.update(PreparedStatementCreator) in case, that the primary key value is already defined in time of INSERT.

Related Stackoverflow question: https://stackoverflow.com/q/66459999/66686
@rtlusty Are you interested in providing PR for this?

@schauder Sure, I will try.

authors: rtlusty schauder


text:
Custom type converters only support simple types [DATAJDBC-315]

cn-src opened DATAJDBC-315 and commented
Only support PgArray to String.
public class PgArrayConverter implements Converter<PgArray, String>

to List<String>, or String[]
has error: Couldn't find PersistentEntity for type class java.lang.String!
Or is there another way to complete the conversion?

1 votes, 2 watchers

@mp911de I'd like your opinion on this.

authors: schauder spring-projects-issues

repo: spring-projects/spring-data-relational


text:
Spring Kafka does not read configuration properties as expected

springBootVersion = '2.2.6.RELEASE'
springKafkaVersion= '2.4.5.RELEASE'
kafkaVersion = '2.4.1'
Based on the properties that seem to be available in org.springframework.boot.autoconfigure.kafka.KafkaProperties, some properties are not set as expected.
Specifically:

clientId (both consumer and general)
consumer.auto-offset-reset
consumer.ssl
properties (anywhere)

Config excerpt
spring:
  kafka.
    consumer:
      client-id: "client"
      group-id: "group"
      auto-offset-reset: earliest
      key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      value-deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer
      max-poll-records: 100
    ssl:
      trust-store-location: "/some/path"
      trust-store-password: "the pwd here"
    bootstrap-servers:
     - http://localhost:9092
    properties:
      request.timeout.ms: 20000
      sasl.mechanism:  "SCRAM-SHA-512"

First, please read the instructions before opening an issue; specifically:

🙅 "Please DO NOT Raise an Issue" Cases

Question
STOP!! Please ask questions about how to use something, or to understand why something isn't
working as you expect it to, on Stack Overflow using the spring-kafka tag.

Your syntax is incorrect - you have kafka. instead of kafka: on the second line.
If you use an IDE (e.g. STS or IntelliJ IDEA) you should see the syntax error.

My bad, that is a syntax error on the example. I will update accordingly

Closing due to inactivity; if you still feel there's a problem, please re-open and show the kafka INFO log for the consumer config.

authors: garyrussell sigand

repo: spring-projects/spring-kafka


text:
Add property resolver to Kafka listener post processor

Kafka listener bean post processor decomposition: relocate property resolving methods to a suitable class 'KafkaEndpointPropertyResolver'.

@qwe333ty ,
thank you for contribution, but what did drive you to make this change?
Semantically you don't provide any new functionality - just a simple methods extraction to a separate not fully useful top-level class.
Thanks

@artembilan , @garyrussell , thank you for reviewing!

@artembilan , The answer is simple. I want Spring Kafka to follow the Single Responsibility Principle that states that classes should have responsibility over a single part of the functionality and entirely encapsulate it. Also states that there is always must be one reason for changing the implementation. In our case with Kafka listener post-processor there are 2 possible reasons: change the way of message listener container creation & change the way of resolving property. I think it should be fixed by separating post-processor class into independent parts. That's why I have created a merge request that contains one new class with all visible and useful methods to resolve properties using only @KafkaListener annotation.

@garyrussell , Yeeees, this would be a great addition to post-processing! I think I should try to implement an extension point to add a custom resolver and give it to review.

OK. Thanks for the explanation!
Perhaps we should start from the use-case: why would one need a custom properties resolver against the framework annotation?
I'm not against your "Single Responsibility Principle", but this post-processor was really intended for parsing that annotation to some set of beans to let end-user to avoid hard codding for the parser.
May the final custom solution has to be fully away from the fact of the annotation. That's exactly why we provide a high-level API with a KafkaListenerContainerFactory abstraction.
For me your point feels like an abusing of the framework opinion regarding that annotation...

Agreed.

change the way of message listener container creation

That's already achievable with the RabbitListenerContainerFactory abstraction.

change the way of resolving property

We need to understand the exact use case.

@garyrussell , I have been thinking for a couple of days over the possible use cases but I still can't find anything useful :( I think we should close this pull request if someone do not have any ideas.

Closing due to inactivity.
Thanks again for the desire to contribute but I think we agreed this is not needed.
Please don't let it stop you from making other contributions.

authors: artembilan garyrussell qwe333ty


text:
Access Token和 Bearer Token有什么区别呢？

在第四节中介绍了几种token形式，请我波波老师，Access Token和 Bearer Token之间有什么区别呢？不都可以在拿到令牌之后直接去访问资源吗？

Bearer Token是Access Token的一种格式，这种格式一般是随机字符串无特殊意义，也就是不能从Bearer Token的字面推断出这个Token是谁颁发给谁的，像现钞一样谁拿到了都可以去消费使用；还有一种叫Proof of Possession(PoP) Token，这种Token里头包含所有者信息，可以校验拥有者，别人不能随便用。

authors: archcentric fengqiangboy

license: MIT


text:
[Question] How to remove 'host' field from generated docs?

Springfox version: 3.0.0-SNAPSHOT.
The response of my /v2/api-docs looks like this:
{
  "swagger": "2.0",
  "host": "localhost:8888",
  "basePath": "/"
}

But I want to remove the host field. This would allow to use "Try it out" from /swagger-ui.html relative to the current host. The swagger reference (Omitting host and scheme) says, that it's allowed. So resulting JSON would look like this:
{
  "swagger": "2.0",
  "basePath": "/"
}

I found no way to do this in the springfox configuration. I tried to set Docket.host(null), but in this case, it will use default empty-string value. I'm using SNAPSHOT version, but it wouldn't work in stable versions too.

+1

it is possible to use:

-Dspringfox.documentation.swagger.v2.host=

@ClaudenirFreitas thanks for that

This still happening can the issue be reopened ?

Another option inspired by @ClaudenirFreitas's solution is:
Add the following to application.yml
springfox:
  documentation:
    swagger:
      v2:
        host:

authors: ClaudenirFreitas ashlanderr dilipkrish dongze1213 ramiloif

repo: springfox/springfox


text:
Got 404 when open http://springfox.github.io/springfox/

Got 404 when open http://springfox.github.io/springfox/

DNS pollution，AUTO DIRECT TO 127.0.0.1


text:
Take the parameter name from attribute @RequestPart value

What's this PR do/fix?
This is a fix for issue 2263
Are there unit tests? If not how should this be manually tested?
I added the test in the test class ParameterReaderSpec
What are the relevant issues?
Issue:#2263

@VasilievAleksey Thank you for your PR!!

authors: VasilievAleksey dilipkrish


text:
3.0.0

Hi all,
I've just done a big refactor which I think simplifies the usage while making things more explicit and configurable. It also includes other fixes, like supporting the Google Maps API key.
Thought you might want to take a look.
Cheers
Edit: not sure why I made it 3.0.0, must have misread the current version.

:+1:

@SalahAdDin I did. I'll probably pull those static() calls into this PR. This PR is a pretty big refactor and so not really compatible with other PRs.

Oh, then, please pr.

@cavb t Where could we have a new release?

@springloaddeploybot Hey!

@SalahAdDin
In case you don't know, you can use git+git://github.com/danreeves/wagtailgmaps.git@3.0.1#egg=wagtailgmaps==3.0.1 in your requirements.txt. That's how I'm doing it currently 😁

I can say it! Yes! You pull request is Pure GOLD!
But, something is missing, display the map in the django template, in the same way that Wagtail Admin.

And, man, second needed Feature! A StreamField block. I don't know where begins, if you want i can help you!

And add api files is needed also.

@danreeves
I make a template tag for load google-maps API using the same wagtail-hooks code.
But, i don't know how render in the main templates, i tried creating a template tag like django-embed-videos, but is hard.

@danreeves Did you see this repo. Is very interesting, but his kind of work is cross about this repository, it doesn't use address for work, use localization.
We can mix this  repository and make a more strong package, isn't it?

@danreeves Man, see this, is very good.

@SalahAdDin Thanks! I'll check it out

Hey @danreeves, @SalahAdDin – I wasn't watching this repo (not sure who is) so only noticing the PR backlog now, sorry about that.
As you can see this package hasn't moved in a while – @danreeves I see we've merged one of your PRs in the past, would you be willing to be given write access to this project? We'd still require PR reviews, but it would be easier to release those changes.
I'll also try to find someone to review all of this.

Yeah I'd be up for that; we use this project pretty frequently at work.
I'd be interested in any feedback, even if you don't want to merge!
Thanks

Superseded by #16.

Ah.. The source repository for #16 was deleted so we can't use that. Reopening this PR then.

Not overwriting Wagtail base templates and properly using the hooks so django-overextends isn't needed, not to mention the new panel. This is some great work. Thank you for your contribution 💯
I'll have a look early next week to properly define which versions of Python/Django/Wagtail we want to support, maybe add some test 😱 and release a new version.
Can I ask why jump to 3.0 rather than 0.3?

Thanks for merging! The version was a typo, but maybe it should be a major bump anyway.

It probably would if we had already reached 1.x but since we're still on 0.x, I don't think this is required.
In addition, I'm just picking up on this package and would like to use it a bit myself to see if there's improvements/changes to be made before we reach "stable".

authors: SalahAdDin danreeves loicteixeira thibaudcolas

repo: springload/wagtailgmaps


text:
Feat/solana poc

Adds multi-signer support to front-end demo, proves it works by adding Solana support to all Rebase libs. Currently only supports Phantom in front-end, but could be expanded to more. Includes tests and examples. Depends on #30

I haven't reviewed the frontend, and the addition of Solana seems coherent. I just have comments (in the thread above) about the interface and design of the signing/verification -- which I suppose don't really belong in this PR but I didn't raise concerns in previous PRs (can't tell whether I've changed opinions or just didn't think about it).

Tested across:

GitHub
Twitter
Two-Key
DNS
SoundCloud
Reddit

All worked for me.

authors: krhoda obstropolos sbihel

repo: spruceid/rebase


text:
Using siwe message giving me error "Buffer is not defined"

Compiled with problems:
×
ERROR
Buffer is not defined
ReferenceError: Buffer is not defined
    at new api (http://localhost:3000/static/js/bundle.js:143342:3)
    at GrammarApi.generateApi (http://localhost:3000/static/js/bundle.js:140238:17)
    at ./node_modules/@spruceid/siwe-parser/dist/abnf.js (http://localhost:3000/static/js/bundle.js:140250:28)
    at options.factory (http://localhost:3000/static/js/bundle.js:246460:31)
    at __webpack_require__ (http://localhost:3000/static/js/bundle.js:245849:33)
    at fn (http://localhost:3000/static/js/bundle.js:246117:21)
    at ./node_modules/@spruceid/siwe-parser/dist/parsers.js (http://localhost:3000/static/js/bundle.js:140407:16)
    at options.factory (http://localhost:3000/static/js/bundle.js:246460:31)
    at __webpack_require__ (http://localhost:3000/static/js/bundle.js:245849:33)
    at fn (http://localhost:3000/static/js/bundle.js:246117:21)

I am using a nodejs env as backend into my react-typescript frontend

I have resloved this error , i was using createSiweMessage it in frontend , so using it as an backend solves this issue.

repo: spruceid/siwe


text:
nonce bug fix

Description
fixes bug described here https://github.com/spruceid/ssx/issues/70
Type

[x ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Diligence Checklist

[x ] I have performed a self-review of my code
[ x] My changes generate no new warnings

Codecov Report
Base: 90.41% // Head: 90.34% // Decreases project coverage by -0.07% :warning:

Coverage data is based on head (d797ed8) compared to base (120cafd).
Patch has no changes to coverable lines.

:exclamation: Current head d797ed8 differs from pull request most recent head e079df1. Consider uploading reports for the commit e079df1 to get more accurate results

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #74      +/-   ##
==========================================
- Coverage   90.41%   90.34%   -0.07%
==========================================
  Files          25       25
  Lines        3337     3314      -23
  Branches      265      266       +1
==========================================
- Hits         3017     2994      -23
  Misses        320      320

Impacted Files
Coverage Δ

packages/ssx-gnosis-extension/src/modal.ts
100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

authors: codecov-commenter franklovefrank

repo: spruceid/ssx


text:
A small bit of Transcribe support

Hi 👋.
For #4268 I tried to add some aws-transcribe calls, following the Job-Progress-Approach created by https://github.com/jweite in (https://github.com/spulec/moto/pull/3299). Hope it's ok for moto-standards.
Let me know if improvement can be made.
Content:

start-, get-, list-  and delete-transcription-jobs
create-, get-, list-  and delete-vocabularies

Codecov Report

Merging #4269 (7d347aa) into master (7240e8f) will increase coverage by 0.04%.
The diff coverage is 99.05%.

@@            Coverage Diff             @@
##           master    #4269      +/-   ##
==========================================
+ Coverage   95.03%   95.08%   +0.04%
==========================================
  Files         485      485
  Lines       54449    54659     +210
==========================================
+ Hits        51746    51970     +224
+ Misses       2703     2689      -14

Flag
Coverage Δ

servertests
54.67% <8.53%> (-0.18%)
:arrow_down:

test_responses
32.76% <16.11%> (-0.07%)
:arrow_down:

unittests
94.98% <99.05%> (+0.04%)
:arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

moto/transcribe/models.py
97.28% <98.76%> (+8.40%)
:arrow_up:

moto/transcribe/responses.py
96.42% <100.00%> (+12.30%)
:arrow_up:

moto/iam/models.py
95.15% <0.00%> (-0.14%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7240e8f...7d347aa. Read the comment docs.

Thanks @bblommers for the super fast response and review 👍

authors: arrrrrmin codecov-commenter

repo: spulec/moto


text:
Do not include binaries in the tarball

Fixes #77

Does removing the exe and dll references on the MANIFEST allows to add them to the binary wheels?

I was reading up on that.  We may need to specifically add package_data.

I haven't yet figured out how to exclude files from the sdist but not the wheel, will come back to this tomorrow.

I haven't yet figured out how to exclude files from the sdist but not the wheel, will come back to this tomorrow.

Thanks for the help on this

Good to go now

repo: spyder-ide/pywinpty


text:
"internal problem" when opening spyder

Description
What steps will reproduce the problem?

installed spyder 4.0.1 using "conda update spyder". Had previously installed spyder 4.0.0 using "conda install spyder=4.0.0" and could not get past the starting-to-open state. python is at 3.7.3
Traceback
  File "C:\Progra~1\Anaconda3\lib\site-packages\spyder\plugins\completion\kite\client.py", line 108, in get_status
    self.sig_status_response_ready[dict].emit(kite_status)
TypeError: KiteClient.sig_status_response_ready[dict].emit(): argument 1 has unexpected type 'str'

Versions

Spyder version: 4.0.1
Python version: 3.7.3
Qt version: 5.12.5
PyQt5 version: 5.12.3
Operating System: Windows 10

Dependencies
atomicwrites >=1.2.0         :  1.3.0 (OK)
chardet >=2.0.0              :  3.0.4 (OK)
cloudpickle >=0.5.0          :  1.2.2 (OK)
diff_match_patch >=20181111  :  20181111 (OK)
intervaltree                 :  None (OK)
IPython >=4.0                :  7.11.1 (OK)
jedi =0.14.1                 :  0.14.1 (OK)
nbconvert >=4.0              :  5.6.1 (OK)
numpydoc >=0.6.0             :  0.9.2 (OK)
pexpect >=4.4.0              :  4.7.0 (OK)
pickleshare >=0.4            :  0.7.5 (OK)
psutil >=0.3                 :  5.6.7 (OK)
pygments >=2.0               :  2.5.2 (OK)
pylint >=0.25                :  2.4.4 (OK)
pyls >=0.31.2;<0.32.0        :  0.31.4 (OK)
zmq >=17                     :  18.1.1 (OK)
qdarkstyle >=2.7             :  2.7 (OK)
qtawesome >=0.5.7            :  0.6.0 (OK)
qtconsole >=4.6.0            :  4.6.0 (OK)
qtpy >=1.5.0                 :  1.9.0 (OK)
rtree >=0.8.3                :  0.9.3 (OK)
sphinx >=0.6.6               :  2.3.1 (OK)
spyder_kernels >=1.8.1;<2.0.0:  1.8.1 (OK)
watchdog                     :  None (OK)
cython >=0.21                :  None (NOK)
matplotlib >=2.0.0           :  None (NOK)
numpy >=1.7                  :  1.17.3 (OK)
pandas >=0.13.1              :  None (NOK)
scipy >=0.17.0               :  1.3.1 (OK)
sympy >=0.7.3                :  None (NOK)

have created a "bare" anaconda environment and reinstalled spyder and now get the following kite-related errors:
File "C:\Progra~1\Anaconda3\envs\bare\lib\site-packages\spyder\app\mainwindow.py", line 3718, in main
mainwindow = run_spyder(app, options, args)
File "C:\Progra~1\Anaconda3\envs\bare\lib\site-packages\spyder\app\mainwindow.py", line 3559, in run_spyder
main.setup()
File "C:\Progra~1\Anaconda3\envs\bare\lib\site-packages\spyder\app\mainwindow.py", line 960, in setup
self.completions.start()
File "C:\Progra~1\Anaconda3\envs\bare\lib\site-packages\spyder\plugins\completion\plugin.py", line 292, in start
client_info['plugin'].start()
File "C:\Progra~1\Anaconda3\envs\bare\lib\site-packages\spyder\plugins\completion\kite\plugin.py", line 144, in start
self.client.start()
File "C:\Progra~1\Anaconda3\envs\bare\lib\site-packages\spyder\plugins\completion\kite\client.py", line 62, in start
self.sig_client_started.emit(self.languages)
TypeError: KiteClient.sig_client_started[list].emit(): argument 1 has unexpected type 'str'

ignore strikeouts; they were created by having a tilde between "Progra" and 1

could you post the output of
$ curl -v http://localhost:46624/clientapi/languages
$ curl -v http://localhost:46624/clientapi/status?filetype=python

my employer-owned system ended up having "forbidden" messages when running the curl commands, but I did get myself to a workable state. On that system I downgraded Spyder to the latest v3. On my home system I was able to get v4.0.1 working.

It looks like we just need to check the status code of the response and gracefully fail in these sorts of cases @ccordoba12

@suzannejb, thanks a lot for your information. That was very helpful!

It looks like we just need to check the status code of the response and gracefully fail in these sorts of cases

@metalogical, it seems this is a firewall issue and I totally agree with your proposed solution. Could you help us with this?

@suzannejb if possible could you post the full output of curl -v on your employer-owned machine? In particular, I'm interested in the HTTP status code. I don't see how this could happen unless the status code is 200 for some reason (despite the "forbidden" response)

authors: ccordoba12 metalogical suzannejb

repo: spyder-ide/spyder