Problem solved, see my comment above
add the tomcat as external jar in the eclipse project build path and delete the "target" folder in the project
Frage
I am new to grails and was following the trail by setting up a simple application with a helloWorld-Controller. After doing create-app
and opening the interactive console, I am running into the following problem.
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>
I tried grails clean
and grails refresh-dependencies compile
but the error is still popping up.
The full stacktrace goes on a little more but there seems to be nothing significant in there.
There is more than one tomcat on my system, but as far as I can see grails uses a bundled tomcat.
Can anyone tell why javac
fails? After all, it is a fresh install and it didn't do much yet except for loading dependencies.
Lösung
Problem solved, see my comment above
add the tomcat as external jar in the eclipse project build path and delete the "target" folder in the project