我为Tomcat编写了一个Grails Web应用程序,它打开并读取./data/transactions/foobar上的Berkeley DB。
这段代码在我的Eclipse环境中运行良好。
但是当我将其移动到服务器时,它会抛出此异常。我不确定在将Grails部署为WAR文件作为Web应用程序时,服务器上的当前工作目录在哪里。
我的Linux服务器上Tomcat的安装目录是/usr/share/tomcat6。Web应用的根目录是/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服务器显示的错误信息:
这段代码在我的Eclipse环境中运行良好。
但是当我将其移动到服务器时,它会抛出此异常。我不确定在将Grails部署为WAR文件作为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.
我的Linux服务器上Tomcat的安装目录是/usr/share/tomcat6。Web应用的根目录是/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 log files in the environment directory. Environment is invalid and must be closed.
Servlet:Grails
URI:/bridge/grails/generateEmiDigests/index.dispatch
意思是“使用Grails作为Servlet并通过URI /bridge/grails/generateEmiDigests/index.dispatch访问”。Exception Message: (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.
Caused by: (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.
有什么办法可以设置Tomcat WAR的当前工作目录,以便它能够找到Berkeley DB ./data/transaction文件?还有什么办法可以找出我的Grails应用程序启动时当前的工作目录?