我使用spring cloud创建了一个Spring Config Server,用于从远程GIT仓库获取属性文件。但是当我点击 http://localhost:8081/spring-config/eureka 时,它会在控制台上显示以下错误 - (我创建了一个名为eureka.properties的文件,放在 https://github.com/piyushbaghla/spring-config )
[2m2018-06-03 23:19:41.163 [0; 39m [31mERROR [0; 39m [35m7648 [0; 39m [2m --- [0; 39m [2m [nio-8081-exec-9] [0; 39m [36mo.accC [。[。[/]。[dispatcherServlet] [0; 39m [2m:[0; 39m Servlet.service()for servlet [dispatcherServlet]在上下文中,路径[]引发了异常[请求处理失败;嵌套异常是java.lang.IllegalStateException:无法加载具有根本原因的环境
java.lang.StringIndexOutOfBoundsException:字符串索引超出范围:-1 at java.lang.String.substring(String.java:1967)〜[na:1.8.0_144] 在org.springframework.cloud.config.server.environment.HttpClientConfigurableHttpConnectionFactory.lookupHttpClientBuilder(HttpClientConfigurableHttpConnectionFactory.java:69)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] 在org.springframework.cloud.config.server.environment.HttpClientConfigurableHttpConnectionFactory.create(HttpClientConfigurableHttpConnectionFactory.java:56)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] 在org.eclipse.jgit.transport.TransportHttp.httpOpen(TransportHttp.java:830)〜[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r] 在org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:491)〜[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r] 在org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:345)〜[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r] 在org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:137)〜[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r] 在org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:123)〜[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r] 在org.eclipse.jgit.transport.Transport.fetch(Transport.java:1269)~ [org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r] 在org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:241)〜[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r] 在org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:306)〜[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r] 在org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:200)〜[org.eclipse.jgit-4.11.0.201803080745-r.jar:4.11.0.201803080745-r] 在org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.cloneToBasedir(JGitEnvironmentRepository.java:560)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] 在org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.copyRepository(JGitEnvironmentRepository.java:535)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] 在org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.createGitClient(JGitEnvironmentRepository.java:518)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] 在org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.refresh(JGitEnvironmentRepository.java:259)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] 在org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.getLocations(JGitEnvironmentRepository.java:238)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] 在org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.getLocations(MultipleJGitEnvironmentRepository.java:150)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] 在org.springframework.cloud.config.server.environment.AbstractScmEnvironmentRepository.findOne(AbstractScmEnvironmentRepository.java:47)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] 在org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.findOne(MultipleJGitEnvironmentRepository.java:190)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] 在org.springframework.cloud.config.server.environment.CompositeEnvironmentRepository.findOne(CompositeEnvironmentRepository.java:46)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] 在org.springframework.cloud.config.server.environment.EnvironmentEncryptorEnvironmentRepository.findOne(EnvironmentEncryptorEnvironmentRepository.java:53)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] 在org.springframework.cloud.config.server.environment.EnvironmentController.labelled(EnvironmentController.java:122)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] 在org.springframework.cloud.config.server.environment.EnvironmentController.defaultLabel(EnvironmentController.java:106)〜[spring-cloud-config-server-2.0.0.BUILD-SNAPSHOT.jar:2.0.0.BUILD-SNAPSHOT ] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)〜[na:1.8.0_144] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)〜[na:1.8.0_144] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)〜[na:1.8.0_144] 在java.lang.reflect.Method.invoke(Method.java:498)〜[na:1.8.0_144] 在org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)〜[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)〜[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)〜[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:877)〜[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:783)〜[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)〜[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)〜[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)~ [spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)〜[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866)〜[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在javax.servlet.http.HttpServlet.service(HttpServlet.java:635)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)〜[spring-webmvc-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在javax.servlet.http.HttpServlet.service(HttpServlet.java:742)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)〜[tomcat-embed-websocket-8.5.31.jar:8.5.31] 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:158)~ [spring-boot-actuator-2.1.0.BUILD-SNAPSHOT.jar:2.1.0.BUILD-SNAPSHOT ] 在org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:126)~ [spring-boot-actuator-2.1.0.BUILD-SNAPSHOT.jar:2.1.0.BUILD-SNAPSHOT ] 在org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:111)〜[spring-boot-actuator-2.1.0.BUILD-SNAPSHOT.jar:2.1.0.BUILD-SNAPSHOT ] 在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)〜[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:84)〜[spring-boot-actuator-2.1.0.BUILD-SNAPSHOT.jar:2.1.0.BUILD-SNAPSHOT ] 在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)〜[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)〜[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)〜[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)〜[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)〜[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)〜[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)〜[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)〜[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)〜[spring-web-5.0.6.RELEASE.jar:5.0.6.RELEASE] 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)〜[tomcat-embed-core-8.5.31.jar:8.5.31] 在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] 在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] 在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.coyote.AbstractProtocol $ ConnectionHandler.process(AbstractProtocol.java:790)[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.doRun(NioEndpoint.java:1468)[tomcat-embed-core-8.5.31.jar:8.5.31] 在org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)[tomcat-embed-core-8.5.31.jar:8.5.31] 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[na:1.8.0_144] at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)[na:1.8.0_144] 在org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61)[tomcat-embed-core-8.5.31.jar:8.5.31] 在java.lang.Thread.run(Thread.java:748)[na:1.8.0_144]
任何人都可以在这里提出错误的建议。 当我在我的机器上连接本地GIT仓库时,它工作正常。