无法在Grails上运行应用程序 [英] Can't run-app on Grails

查看:121
本文介绍了无法在Grails上运行应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了Groovy 2.0.1和Grails 2.1.0。



按照如何创建一个简单的Hello World Web应用程序的说明:



http://grails.org /doc/latest/guide/gettingStarted.html#creatingAnApplication



当我尝试运行该应用程序时,出现以下错误:



grails> run-app

  | 
编译113个源文件
注意:某些输入文件使用未经检查或不安全的操作。
注意:使用-Xlint重新编译:取消选中以获取详细信息。
|运行Grails应用程序
|错误2012-07-27 17:05:41,773 [pool-4-thread-1]错误core.ContainerBase
- 子容器在启动过程中失败
消息:org.apache.catalina.LifecycleException:Failed启动组件
[StandardEngine [Tomcat] .StandardHost [localhost] .StandardContext [/ helloworld]]
行|方法
- >> 222 | innerGet in java.util.concurrent.FutureTask $ Sync

由LifecycleException引发:无法启动组件
[StandardEngine [Tomcat] .StandardHost [localhost] .StandardContext [/ helloworld]]
- >> 303 | innerRun in java.util.concurrent.FutureTask $ Sync

由NoSuchMethodError引起:
javax.servlet.ServletContext.getSessionCookieConfig()Ljavax / servlet / SessionCookieConfig;
- >> 303 | innerRun in java.util.concurrent.FutureTask $ Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 |在java.util.concurrent.FutureTask
|运行886 | java.util.concurrent.ThreadPoolExecutor中的runTask $ Worker
| 908 |在''
^ 680 |中运行跑 。 。在java.lang.Thread
|中错误2012-07-27 17:05:41,869 [main]错误core.ContainerBase
在启动期间子容器失败

消息:org.apache.catalina.LifecycleException:无法启动组件
[StandardEngine [Tomcat] .StandardHost [localhost]]
行|方法
- >> 222 | innerGet in java.util.concurrent.FutureTask $ Sync
| 83 |获取java.util.concurrent.FutureTask
| 137 | doStart。 in org.grails.plugins.tomcat.InlineExplodedTomcatServer
| 102 |从org.grails.plugins.tomcat.TomcatServer
开始176 | doCall。在RunApp $ _run_closure5_closure12
|中153 |运行应用程序中的doCall $ _run_closure5
| 121 | RunInline RunIn
| 67 |运行应用程序中的doCall $ _run_closure1
^ 33 | doCall。 in''

由LifecycleException引发:无法启动组件
[StandardEngine [Tomcat] .StandardHost [localhost]]
- >> 303 | innerRun in java.util.concurrent.FutureTask $ Sync

| 138 |在java.util.concurrent.FutureTask
|运行886 | runTask。在java.util.concurrent.ThreadPoolExecutor $ Worker
|中908 |在''
^ 680 |中运行跑 。 。 。 in java.lang.Thread

由LifecycleException引发:子容器在启动过程中失败
- >> 303 | innerRun in java.util.concurrent.FutureTask $ Sync

| 138 |在java.util.concurrent.FutureTask
|运行886 | runTask。在java.util.concurrent.ThreadPoolExecutor $ Worker
|中908 |在''
^ 680 |中运行跑 。 。 。在java.lang.Thread
|中错误无法启动组件[StandardServer [-1]]
(注意:堆栈跟踪已被过滤,使用--verbose查看整个跟踪)
org.apache.catalina.LifecycleException:无法启动组件[StandardServer [-1]]

org.grails.plugins.tomcat。
InlineExplodedTomcatServer.doStart(InlineExplodedTomcatServer.groovy:137)
在org.grails.plugins.tomcat.TomcatServer.start(TomcatServer.groovy:102)
在RunApp $ _run_closure5_closure12.doCall(RunApp: (RunApp:153)
在RunApp $ _run_closure5.doCall(RunApp:153)
在RunApp.runInline(RunApp:121)
在RunApp $ _run_closure1.doCall(RunApp:67)
at RunApp $ _run_closure1.doCall(RunApp.groovy:33)
导致:org.apache.catalina.LifecycleException:未能启动组件
[StandardService [Tomcat]]
... 7 more
导致:org.apache.catalina.LifecycleException:未能启动组件
[StandardEngine [Tomcat]]
... 7 more
引起者:org.apache.catalina .LifecycleException:启动期间的子容器失败
... 7 more
|错误服务器无法启动:org.apache.catalina.LifecycleException:无法启动组件[StandardServer [-1]]
|错误错误运行脚本run-app:org.codehaus.groovy.grails.cli.ScriptExitException
(使用--stacktrace查看完整跟踪)

我可能做错了什么?本教程没有指定为任何地方的tomcat设置配置?

你是对的!切换到不同的端口建议不起作用。从CLASSPATH中删除下列罐子后,我工作完美。它在.bash_profile中看起来像这样:

  export CLASSPATH = .:$ TOMCAT_HOME / common / lib / servlet-api.jar : $ TOMCAT_HOME / common / lib目录/ JSP-api.jar文件; 


I just installed Groovy 2.0.1 and Grails 2.1.0.

Was following the instructions on how to create a simple Hello World web app on:

http://grails.org/doc/latest/guide/gettingStarted.html#creatingAnApplication

When I tried to run the app, I got the following error:

grails> run-app

| 
Compiling 113 source files
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
    | Running Grails application
    | Error 2012-07-27 17:05:41,773 [pool-4-thread-1] ERROR core.ContainerBase
      - A child        container failed during start
Message: org.apache.catalina.LifecycleException: Failed to start component
   [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/helloworld]]
    Line | Method
    ->> 222 | innerGet in java.util.concurrent.FutureTask$Sync

