这是我在学习在Spring Cloud Sleuth整合Zipkin在MySql数据库中存储链路数据时遇到的问题,
主要报错:
Unable to start web server; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zipkin2.server.internal.ZipkinServerConfiguration': Unsatisfied dependency expressed through field 'httpCollector'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zipkin2.server.internal.ZipkinHttpCollector': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'storage' defined in class path resource
主要原因:
原来的代码是对数据库的表进行信息存储,但是没有新建相对应的数据库导致zipkin和数据库无法正常连接而报错
解决方法:
在mysql新建数据库:zipkin
问题解决。
遇到这样的报错一般是查看数据库连接是否正常,用户名、密码等有没有按照电脑自带的mysql都要仔细检查