spring-cloud / spring-cloud-cli

Spring Cloud CLI features
Apache License 2.0
155 stars 80 forks source link

Failed to launch spring cloud cli following the README.md file #136

Open cfries opened 4 years ago

cfries commented 4 years ago

I am not able to run spring cloud cli 2.2.0.RELEASE with spring boot cli 2.2.0. RELEASE, following the instructions. However, spring cloud cli 2.1.0.RELEASE with spring boot cli 2.1.0.RELEASE works.

System

OS: macOS 10.14.6 Java: 1.8.0 Update 181

Reproducing the Issue

Steps I did:

  1. Install Spring-Boot CLI

for 2.1.0 (WORKS): https://repo.spring.io/release/org/springframework/boot/spring-boot-cli/2.1.0.RELEASE/

for 2.2.1 (DOES NOT WORK): https://repo.spring.io/release/org/springframework/boot/spring-boot-cli/2.2.1.RELEASE/

  1. Get spring cloud cli from git hub:
git clone https://github.com/spring-cloud/spring-cloud-cli.git

For version 2.1.0 (WORKS)

git checkout c4fb7baf97a47c9c037969f67ba806c8c941950e

For version 2.2.0 (DOES NOT WORK)

git checkout 22253a2f4651044acec05bf2b475e24730577034
  1. Install
git clone https://github.com/spring-cloud/spring-cloud-cli.git
cd spring-cloud-cli
mvn install
  1. Run

From the spring-cli bin directory run

For version 2.1.0 (WORKS)

./spring install org.springframework.cloud:spring-cloud-cli:2.1.0.RELEASE
./spring cloud

For version 2.2.0 (DOES NOT WORK)

./spring install org.springframework.cloud:spring-cloud-cli:2.2.0.RELEASE
./spring cloud

Result

If I run cloud cli 2.2.0 with boot cli 2.2.1 I get the Exception below.

Note that 2.1.0 (cloud cli) works with 2.1.0 (boot cli), but I did not check other combinations yet.

Trinity:bin fries$ ./spring cloud

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.1.RELEASE)

2019-11-27 14:14:40.400  INFO 21844 --- [           main] o.s.c.l.deployer.DeployerApplication     : Starting DeployerApplication v2.2.0.RELEASE on Trinity.local with PID 21844 (/Users/fries/.m2/repository/org/springframework/cloud/launcher/spring-cloud-launcher-deployer/2.2.0.RELEASE/spring-cloud-launcher-deployer-2.2.0.RELEASE.jar started by fries in /Users/fries/bin/spring-2.2.1.RELEASE/bin)
2019-11-27 14:14:40.403  INFO 21844 --- [           main] o.s.c.l.deployer.DeployerApplication     : No active profile set, falling back to default profiles: default
2019-11-27 14:14:40.852  INFO 21844 --- [           main] o.s.c.l.deployer.DeployerApplication     : Started DeployerApplication in 1.134 seconds (JVM running for 3.724)
2019-11-27 14:14:41.061  INFO 21844 --- [           main] o.s.boot.loader.thin.PathResolver        : Extracting dependencies from: file:/Users/fries/.m2/repository/org/springframework/cloud/launcher/spring-cloud-launcher-configserver/2.2.0.RELEASE/spring-cloud-launcher-configserver-2.2.0.RELEASE.jar, with profiles []
2019-11-27 14:14:41.062  INFO 21844 --- [           main] o.s.boot.loader.thin.PathResolver        : Searching for properties in: file:/Users/fries/.m2/repository/org/springframework/cloud/launcher/spring-cloud-launcher-configserver/2.2.0.RELEASE/spring-cloud-launcher-configserver-2.2.0.RELEASE.jar
2019-11-27 14:14:41.064  INFO 21844 --- [           main] o.s.boot.loader.thin.PathResolver        : Extracting dependencies from: class path resource [META-INF/thin/empty-pom.xml], with profiles []
2019-11-27 14:14:41.585  INFO 21844 --- [           main] o.s.b.loader.thin.MavenSettingsReader    : Reading settings from: /Users/fries/.m2/settings.xml
2019-11-27 14:14:41.604  INFO 21844 --- [           main] o.s.boot.loader.thin.DependencyResolver  : Computing dependencies from pom and properties
2019-11-27 14:14:41.737 ERROR 21844 --- [           main] o.s.c.deployer.thin.ThinJarAppWrapper    : Cannot deploy org.springframework.cloud.launcher:spring-cloud-launcher-configserver:jar:2.2.0.RELEASE

