アプリケーションを(1.5.xから)Spring Boot 2.1.3にアップグレードしていますが、起動時に問題が発生します。ブロックの下は正しくバインドできません:
spring:
zipkin:
enabled: true
base-url: http://myZipkinServer
sender:
type: web
このエラーが発生しています:
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'spring.zipkin.sender.type' to org.springframework.cloud.sleuth.zipkin2.sender.ZipkinSenderProperties$SenderType:
Property: spring.zipkin.sender.type
Value: web
Origin: class path resource [application.yml]:68:13
Reason: 0
Action:
Update your application's configuration
問題を通知するWARNログを取得する少し前に:
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'spring.zipkin.sender-org.springframework.cloud.sleuth.zipkin2.sender.ZipkinSenderProperties': Could not bind properties to 'ZipkinSenderProperties' : prefix=spring.zipkin.sender, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.zipkin.sender.type' to org.springframework.cloud.sleuth.zipkin2.sender.ZipkinSenderProperties$SenderType
私はデバッグをフォローしようとしていますが、最終的にはのSpring Boot内部のかなり深いところに行きますorg.springframework.boot.context.properties.bind.Binder
。ほぼ同じバージョンの同様のアプリがあり、正常に動作します。違いを見つけて実行フローを比較しようとしていますが、明らかなものは何も見つかりません。
IntelliJでは、オートコンプリートが表示されるので、yamlが適切にフォーマットされていることがわかります。「web」値が提案されます。
この種の問題を調査する方法のアイデアはありますか?
申し訳ありませんが、数時間の苦労の末、私はある程度の進歩を遂げ、今ではアプリが起動します。ただし、現時点では問題の根本的な原因は完全には解明されていません。以下は私の発見です:
私が気付いた奇妙なことの1つ:sender.type
from web
をに変更rabbit
すると、アプリケーションはエラーなしで起動します。
私はまた、JDKのバグを指摘しているこのSpring Bootの問題レポートを見つけました。そして実際、からjdk1.8.0_25
にアップグレードしていjdk1.8.0_201
ます。
最後に、私が使用jdk1.8.0_25
していてまったく提供していなかったsender.type
場合、アプリも問題なく起動していたこともわかりました。
どういうわけか、私が持っている他のアプリで機能し、使用jdk1.8.0_25
してsender.type: web
誰かがこの種の問題をすばやく理解する方法論を持っている場合は、コメントに追加するか、この回答を編集することをためらわないでください。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加