2010-04-22 98 views
5

我正在使用war文件在Tomcat 6上部署應用程序。我已經編制由同一臺機器上的供應商提供的源代碼,然後移動war文件到tomcat的{家庭}/webapps /下在部署war文件時無法實例化VelocityEngine

當我啓動應用程序,我看到一個錯誤信息:

The SystemInformationService could not be retrieved from the container. Therefore very limited information is available in this error report. 
The SystemInformationService could not be retrieved due to the following error: java.lang.IllegalStateException: Spring Application context has not been set 
Cause 
java.lang.RuntimeException: Unable to instantiate VelocityEngine! 
    at com.opensymphony.webwork.views.velocity.VelocityManager.newVelocityEngine(VelocityManager.java:333) 

Stack Trace:[hide] 

java.lang.RuntimeException: Unable to instantiate VelocityEngine! 
at com.opensymphony.webwork.views.velocity.VelocityManager.newVelocityEngine(VelocityManager.java:333) 
at com.opensymphony.webwork.views.velocity.VelocityManager.init(VelocityManager.java:146) 
at com.opensymphony.webwork.dispatcher.VelocityResult.doExecute(VelocityResult.java:61) 

我在另一臺機器上執行了相同的步驟並正確安裝。

我不明白錯誤告訴我什麼。

我可以缺少jar文件嗎? (但它編譯得很好)。

我忘了設置環境變量嗎?

我不知道該怎麼做,我不知道VelocityEngine是什麼,或者不知道。

+0

我發現,當我改變server.xml中含有unpackWARs =「真」,現在它工作正常 – 2010-04-22 21:30:19

回答

3

這可能是因爲Velocity的日誌記錄試圖登錄到只讀文件夾,甚至是jar文件。

* create a file "velocity.properties" and place it in the WEB-INF/classes folder. 
* Inside the file, write 

runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogSystem 

(見here的原帖)

+0

奇怪的是我已經部署了這是一個未爆Jboss上的WAR文件,它工作正常。我需要在Tomcat中解壓縮WAR以使其工作。 – 2010-04-29 16:13:26