gpt4 book ai didi

grails - Grails运行应用程序问题ERROR context.ContextLoader

转载 作者:行者123 更新时间:2023-12-02 14:41:30 27 4
gpt4 key购买 nike

当我输入运行命令时,它将引发错误。这是我运行命令时的输出

grails -Dserver.port=8082 run-app

输出:
"C:\Program Files\Java\jdk1.7.0_79\bin\java" -Dgrails.home=C:\grails -Dbase.dir=C:\Supreet\Devs@Work\Source\quick-dining "-Dtools.jar=C:\Program Files\Java\jdk1.7.0_79\lib\tools.jar" -Dgroovy.starter.conf=C:\grails/conf/groovy-starter.conf -Xmx768M -Xms768M -XX:MaxPermSize=256m -XX:PermSize=256m -Djline.WindowsTerminal.directConsole=false -javaagent:C:\grails\lib\org.springframework\springloaded\jars\springloaded-1.2.1.RELEASE.jar -noverify -Dspringloaded=profile=grails -Didea.launcher.port=7537 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.6\bin" -Dfile.encoding=UTF-8 -classpath "C:\grails\lib\org.codehaus.groovy\groovy-all\jars\groovy-all-2.3.7.jar;C:\grails\dist\grails-bootstrap-2.4.4.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 13.1.6\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.groovy.grails.cli.support.GrailsStarter --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf C:\grails/conf/groovy-starter.conf "run-app -plain-output"
|Loading Grails 2.4.4
|Configuring classpath
.
|Environment set to development
.................................
|Packaging Grails application
...........
|Compiling 1 source files
.........................
|Running Grails application
Error |
2015-10-07 21:29:27,074 [localhost-startStop-1] ERROR context.ContextLoader - Context initialization failed
Message: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Error |
2015-10-07 21:29:27,176 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
Message: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Error |
Forked Grails VM exited with error

Process finished with exit code 1

最佳答案

如果applicationContext.xml被删除,您可以很容易地恢复它。使用相同版本的Grails创建一个新的空应用,然后从那里复制文件。这不是应该编辑的文件,所以应该没问题。

如果缺少sitemesh.xml,还复制web-app/WEB-INF/tld的.tld文件。

关于grails - Grails运行应用程序问题ERROR context.ContextLoader,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32997209/

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