Grails 3.x失败bootRun [英] Grails 3.x Failure bootRun
问题描述
我试图在grails 3.1.11中运行一个项目,但是我有一个错误。
失败:构建失败,出现异常。
-
发生了什么问题:
执行失败,执行任务':bootRun'。
进程'命令'C:\程序文件\Java\jdk1.8.0_111\bin\java.exe''以非零退出值1结束
-
尝试:
使用--stacktrace选项运行以获取堆栈跟踪。
使用--info或--debug选项可以获得更多日志输出。导致:java.net.BindException:已在使用的地址:绑定在
sun.nio.ch.Net.bind0(本机方法)在
sun.nio.ch.Net.bind(Net。 java:433)at
sun.nio.ch.Net.bind(Net.java:425)
这是我的build.gradle
buildscript {
ext {
grailsVersion = project.grailsVersion
}
存储库{
mavenLocal()
maven {urlhttps://repo.grails.org/grails/core}
}
依赖关系{
classpathorg.grails:grails-gradle-plugin:$ grailsVersion
classpathcom.bertramlabs.plugins:asset-pipeline-gradle:2.8.2
classpathorg.grails.plugins: hibernate4:5.0.10
}
版本0.1
组sias
应用插件:eclipse
套用插件:idea
套用插件:战争
套用插件:org.grails.grails-web
套用插件:org.grails.grails-gsp
套用插件:asset-pipeline
ext {
grailsVersion = project.grailsVersion
gradleWrapperVersion = project.gradleWrapperVersion
}
存储库{
mavenLocal()
maven {urlhttps://repo.grails.org/grails/core}
}
dependencyManagement {
imports {
mavenBomorg.grails:grails -bom:$ grailsVersion
applyMavenExclusions false
}
dependencies {
compileorg.springframework.boot:spring-boot-starter-日志
compileorg.springframework.boot:spring-boot-autoconfigure
compileorg.grails:grails-core
compileorg.springframework.boot:spring-boot-启动器执行器
compileorg.springframework.boot:spring-boot-starter-tomcat
compileorg.grails:grails-dependencies
compileorg.grails:grails- web-boot
comp ileorg.grails.plugins:缓存
compileorg.grails.plugins:scaffolding
compileorg.grails.plugins:hibernate4
compileorg.hibernate:hibernate- ehcache
consoleorg.grails:grails-console
profileorg.grails.profiles:web
runtimecom.bertramlabs.plugins:asset-pipeline-grails:2.8。 2
runtimecom.h2database:h2
testCompileorg.grails:grails-plugin-testing
testCompileorg.grails.plugins:geb
testRuntime org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1
testRuntimenet.sourceforge.html单元:htmlunit:2.18
资产{
minifyJs = true
minifyCss = true
}
有人帮我吗? ?感谢。
我最近在 GRAILS 3.x
版。您可以按照这些程序来解决这个问题。
第1步 停止你的应用程序由 第2步 然后将GRAILS默认http'8080'端口更改为任何海关端口,如'8090'。要改变默认端口,你应该去 grails-app [main] - > conf - > application.yml 在 第3步 需要code> stop-app I'm trying to run a project in grails 3.1.11 but i've a error. FAILURE: Build failed with an exception. What went wrong:
Execution failed for task ':bootRun'. Process 'command 'C:\Program Files\Java\jdk1.8.0_111\bin\java.exe'' finished with non-zero exit value 1 Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Caused by: java.net.BindException: Address already in use: bind at
sun.nio.ch.Net.bind0(Native Method) at
sun.nio.ch.Net.bind(Net.java:433) at
sun.nio.ch.Net.bind(Net.java:425) This is my build.gradle Anyone to help me?? Thanks. I recently faced such problem in Step 1 Stop your application by Step 2 Then change the GRAILS default http '8080' port to any customs port, like '8090'. For changing default port you should go grails-app[main]--> conf-->application.yml In Step 3 Then run your application by Here, 这篇关于Grails 3.x失败bootRun的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
stop-app
命令在cmd中或通过 stop <-c $ c>命令替换
run-app
$ b $通过'编辑配置'窗口b
application.yml
文件中,您只需保留此文件的所有代码即可。
服务器:
端口:8090
run-app code>命令通过'编辑配置'窗口或cmd替换
命令,因为应用程序使用默认环境缓存了以前的命令。当你改变一些东西时,它在应用中没有任何意义。所以,通过停止应用程序命令它会杀死所有先前的进程,擦除缓存。 stop-app
命令
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
}
GRAILS 3.x
version. You can overcome this problem by following these procedures.stop-app
command in cmd or replace run-app
command by stop-app
command through 'edit configuration' window
application.yml
file you just keep this under all the code of this file.server:
port: 8090
run-app
command replacing stop-app
command through 'edit configuration' window or cmdstop-app
command is needed because application cached the previous command with default environment. When you change something then it doesn't make any sense in application. So, by "stop-app" command it kills all previous process, erases cached.