我试图在这个链接http://cloud.spring.io/spring-cloud-dataflow/#quick-start上学习spring云数据流教程。
在步骤2中,执行以下行
java -jar spring-cloud-dataflow-server-local-1.2.2.RELEASE.jar结果出现以下例外情况:
2017-07-01 16:21:00.218 WARN 3224 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'taskService' defined in class path resource [org/springframework/cloud/dataflow/server/config/features/TaskConfiguration.class]: Unsatisfied dependency expressed through method 'taskService' parameter 5; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'taskLauncher' defined in class path resource [org/springframework/cloud/deployer/spi/local/LocalDeployerAutoConfiguration.class]: Unsatisfied dependency expressed through method 'taskLauncher' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.cloud.deployer.local-org.springframework.cloud.deployer.spi.local.LocalDeployerProperties': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.deployer.spi.local.LocalDeployerProperties]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Java executable discovered via 'java.home' system property 'C:\Program Files\Java\jdk1.8.0_131\jre' is not executable or does not exist.
我认为关键是‘c:\ files\java\jdk1.8.0_131\jre’似乎是通向java二进制文件的错误路径。我希望这是%JRE_HOME%\bin目录。
我编写了一个小程序来转储系统属性,它产生了以下结果:
java.home: C:\Program Files\Java\jdk1.8.0_131\jre
我的JAVA_HOME、JRE_HOME、CLASSPATH和JDK_HOME环境变量设置如下
JAVA_HOME C:\Program Files\Java\jdk1.8.0_131
JDK_HOME %JAVA_HOME%
JRE_HOME %JAVA_HOME%\jre
CLASSPATH .;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib路径变量设置为%JAVA_HOME%\bin
我已多次重新启动命令提示符。
当我为1.1.4版本运行以下命令时,服务器将在没有错误的情况下启动:
java -jar spring-cloud-dataflow-server-local-1.1.4.RELEASE.jar我尝试删除JRE_HOME变量,并将CLASSPATH设置为。
更新:添加dir c:\java.exe /s /b的输出
c:\Program Files\Java\jdk1.8.0_131\bin\java.exe
c:\Program Files\Java\jdk1.8.0_131\jre\bin\java.exe
c:\Program Files\Java\jre1.8.0_131\bin\java.exe
c:\Program Files (x86)\Java\jre1.8.0_131\bin\java.exe
c:\ProgramData\Oracle\Java\javapath\java.exe
c:\ProgramData\Oracle\Java\javapath_target_260505593\java.exe
c:\Users\All Users\Oracle\Java\javapath\java.exe
c:\Users\All Users\Oracle\Java\javapath_target_260505593\java.exe发布于 2017-07-08 20:32:36
这是一个bug:(只影响1.2.2.impacts,由1.2.3修正)
https://github.com/spring-cloud/spring-cloud-deployer-local/issues/58
“工作”解决方案是转到系统上java的JRE路径,并运行以下命令
(请向其他用户说明,如果java主路径中有“jdk”,请在命令提示符窗口中找到您的java路径类型echo %JAVA_HOME%,请确保将其更改为“jre”,用于下面的“cd”命令。我们需要导航到jre dir而不是jdk,我们还附加了'\bin')
cd C:\Program Files\Java\jre1.8.0_131\bin
(notice: in the path "jre1.8" not jdk)
复制java.exe java
错误/解决方案摘要:
窃听器基本上是..。开发人员希望java可执行文件被称为java,而不是java.exe,因为它是在Windows上命名的。因此,解决方法是创建java.exe的副本,并在JRE的bin目录中将其命名为java .
不知道这样的东西是怎么到制作版的.:/
发布于 2017-07-28 10:12:23
此错误已在1.2.3中修复。
https://stackoverflow.com/questions/44865103
复制相似问题