spring-Microservices-in-action问题记录

Posted 独孤文彬

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了spring-Microservices-in-action问题记录相关的知识,希望对你有一定的参考价值。

环境:win10、Docker version 18.09.2, build 6247962

问题一:
/bin/sh: 1: ./install.sh: not found on docker for windows using

问题三
organizationservice_1 | /bin/sh: ./run.sh: not found
如图:

诱发此类问题的两个常见因素:

  • 确实没有这个. sh 文件
  • 文件的内容有问题:格式或者编码问题

本问题原因:
I confirm that this is a CR LF trouble.
解决方法:
http://sql313.com/index.php/43-main-blogs/maincat-dba/62-using-notepad-to-change-end-of-line-characters

chapter3/chapter4
问题二:

 Failed to execute goal com.spotify:docker-maven-plugin:0.4.10:build (default-cli) on
 project configurationserver: Exception caught: The command '/bin/sh -c cd /tmp/ &&     curl
 -k -LO "http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip" -H 'Cookie: oraclel
icense=accept-securebackup-cookie' &&     unzip jce_policy-8.zip &&     rm jce_policy-8.zip
&&     yes |cp -v /tmp/UnlimitedJCEPolicyJDK8/*.jar /usr/lib/jvm/java-1.8-openjdk/jre/lib/se
curity/' returned a non-zero code: 1 ->

本问题原因:
无法在http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip" -H 'Cookie: oraclel icense=accept-securebackup-cookie下载链接中得到正常的内容。

解决方案:
将对应工程下dockerfile 中定义的下载链接更换为:https://edelivery.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip" -H 'Cookie: oraclelicense=accept-securebackup-cookie

问题四:调试程序(chapter4),启动报错:

java.lang.IllegalStateException: Cannot decrypt: key=spring.datasource.password
	at org.springframework.cloud.bootstrap.encrypt.EnvironmentDecryptApplicationInitializer.decrypt(EnvironmentDecryptApplicationInitializer.java:201) ~[spring-cloud-context-1.1.7.RELEASE.jar:1.1.7.RELEASE]
	at org.springframework.cloud.bootstrap.encrypt.EnvironmentDecryptApplicationInitializer.decrypt(EnvironmentDecryptApplicationInitializer.java:165) ~[spring-cloud-context-1.1.7.RELEASE.jar:1.1.7.RELEASE]
	at org.springframework.cloud.bootstrap.encrypt.EnvironmentDecryptApplicationInitializer.initialize(EnvironmentDecryptApplicationInitializer.java:95) ~[spring-cloud-context-1.1.7.RELEASE.jar:1.1.7.RELEASE]
	at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:636) [spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]
	at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:350) [spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1187) [spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1176) [spring-boot-1.4.4.RELEASE.jar:1.4.4.RELEASE]
	at com.thoughtmechanix.organization.Application.main(Application.java:17) [classes/:na]
Caused by: java.lang.UnsupportedOperationException: No decryption for FailsafeTextEncryptor. Did you configure the keystore correctly?
	at org.springframework.cloud.bootstrap.encrypt.EncryptionBootstrapConfiguration$FailsafeTextEncryptor.decrypt(EncryptionBootstrapConfiguration.java:152) ~[spring-cloud-context-1.1.7.RELEASE.jar:1.1.7.RELEASE]
	at org.springframework.cloud.bootstrap.encrypt.EnvironmentDecryptApplicationInitializer.decrypt(EnvironmentDecryptApplicationInitializer.java:193) ~[spring-cloud-context-1.1.7.RELEASE.jar:1.1.7.RELEASE]
	... 8 common frames omitted

分析:问题原因
解决方案:

以上是关于spring-Microservices-in-action问题记录的主要内容,如果未能解决你的问题,请参考以下文章