Springboot / gradle / tomcat:进程java.exe以非零退出值1结束

时间:2015-12-11 22:21:02

标签: java tomcat gradle spring-boot spring-boot-gradle-plugin

我想用gradle&创建一个可执行的jar文件。 springboot。我已经清理了gradle,重新安装了java并杀死了所有的java进程。有时该过程也会停止在80%,我无法再访问命令窗口。我是在远程桌面上工作。 但是当我执行gradle bootRun时,命令行显示以下错误消息:

2015-12-11 13:20:55.133 ERROR 5992 --- [           main] o.s.boot.SpringApplicat
ion               : Application startup failed

org.springframework.boot.context.embedded.EmbeddedServletContainerException: Una
ble to start embedded Tomcat servlet container
        at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServle
tContainer.start(TomcatEmbeddedServletContainer.java:165) ~[spring-boot-1.3.0.RE
LEASE.jar:1.3.0.RELEASE]
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationConte
xt.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:290) ~[sprin
g-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationConte
xt.finishRefresh(EmbeddedWebApplicationContext.java:141) ~[spring-boot-1.3.0.REL
EASE.jar:1.3.0.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:540) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.
RELEASE]
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationConte
xt.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.0.RELEASE.j
ar:1.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.
java:752) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.doRun(SpringApplication.ja
va:347) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java
:295) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
        at org.sprinork.boot.SpringApplication.run(SpringApplication.java:1112)
[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java
:1101) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
        at DBConnection.Application.main(Application.java:10) [main/:na]
Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
        at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServle
tContainer.start(TomcatEmbeddedServletContainer.java:159) ~[spring-boot-1.3.0.RE
LEASE.jar:1.3.0.RELEASE]
        ... 10 common frames omitted

:bootRun FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootRun'.
> Process 'command 'C:\Program Files\Java\jdk1.8.0_65\bin\java.exe'' finished wi
th non-zero exit value 1

这是我的build.gradle文件:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.0.RELEASE")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'war'

jar {
    baseName = 'gs-rest-service'
    version =  '0.1.0'
}

repositories {
    mavenCentral()
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
    providedCompile("org.springframework.boot:spring-boot-starter-web")
    testCompile("junit:junit")
}

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

springBoot{
    mainClass = "DBConnection.Application"
}

我的Application.java文件:

package DBConnection;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;




    @SpringBootApplication
        public class Application {

            public static void main(String[] args) {
                SpringApplication.run(Application.class, args);
            }

        }

非常感谢!我真的不知道该怎么做..

0 个答案:

没有答案