小编rle*_*lee的帖子

如何获取Grails/Tomcat Webapp的当前工作目录?

我为Tomcat写了一个Grails webapp,它打开并从./data/transactions/foobar上的Berkeley DB中读取.

这个代码在我的Eclipse环境中运行良好.

但是当我将它移动到服务器时,它会吐出这个异常.当我将WAR文件中的Grails部署为服务器上的webapps Web应用程序时,我不确定当前工作目录的位置.

com.sleepycat.je.EnvironmentNotFoundException: (JE 4.1.10) ./data/transactions/Foobar
Home directory: ./data/transactions/Foobar ENV_NOT_FOUND: 
EnvironmentConfig.setAllowCreate is false so environment creation is not permitted, but there are no log files in the environment directory. Environment is invalid and must be closed.
Run Code Online (Sandbox Code Playgroud)

Linux服务器上的我的Tomcat安装目录是/ usr/share/tomcat6.webapps root目录是/ usr/share/tomcat6/webapps.我们的WAR目录安装在名为"bridge"的子目录中.我的Grails应用程序的WAR路径位于/ usr/share/tomcat6/webapps/bridge中

我尝试将./data/transaction/Foobar放在/ usr/share/tomcat6/webapps和/ usr/share/tomcat6/webapps/bridge中,没有运气.

我也尝试将./data/transaction/Foobar放入/ usr/share/tomcat6安装基目录,也没有运气.

以下是我从Tomcat服务器看到的错误:

Error 500: Executing action [index] of controller[com.ecmhp.ecmdatabridge.generators.GenerateEmiDigestsController] 
caused exception: (JE 4.1.10) ./data/transactions/Foobar 
    Home directory: ./data/transactions/Foobar ENV_NOT_FOUND: 
    EnvironmentConfig.setAllowCreate is false so environment creation is not permitted, but there are no …
Run Code Online (Sandbox Code Playgroud)

grails tomcat working-directory

5
推荐指数
2
解决办法
5538
查看次数

标签 统计

grails ×1

tomcat ×1

working-directory ×1