gpt4 book ai didi

elasticsearch - 获取org.gradle.api.tasks.TaskExecutionException:任务 ':bootRun'的执行失败。添加spring数据 Elasticsearch 能力后的异常

转载 作者:行者123 更新时间:2023-12-03 06:29:21 27 4
gpt4 key购买 nike

gradle.api.tasks.TaskExecutionException: Execution failed for task ':bootRun'. 
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Program Files\Java\jdk1.8.0_172\bin\java.exe''
at org.gradle.process.internal.DefaultExecHandle.execExceptionFor(DefaultExecHandle.java:226)
at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:204)
at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:349)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:85)
at org.gradle.internal.operations.BuildOperationIdentifierPreservingRunnable.run(BuildOperationIdentifierPreservingRunnable.java:39)
... 3 more
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'C:\Program Files\Java\jdk1.8.0_172\bin\java.exe'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WindowsProcessLauncher.start(WindowsProcessLauncher.java:22)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:67)
... 4 more
Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.8.0_172\bin\java.exe" (in directory "D:\Finite4\RMS2\recruitment-management-system\server"): CreateProcess error=206, The filename or extension is too long
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 7 more
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
... 8 more

添加spring数据 Elasticsearch 能力后发生异常。请帮助我解决这个问题。

以下是我的gradle文件
buildscript {
repositories {
mavenCentral()
}emphasized text
dependencies {
classpath('org.springframework.boot:spring-boot-gradle-plugin:2.0.0.RELEASE')
}
}

repositories {
mavenCentral()
}

apply plugin:'java'
apply plugin:'eclipse'
apply plugin:'org.springframework.boot'
apply plugin:'io.spring.dependency-management'

sourceCompatibility=1.8
targetCompatibility=1.8

dependencies {
compileOnly('org.projectlombok:lombok:1.16.20')
//compile('org.springframework.boot:spring-boot-starter-data-elasticsearch:1.5.11.RELEASE')
compile('org.springframework.boot:spring-boot-starter-web:2.0.2.RELEASE')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-security:2.0.2.RELEASE')
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-elasticsearch', version: '2.0.2.RELEASE'

compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-devtools')
compile('org.springframework.boot:spring-boot-starter-cache')
compile('org.springframework.boot:spring-boot-starter-mail')
compile('org.json:json:20090211')
compile('io.jsonwebtoken:jjwt:0.9.0')
//compile('org.hibernate:hibernate-ehcache:5.2.13.Final')
compile('javax.xml.bind:jaxb-api:2.3.0')
compile('org.hibernate:hibernate-envers')
compile('org.liquibase:liquibase-core')
compile('org.postgresql:postgresql')
compile('io.springfox:springfox-swagger2:2.7.0')
compile('io.springfox:springfox-swagger-ui:2.7.0')
compile 'org.apache.tika:tika-core:1.18'
compile 'org.apache.tika:tika-parsers:1.18'
testCompile('junit:junit')
testCompile('org.springframework.boot:spring-boot-starter-test')
runtime('net.java.dev.jna:jna')
}

sourceSets {
testIntegration {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/testIntegration/java')
}
resources.srcDir file('src/testIntegration/resources')
}
}

configurations {
testIntegrationCompile.extendsFrom testCompile
testIntegrationRuntime.extendsFrom testRuntime
}

bootRun {
sourceResources sourceSets.main
}


bootJar {
baseName='rms'
version= 'git describe'.execute().text.trim()
manifest {
attributes('Implementation-Title':baseName,
'Implementation-Version':version)
}
}

task testIntegration(type: Test) {
description = 'Runs the integration tests'
group = 'verification'
testClassesDir = sourceSets.testIntegration.output.classesDir
classpath = sourceSets.testIntegration.runtimeClasspath
}

tasks.withType(Test) {
reports.html.destination = file("${reporting.baseDir}/${name}")
}

check.dependsOn testIntegration
testIntegration.mustRunAfter test

task wrapper(type: Wrapper) {
gradleVersion = '4.4.1'
}

以下是我得到的错误
D:\RMS\server>gradle bootRun --stacktrace

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_172\bin\java.exe''

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

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':bootRun'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Program Files\Java\jdk1.8.0_172\bin\java.exe''
at org.gradle.process.internal.DefaultExecHandle.execExceptionFor(DefaultExecHandle.java:226)
at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:204)
at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:349)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:85)
at org.gradle.internal.operations.BuildOperationIdentifierPreservingRunnable.run(BuildOperationIdentifierPreservingRunnable.java:39)
... 3 more
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'C:\Program Files\Java\jdk1.8.0_172\bin\java.exe'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WindowsProcessLauncher.start(WindowsProcessLauncher.java:22)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:67)
... 4 more
Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.8.0_172\bin\java.exe" (in directory "D:\Finite4\RMS2\recruitment-management-system\server"): CreateProcess error=206, The filename or extension is too long
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 7 more
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
... 8 more


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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.6/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 15s
3 actionable tasks: 1 executed, 2 up-to-date

最佳答案

在您的Gradle文件中,我看到spring-boot-starter-web(2.0.2.RELEASE)和spring-boot-starter-data-elasticsearch(1.5.11.RELEASE)之间的版本不匹配。您可以同步制作版本吗? spring 2.x和1.5.x在大多数情况下都不兼容。

关于elasticsearch - 获取org.gradle.api.tasks.TaskExecutionException:任务 ':bootRun'的执行失败。添加spring数据 Elasticsearch 能力后的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55123967/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com