java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.deployer.thin.ContextRunner] from ClassLoader [java.net.URLClassLoader@1332dec4]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:477) ~[spring-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
    at org.springframework.util.ReflectionUtils.findMethod(ReflectionUtils.java:240) ~[spring-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
    at org.springframework.cloud.deployer.thin.ThinJarAppWrapper.runContext(ThinJarAppWrapper.java:132) ~[spring-cloud-deployer-thin-1.0.22.RELEASE.jar:na]
    at org.springframework.cloud.deployer.thin.ThinJarAppWrapper.run(ThinJarAppWrapper.java:90) ~[spring-cloud-deployer-thin-1.0.22.RELEASE.jar:na]
    at org.springframework.cloud.deployer.thin.AbstractThinJarSupport.deploy(AbstractThinJarSupport.java:60) [spring-cloud-deployer-thin-1.0.22.RELEASE.jar:na]
    at org.springframework.cloud.deployer.thin.ThinJarAppDeployer.deploy(ThinJarAppDeployer.java:63) [spring-cloud-deployer-thin-1.0.22.RELEASE.jar:na]
    at org.springframework.cloud.launcher.deployer.Deployer.deployInternal(Deployer.java:203) [spring-cloud-launcher-deployer-2.2.0.RELEASE.jar:2.2.0.RELEASE]
    at org.springframework.cloud.launcher.deployer.Deployer.deploy(Deployer.java:108) [spring-cloud-launcher-deployer-2.2.0.RELEASE.jar:2.2.0.RELEASE]
    at org.springframework.cloud.launcher.deployer.DeployerApplication.launch(DeployerApplication.java:121) [spring-cloud-launcher-deployer-2.2.0.RELEASE.jar:2.2.0.RELEASE]
    at org.springframework.cloud.launcher.deployer.DeployerApplication.run(DeployerApplication.java:64) [spring-cloud-launcher-deployer-2.2.0.RELEASE.jar:2.2.0.RELEASE]
    at org.springframework.cloud.launcher.deployer.DeployerApplication.main(DeployerApplication.java:54) [spring-cloud-launcher-deployer-2.2.0.RELEASE.jar:2.2.0.RELEASE]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [spring-boot-thin-launcher-1.0.22.RELEASE-exec.jar:1.0.22.RELEASE]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [spring-boot-thin-launcher-1.0.22.RELEASE-exec.jar:1.0.22.RELEASE]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [spring-boot-thin-launcher-1.0.22.RELEASE-exec.jar:1.0.22.RELEASE]
    at org.springframework.boot.loader.thin.ThinJarLauncher.launch(ThinJarLauncher.java:193) [spring-boot-thin-launcher-1.0.22.RELEASE-exec.jar:1.0.22.RELEASE]
    at org.springframework.boot.loader.thin.ThinJarLauncher.main(ThinJarLauncher.java:140) [spring-boot-thin-launcher-1.0.22.RELEASE-exec.jar:1.0.22.RELEASE]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
    at org.springframework.boot.loader.wrapper.ThinJarWrapper.launch(ThinJarWrapper.java:140) [spring-cloud-launcher-deployer-2.2.0.RELEASE.jar:2.2.0.RELEASE]
    at org.springframework.boot.loader.wrapper.ThinJarWrapper.main(ThinJarWrapper.java:107) [spring-cloud-launcher-deployer-2.2.0.RELEASE.jar:2.2.0.RELEASE]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
    at org.springframework.cloud.launcher.cli.LauncherCommand$LauncherOptionHandler.run(LauncherCommand.java:115) [spring-cloud-launcher-cli-2.2.0.RELEASE.jar:2.2.0.RELEASE]
    at org.springframework.boot.cli.command.options.OptionHandler.run(OptionHandler.java:85) [classes!/:2.2.1.RELEASE]
    at org.springframework.boot.cli.command.OptionParsingCommand.run(OptionParsingCommand.java:54) [classes!/:2.2.1.RELEASE]
    at org.springframework.boot.cli.command.CommandRunner.run(CommandRunner.java:219) [classes!/:2.2.1.RELEASE]
    at org.springframework.boot.cli.command.CommandRunner.runAndHandleErrors(CommandRunner.java:171) [classes!/:2.2.1.RELEASE]
    at org.springframework.boot.cli.SpringCli.main(SpringCli.java:64) [classes!/:2.2.1.RELEASE]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [spring-boot-thin-launcher-1.0.22.RELEASE-exec.jar:1.0.22.RELEASE]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [spring-boot-thin-launcher-1.0.22.RELEASE-exec.jar:1.0.22.RELEASE]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [spring-boot-thin-launcher-1.0.22.RELEASE-exec.jar:1.0.22.RELEASE]
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [spring-boot-cli-2.2.1.RELEASE.jar:2.2.1.RELEASE]
Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ConfigurableApplicationContext
    at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_181]
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_181]
    at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_181]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:459) ~[spring-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
    ... 43 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ConfigurableApplicationContext
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_181]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_181]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_181]
    ... 47 common frames omitted

2019-11-27 14:14:41.743 ERROR 21844 --- [           main] o.s.cloud.launcher.cli.LauncherCommand   : Error running spring cloud
owen-chenao commented 4 years ago

you can try this version spring-boot-cli 1.5.18.RELEASE spring-cloud-cli 1.3.2.RELEASE

lijiele commented 4 years ago

you can try this version spring-boot-cli 1.5.18.RELEASE spring-cloud-cli 1.3.2.RELEASE Thanks. The same problem happened, but resolved by your solution.