Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Grails3.x启动失败_Java_Grails_Gradle - Fatal编程技术网

Java Grails3.x启动失败

Java Grails3.x启动失败,java,grails,gradle,Java,Grails,Gradle,我试图在Grails3.1.11中运行一个项目,但我有一个错误 失败:生成失败,出现异常 出了什么问题: 任务“:bootRun”的执行失败 进程“command”C:\Program Files\Java\jdk1.8.0\u 111\bin\Java.exe“”以非零退出值1完成 尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出 原因:java.net.BindException:地址已在使用中:bind at su

我试图在Grails3.1.11中运行一个项目,但我有一个错误

失败:生成失败,出现异常

  • 出了什么问题: 任务“:bootRun”的执行失败

    进程“command”C:\Program Files\Java\jdk1.8.0\u 111\bin\Java.exe“”以非零退出值1完成

  • 尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出

原因:java.net.BindException:地址已在使用中:bind at sun.nio.ch.Net.bind0(本机方法)位于 bind(Net.java:433)位于 bind(Net.java:425)

这是我的身材,格雷德尔

buildscript {
    ext {
        grailsVersion = project.grailsVersion
    }
    repositories {
        mavenLocal()
        maven { url "https://repo.grails.org/grails/core" }
    }
    dependencies {
        classpath "org.grails:grails-gradle-plugin:$grailsVersion"
        classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.8.2"
        classpath "org.grails.plugins:hibernate4:5.0.10"
    }
}

version "0.1"
group "sias"

apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"org.grails.grails-gsp"
apply plugin:"asset-pipeline"

ext {
    grailsVersion = project.grailsVersion
    gradleWrapperVersion = project.gradleWrapperVersion
}

repositories {
    mavenLocal()
    maven { url "https://repo.grails.org/grails/core" }
}

dependencyManagement {
    imports {
        mavenBom "org.grails:grails-bom:$grailsVersion"
    }
    applyMavenExclusions false
}

dependencies {
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-autoconfigure"
    compile "org.grails:grails-core"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    compile "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.grails:grails-dependencies"
    compile "org.grails:grails-web-boot"
    compile "org.grails.plugins:cache"
    compile "org.grails.plugins:scaffolding"
    compile "org.grails.plugins:hibernate4"
    compile "org.hibernate:hibernate-ehcache"
    console "org.grails:grails-console"
    profile "org.grails.profiles:web"
    runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.8.2"
    runtime "com.h2database:h2"
    testCompile "org.grails:grails-plugin-testing"
    testCompile "org.grails.plugins:geb"
    testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
    testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
}

assets {
    minifyJs = true
    minifyCss = true
}

有人来帮我吗??谢谢。

我最近在
Grails3.x
版本中遇到了这样的问题。您可以通过以下步骤克服此问题

步骤1

通过cmd中的
Stop app
命令停止应用程序,或通过“编辑配置”窗口中的
Stop app
命令替换
run app
命令

步骤2

然后将GRAILS默认的http“8080”端口更改为任何自定义端口,如“8090”。要更改默认端口,应转到

grails应用程序[main]->conf-->application.yml

application.yml
文件中,您只需将其保存在该文件的所有代码下即可

server:
  port: 8090
步骤3

然后通过“编辑配置”窗口或cmd中的
runapp
命令替换
stoppapp
命令来运行应用程序


在这里,需要使用停止应用程序命令,因为应用程序使用默认环境缓存了上一个命令。当你改变一些东西时,它在应用中就没有任何意义了。所以,通过“停止应用程序”命令,它会终止所有以前的进程,擦除缓存的内容

您需要终止旧服务器实例或任何正在端口8080上侦听的服务。请关闭活动的java进程,然后重试。