2014-12-19 120 views
3

我有一個Grails(2.3.6)應用程序需要部署在Tomcat服務器中以供遠程用戶訪問。使用WAR文件在Tomcat服務器中部署Grails應用程序失敗

現在我們有在Grails中運行的本地服務器,並且這一切都很好。現在在Tomcat中部署它的目的是通過WAR文件來完成。這樣我們的源文件就不會進入遠程服務器。

因此,作爲第一步,我創建使用命令我的應用程序的WAR文件:

grails prod war 

這創造在項目根目錄WAR文件。

Tomcat版本我現在用的就是:

apache-tomcat-7.0.57 

我去Apache的Tomcat的7.0.57 \ conf文件夾和編輯server.xml文件。

<Connector port="8181" protocol="HTTP/1.1" 
      connectionTimeout="20000" 
      redirectPort="8443" /> 
<!-- A "Connector" using the shared thread pool--> 
<!-- 
<Connector executor="tomcatThreadPool" 
      port="8181" protocol="HTTP/1.1" 
      connectionTimeout="20000" 
      redirectPort="8443" /> 
--> 

我在這裏做的唯一改變就是放一個新的端口。

而在我放置WAR文件的apache-tomcat-7.0.57 \ webapps文件夾中。

TDProxyServer-1.2.5.war 

,我跑了的startup.bat文件中的apache-tomcat的-7.0.57 \ bin中

現在,這創造了一個的webapps TDProxyServer-1.2.5的文件夾。

現在到瀏覽器,鍵入的網址:

http://localhost:8181/TDProxyServer-1.2.5/ 

基本上,它會彈出一個空白頁。我查看文件夾apache-tomcat-7.0.57 \ webapps \ TDProxyServer-1.2.5並查看以下文件夾。

css 
extensions 
images 
js 
META-INF 
plugins 
WEB-INF 

這是我第一次在Tomcat中部署,不知道這裏做了什麼錯誤。

任何人都可以指導我完成在Tomcat服務器中部署Grails WAR文件的過程嗎?

我很欣賞你對此的最早迴應。

更新時間:

我每有什麼傑夫建議嘗試和不工作。

我打開Tomcat管理和看到的部署與消息失敗:

Message: FAIL - Application at context path /TDProxyServer-1.2.5 could not be started 

啓動Tomcat服務器時,我沒有看到任何錯誤消息。

更新

cfrick的建議,我看了一下日誌文件中的apache-tomcat的-7.0.57 \ logs目錄。

此目錄中有5個日誌文件。

catalina.2014-12-19 
host-manager.2014-12-19 
localhost.2014-12-19 
localhost_access_log.2014-12-19 
manager.2014-12-19 

當我第一次啓動Tomcat服務器,該catalina.2014-12-19.log有大約在啓動過程中的所有信息,並有在這一點上的startup.bat在控制檯窗口打印以下錯誤消息。

INFO: Deploying web application archive C:\Users\me\Downloads\apache-tomcat-7. 
0.57-windows-x64\apache-tomcat-7.0.57\webapps\TDProxyServer-1.2.5.war 
Dec 19, 2014 11:36:51 AM org.apache.catalina.core.StandardContext startInternal 
SEVERE: Error listenerStart 
Dec 19, 2014 11:36:51 AM org.apache.catalina.core.StandardContext startInternal 
SEVERE: Context [/TDProxyServer-1.2.5] startup failed due to previous errors 
Dec 19, 2014 11:36:51 AM org.apache.catalina.startup.HostConfig deployWAR 
INFO: Deployment of web application archive C:\Users\me\Downloads\apache-tomca 
t-7.0.57-windows-x64\apache-tomcat-7.0.57\webapps\TDProxyServer-1.2.5.war has finishe 
d in 39,295 ms 

現在我去Tomcat管理器,看到TDProxyServer-1.2.5仍然沒有被啓動,開始按鈕激活。

我點擊開始按鈕,它會將日誌消息添加到localhost.2014-12-19.log文件中,並帶有一些Java異常。

