【问题标题】:adding spring-cloud-starter-dataflow-server-local leads to the error: Command line is too long. Shorten command line for ... or also for Spring Boot添加 spring-cloud-starter-dataflow-server-local 导致错误:命令行太长。缩短 ... 或 Spring Boot 的命令行
【发布时间】:2019-12-16 10:01:10
【问题描述】:

我正在编写简单的应用程序来熟悉 Spring Batch。我想学习spring batch admin,发现它已被弃用,所以我必须改用spring cloud data flow。

我有关于 Spring Cloud 数据的教程并做了第一步:

  1. 添加依赖:

    compile("org.springframework.cloud:spring-cloud-starter-dataflow-server-local:1.7.4.RELEASE")

  2. 并用additioanl annotaion标记了我的spring boot应用程序类:

    @EnableDataFlowServer

现在我正在尝试使用想法运行它,但它会打印:

19:14   Error running 'MyApplication': Command line is too long. Shorten command line for MyApplication or also for Spring Boot default configuration.

那一刻我认为这是 IDEA 错误并尝试使用 gradle(通过 idea 插件)使用 boot run 运行应用程序,但它也启动了:

19:15:21: Executing task 'bootRun'...

Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:compileJava
:processResources UP-TO-DATE
:classes
:bootRun FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootRun'.
> A problem occurred starting process 'command 'C:\Program Files\Java\jdk1.8.0_111\bin\java.exe''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
3 actionable tasks: 2 executed, 1 up-to-date
CreateProcess error=206, The filename or extension is too long
19:15:26: Task execution finished 'bootRun'.

我该如何解决这个问题?

附言

我的仓库是https://github.com/gredwhite/spring-batch-hello-world

【问题讨论】:

    标签: java spring-boot intellij-idea spring-batch spring-cloud-dataflow


    【解决方案1】:

    使用其中一个选项来缩短命令行:

    【讨论】:

    • 选择其中一个选项后,如果我使用idea运行,错误已更改。但是如果我使用 gradle spring boot runner,它并没有消失。你知道如何解决它吗?你能详细说明一下这个问题吗?为什么会这样?
    • @gstackoverflow 发生这种情况是因为操作系统对最大命令行长度的限制。当依赖项中有很多 jar 时,命令行变得太长,操作系统无法启动进程。 IntelliJ IDEA 提供此功能以解决操作系统限制。见stackoverflow.com/a/3205048/104891
    • 你知道 gradle spring boot 插件有什么解决方法吗?
    • @gstackoverflow 你可以试试this plug-in。另见相应的bug report
    • 标签:巫毒教。谢谢。
    猜你喜欢
    • 2018-09-22
    • 2021-05-26
    • 2018-08-08
    • 2018-08-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多