bijukunjummen / spring-cloud-ping-pong-sample

Sample spring-cloud based app
111 stars 104 forks source link

sample ping startup errors #3

Open magaton opened 8 years ago

magaton commented 8 years ago

I cannot run sample-ping app. At first I am getting this (with original Brixton.M3 dependency):

Unable to un-register Monitor:MonitorConfig{name=bootstrap, tags=class=AsyncResolver, policy=DefaultPublishingPolicy}

javax.management.InstanceNotFoundException: com.netflix.servo:name=eurekaClient.resolver.lastLoadTimestamp,class=AsyncResolver,id=bootstrap,level=INFO,type=GAUGE

Then, after I upgrade to Brixton.RC1:

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.web.client.RestTemplate org.bk.consumer.ribbon.RibbonEurekaPongClient.restTemplate; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.web.client.RestTemplate] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.cloud.client.loadbalancer.LoadBalanced()}

Any idea? Thanks

pjkCochin commented 8 years ago

I just started the applications, and all of them seems to startup fine. Here is the order I started them in

  1. Sampe-eureka
  2. sample-config
  3. sample-pong 4.sample-ping I started all of them with mvn sprint-boot:run.

I did not upgrade or make any changes to the codebase.

Hope this help!

Thanks, Paul

pjkCochin commented 8 years ago

Oops, I spoke too soon. I am getting this error now.

Paul

pjkCochin commented 8 years ago

Looks like this error does not stop the application from starting up and registering to eureka. you can still send message and receive response. This maybe related to not running sample-monitor?

Thanks, Paul

Louisblack commented 8 years ago

I'm also getting this error. Updating RestTemplateDirectPong and RibbonDirectPongClient to use RestOperations instead of RestTemplate helped. I also had to add a bean to the configuration.

``@Configuration public class RootConfiguration {

@Bean
@Primary
public RestOperations nonLoadbalancedRestTemplate() {
    return new RestTemplate();
}

@Bean
@LoadBalanced
public RestOperations loadbalancedRestTemplate() {
    return new RestTemplate();
}

Finally, removing the @Qualifier from HystrixWrappedPongClient.feignPongClient fixed it. I'll fork and create a pull request when I get home for you to check out.

Louisblack commented 8 years ago

Also spoke to soon... that makes it start but it can't connect to the other service - says host samplepong is not available

webjoin commented 8 years ago

I'm also getting this error.