請參閱下面的日誌文件的內容。這似乎是在抱怨拋出java.lang.ClassNotFoundException

Dec 19, 2014 10:49:58 AM org.apache.catalina.core.StandardContext listenerStart 
SEVERE: Error configuring application listener of class org.codehaus.groovy.grails.plugins.log4j.web.util.Log4jConfigListener 
java.lang.ClassNotFoundException: org.codehaus.groovy.grails.plugins.log4j.web.util.Log4jConfigListener 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) 
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506) 
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488) 
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115) 
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4909) 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) 
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) 
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) 
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081) 
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:744) 

Dec 19, 2014 10:49:58 AM org.apache.catalina.core.StandardContext listenerStart 
SEVERE: Error configuring application listener of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener 
java.lang.ClassNotFoundException: org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) 
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506) 
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488) 
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115) 
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4909) 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) 
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) 
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) 
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081) 
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:744) 

Dec 19, 2014 10:49:58 AM org.apache.catalina.core.StandardContext listenerStart 
SEVERE: Skipped installing application listeners due to previous error(s) 
Dec 19, 2014 10:49:59 AM org.apache.catalina.core.ApplicationContext log 
INFO: ContextListener: contextInitialized() 
Dec 19, 2014 10:49:59 AM org.apache.catalina.core.ApplicationContext log 
INFO: SessionListener: contextInitialized() 
Dec 19, 2014 10:49:59 AM org.apache.catalina.core.ApplicationContext log 
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', '[email protected]') 
Dec 19, 2014 10:51:06 AM org.apache.catalina.core.StandardContext listenerStart 
SEVERE: Error configuring application listener of class org.codehaus.groovy.grails.plugins.log4j.web.util.Log4jConfigListener 
java.lang.ClassNotFoundException: org.codehaus.groovy.grails.plugins.log4j.web.util.Log4jConfigListener 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) 
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506) 
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488) 
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115) 
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4909) 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1286) 
    at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:694) 
    at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:217) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 
    at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:612) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) 
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) 
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) 
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) 
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466) 
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) 
    at java.lang.Thread.run(Thread.java:744) 

Dec 19, 2014 10:51:06 AM org.apache.catalina.core.StandardContext listenerStart 
SEVERE: Error configuring application listener of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener 
java.lang.ClassNotFoundException: org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) 
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506) 
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488) 
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115) 
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4909) 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1286) 
    at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:694) 
    at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:217) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 
    at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:612) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) 
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) 
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) 
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) 
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466) 
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) 
    at java.lang.Thread.run(Thread.java:744) 

Dec 19, 2014 10:51:06 AM org.apache.catalina.core.StandardContext listenerStart 
SEVERE: Skipped installing application listeners due to previous error(s) 
+0

很難在沒有看到您的應用和配置的情況下確切地說出發生了什麼,但我在某些Web服務器中看到了默認頁面中的報告未找到。 https://jira.grails.org/browse/GRAILS-8767。你有沒有嘗試爲你的索引頁面添加一個默認的映射? – 2014-12-19 00:21:56

+0

檢查日誌。在此之前FAIL消息將是一個或另一個堆棧跟蹤。 – cfrick 2014-12-19 13:09:04

回答

1

一對夫婦的事情,你應該檢查:

Config.groovy確保在生產環境

grails.serverURL = "http://localhost:8181/TDProxyServer-1.2.5" 

UrlMappings.groovy還要檢查/映射到有效資源(控制器操作或GSP)。

+0

我確信這些事情都照顧好了。我仍然得到相同的錯誤 '2014年12月19日下午12時19分23秒org.apache.catalina.core.StandardContext startInternal SEVERE:錯誤listenerStart 2014年12月19日下午12時19分23秒org.apache.catalina。 core.StandardContext startInternal SEVERE:上下文[/TDProxyServer-1.2.5]啓動失敗,由於以前的錯誤' 它看起來像一個問題,無法啓動LISTNERS。 – donguy76 2014-12-19 18:35:23

相關問題