使用Spring Boot 1.4 CLI安装Spring Cloud CLI - ClassNotFoundException - org.springframework.boot.cli.command.CommandFactory

时间:2016-08-10 00:23:42

标签: spring-boot command-line-interface spring-cloud

我从brew - brew安装跳羚安装了springboot 这给了我1.4.0.RELEASE

此外,我尝试安装spring cli以在本地运行spring encrypt

spring install org.springframework.cloud:spring-cloud-cli:1.2.0.BUILD-SNAPSHOT

从那时起,任何弹簧命令都会抛出

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58)
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/cli/command/CommandFactory
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
    at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:89)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at org.springframework.boot.cli.SpringCli.addServiceLoaderCommands(SpringCli.java:64)
    at org.springframework.boot.cli.SpringCli.main(SpringCli.java:48)
    ... 8 more
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.cli.command.CommandFactory
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 29 more

缺少什么?我记得几个月前这个版本的早期版本是较低版本的springboot。

1 个答案:

答案 0 :(得分:0)

我们知道这个问题。您可以在此处跟踪https://github.com/spring-cloud/spring-cloud-cli/issues/20

解决方法是使用spring boot 1.3.6.RELEASE