gpt4 book ai didi

tomcat - Grails 编译错误 - "package does not exist"

转载 作者:行者123 更新时间:2023-11-28 23:39:26 25 4
gpt4 key购买 nike

我是 grails 的新手,正在通过使用 helloWorld-Controller 设置一个简单的应用程序来跟踪。在执行 create-app 并打开交互式控制台后,我遇到了以下问题。

grails> create-controller projects | Compiling 10 source files. | Error Compilation error: startup failed: Compile error during compilation with javac. C:\dev\grails-2.3.5\timespent\target\work\plugins\tomcat-7.0.50\src\java\org\grails\plugins\tomcat\TomcatKillSwitch.java:3: error: package org.apache.catalina does not exist

import org.apache.catalina.LifecycleException;
^
C:\dev\grails-2.3.5\timespent\target\work\plugins\tomcat-7.0.50\src\java\org\grails\plugins\tomcat\TomcatKillSwitch.java:4: error: package org.apache.catalina.startup does not exist
import org.apache.catalina.startup.Tomcat;
^
C:\dev\grails-2.3.5\timespent\target\work\plugins\tomcat-7.0.50\src\java\org\grails\plugins\tomcat\TomcatKillSwitch.java:19: error: cannot find symbol
private Tomcat tomcat;
^
symbol: class Tomcat
location: class TomcatKillSwitch
C:\dev\grails-2.3.5\timespent\target\work\plugins\tomcat-7.0.50\src\java\org\grails\plugins\tomcat\TomcatKillSwitch.java:22: error: cannot find symbol
public TomcatKillSwitch(Tomcat tomcat, int serverPort) {
^
symbol: class Tomcat
location: class TomcatKillSwitch
C:\dev\grails-2.3.5\timespent\target\work\plugins\tomcat-7.0.50\src\java\org\grails\plugins\tomcat\TomcatKillSwitch.java:43: error: cannot find symbol
} catch (LifecycleException e) {
^
symbol: class LifecycleException
location: class TomcatKillSwitch
5 errors


1 error | Error Error running script create-controller projects: org.codehaus.groovy.grails.cli.ScriptExitException (Use --stacktrace to see the full trace) grails>

我尝试了 grails cleangrails refresh-dependencies compile 但错误仍然出现。

完整的堆栈跟踪继续了一点,但似乎没有什么重要的。

我的系统上有不止一个 tomcat,但据我所知,grails 使用的是捆绑的 tomcat。

谁能说出 javac 失败的原因?毕竟,这是一个全新的安装,除了加载依赖项之外,它并没有做太多事情。

最佳答案

问题解决了,看我上面的评论

add the tomcat as external jar in the eclipse project build path and delete the "target" folder in the project

关于tomcat - Grails 编译错误 - "package does not exist",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21378229/

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