Caused by LifecycleException: Failed to start component 
   [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/helloworld]]
    ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync

Caused by NoSuchMethodError:  
 javax.servlet.ServletContext.getSessionCookieConfig()Ljavax/servlet/SessionCookieConfig;
    ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    |   138 | run      in java.util.concurrent.FutureTask
    |   886 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
    |   908 | run      in     ''
 ^   680 | run . .  in java.lang.Thread
    | Error 2012-07-27 17:05:41,869 [main] ERROR core.ContainerBase
    A child container failed during start

   Message: org.apache.catalina.LifecycleException: Failed to start component
  [StandardEngine[Tomcat].StandardHost[localhost]]
  Line | Method
  ->> 222 | innerGet  in java.util.concurrent.FutureTask$Sync
  |    83 | get       in java.util.concurrent.FutureTask
  |   137 | doStart . in org.grails.plugins.tomcat.InlineExplodedTomcatServer
  |   102 | start     in org.grails.plugins.tomcat.TomcatServer
  |   176 | doCall .  in RunApp$_run_closure5_closure12
  |   153 | doCall    in RunApp$_run_closure5
  |   121 | runInline in RunApp
  |    67 | doCall    in RunApp$_run_closure1
  ^    33 | doCall .  in     ''

  Caused by LifecycleException: Failed to start component
  [StandardEngine[Tomcat].StandardHost[localhost]]
  ->> 303 | innerRun  in java.util.concurrent.FutureTask$Sync

  |   138 | run       in java.util.concurrent.FutureTask
  |   886 | runTask . in java.util.concurrent.ThreadPoolExecutor$Worker
  |   908 | run       in     ''
  ^   680 | run . . . in java.lang.Thread

  Caused by LifecycleException: A child container failed during start
  ->> 303 | innerRun  in java.util.concurrent.FutureTask$Sync

  |   138 | run       in java.util.concurrent.FutureTask
  |   886 | runTask . in java.util.concurrent.ThreadPoolExecutor$Worker
  |   908 | run       in     ''
  ^   680 | run . . . in java.lang.Thread
  | Error Failed to start component [StandardServer[-1]] 
   (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
   org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]]
at
   org.grails.plugins.tomcat.
      InlineExplodedTomcatServer.doStart(InlineExplodedTomcatServer.groovy:137)
at org.grails.plugins.tomcat.TomcatServer.start(TomcatServer.groovy:102)
at RunApp$_run_closure5_closure12.doCall(RunApp:176)
at RunApp$_run_closure5.doCall(RunApp:153)
at RunApp.runInline(RunApp:121)
at RunApp$_run_closure1.doCall(RunApp:67)
at RunApp$_run_closure1.doCall(RunApp.groovy:33)
  Caused by: org.apache.catalina.LifecycleException: Failed to start component
  [StandardService[Tomcat]]
... 7 more
  Caused by: org.apache.catalina.LifecycleException: Failed to start component
  [StandardEngine[Tomcat]]
... 7 more
  Caused by: org.apache.catalina.LifecycleException: A child container failed during start
... 7 more
  | Error Server failed to start: org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]]
  | Error Error running script run-app: org.codehaus.groovy.grails.cli.ScriptExitException
  (Use --stacktrace to see the full trace)

What am I possibly doing wrong? This tutorial didn't specify to set up a config for tomcat anywhere?

解决方案

@tomas You were right! The switching to a different port suggestion didn't work. I worked perfectly after removing the following jars from my CLASSPATH. It looked like this in .bash_profile:

export CLASSPATH=.:"$TOMCAT_HOME/common/lib/servlet-api.jar":"$TOMCAT_HOME/common/lib/jsp-api.jar"; 

这篇关于无法在Grails上运行应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