Spring应用程序的Tomcat配置
我已经构建了在 Tomcat 中使用的 Web 应用程序。这取决于春天。我在尝试访问它时遇到以下异常:
java.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader)
我阅读了tomcat文档,发现我需要配置安全性。我将以下几行添加到
“/usr/share/tomcat/conf/catalina.policy”:
grant codeBase "file:${catalina.home}/webapps/MyProject/-" {
permission java.lang.RuntimePermission;
};
但这没有帮助。要补充的是,我通过粘贴以下命令安装了Tomcat:
sudo apt-get install tomcat6
cd /usr/share/tomcat6
sudo ln -s /var/lib/tomcat6/conf conf
sudo ln -s /etc/tomcat6/policy.d/03catalina.policy conf/catalina.policy
sudo ln -s /var/log/tomcat6 log
sudo chmod -R 777 /usr/share/tomcat6/conf
我已重新启动服务器。该项目存在于指定位置。
我做错了什么?
我真的很想在服务器上修改尽可能少的东西,而不将额外的 jar 复制到服务器 lib 文件夹中。
我的
Tomcat 版本 = Apache Tomcat/6.0.20
Spring 版本 = 3.0.1.RELEASE
堆栈跟踪太大,无法在此处发布,因此请按照 链接即可查看。
有人可以帮助我吗?补充一下,它在我的 Apache Geronimo 上毫无异常地执行。
I have built web application for use in Tomcat. It depends on Spring. I have the following exception when trying to access it:
java.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader)
I read tomcat docs, and found that I need to configure security. I added following lines to
"/usr/share/tomcat/conf/catalina.policy":
grant codeBase "file:${catalina.home}/webapps/MyProject/-" {
permission java.lang.RuntimePermission;
};
But it didn't help. To add, I installed Tomcat by pasting following commands:
sudo apt-get install tomcat6
cd /usr/share/tomcat6
sudo ln -s /var/lib/tomcat6/conf conf
sudo ln -s /etc/tomcat6/policy.d/03catalina.policy conf/catalina.policy
sudo ln -s /var/log/tomcat6 log
sudo chmod -R 777 /usr/share/tomcat6/conf
I have restarted server. The project exist in specified location.
What am I doing wrong?
I would really like to modify as few things on server as it is possible, without copying additional jars into servers lib folder.
My
Tomcat version = Apache Tomcat/6.0.20
Spring version = 3.0.1.RELEASE
The stack trace is too big to post it here, so please, follow link to see it.
Can anybody help me? To add, it is executed without exceptions on my Apache Geronimo.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不会使用这些符号链接。相反,我会部署在 $CATALINA_BASE/webapps(查看 /etc/init.d/tomcat6)。然后在策略文件(/etc/tomcat6/policy.d/03catalina.policy)中:
另一个选项可以编辑/etc/tomcat6/policy.d/04webapps.policy。
前一段时间这对我有用。
问候。
I wouldn't use those symbolic links. Instead I would deploy at $CATALINA_BASE/webapps (check out /etc/init.d/tomcat6). Then in the policy file (/etc/tomcat6/policy.d/03catalina.policy):
Another option can be editing /etc/tomcat6/policy.d/04webapps.policy.
That worked for me some time ago.
Regards.