Tomcat 6 无法在 Ubuntu Karmic 上启动我的应用程序,该应用程序在 Lucid 上完美运行
我在 Ubuntu Karmic 上使用 Tomcat 6 时遇到一些问题。它不会启动因各种错误而失败的应用程序。
第一个是:
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission spring.security.strategy read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:342)
at java.security.AccessController.checkPermission(AccessController.java:553)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302)
at java.lang.System.getProperty(System.java:669)
at org.springframework.security.core.context.SecurityContextHolder.<clinit>(SecurityContextHolder.java:53)
... 54 more
这很奇怪,因为同一个应用程序在 Lucid 上的 Tomcat 6 上运行得很好。策略配置文件是一样的,我查了一下。当我向 conf/policy.d/04webapps.policy
文件添加权限时:
permission java.util.PropertyPermission "spring.security.strategy", "read";
它会失败并显示 NoClassDefFoundError:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
While cglib is in the lib directory of the war
请帮忙,我找不到任何线索的原因。
I am having some issues with Tomcat 6 on Ubuntu Karmic. It doesn't start the app failing with various errors.
The first on is:
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission spring.security.strategy read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:342)
at java.security.AccessController.checkPermission(AccessController.java:553)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302)
at java.lang.System.getProperty(System.java:669)
at org.springframework.security.core.context.SecurityContextHolder.<clinit>(SecurityContextHolder.java:53)
... 54 more
This is weird, because the very same app runs on Tomcat 6 on Lucid very well. The policy configuration file is the same, I checked. When I add the permission to the conf/policy.d/04webapps.policy
file:
permission java.util.PropertyPermission "spring.security.strategy", "read";
it then fails with NoClassDefFoundError:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer
Though cglib is in the lib directory of the war
Please help, I can't find any clue on the reason of this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我现在明白了。默认情况下,Lucid tomcat 在没有安全管理器的情况下运行。默认情况下,Karmic 安全管理器处于启用状态。如果启用,您需要根据您的应用程序需求对其进行微调。
Ok, I got it now. By default, in Lucid tomcat runs without a security manager. By default in Karmic security manager is enabled. If it is enabled, you need to fine-tune it for your application needs.