简体   繁体   English

403在Tomcat 7.0.52中拒绝访问指定的URL

[英]403 Access denied to specified url in Tomcat 7.0.52

I have recently migrated the tomcat server from 7.0.49 to 7.0.52 . 我最近将tomcat服务器从7.0.49迁移到了7.0.52 In tomcat it contains 2 web apps which was working earlier, after migrating to this version I am facing 403 Access denied to specified url . 在tomcat中,它包含2个早期工作的Web应用程序,迁移到此版本后,我面临403访问被拒绝指定的URL

On this whenever we try it out for first time on a browser or a tab facing the 403 error but when we refresh the page, it is redirecting to login page. 每当我们第一次在浏览器或面向403错误的选项卡上尝试时,但是当我们刷新页面时,它会重定向到登录页面。

One more thing I would like to add here is only one application is resulting with this 403 error. 我想在这里添加的另一件事是只有一个应用程序导致403错误。 So I tried to compare with Tomcat config files on both versions and verified there is no change exception version specific changes. 所以我尝试在两个版本上与Tomcat配置文件进行比较,并验证没有更改异常版本的具体更改。

Adding more debugging points on this issue, On web.xml there the role is been defined, so tried Commenting it out. 在这个问题上添加更多调试点,在web.xml上已经定义了角色,因此尝试将其注释掉。 it's getting redirected to Login Page. 它被重定向到登录页面。

Can any one please share ideas on this issues. 任何人都可以就这个问题分享想法。

Try clearing browser cache before doing first request. 在第一次请求之前尝试清除浏览器缓存。 Maybe application which gives 403 uses some authoriztion cookie (like sso cookie or possibbly jsessionid). 也许给出403的应用程序使用一些授权cookie(如sso cookie或者可能jsessionid)。 This cookie can be significant. 这个cookie可能很重要。 If this is the case than after clearing cookies you should be directed to login page directly. 如果是这种情况,则清除cookie后,您应直接进入登录页面。

This would explain why one application works and another not (some state on client browser can be held) 这可以解释为什么一个应用程序正常工作而另一个应用程序无法工作(可以保存客户端浏

Maybe the strategy how sessions are passivated has been changed between 7.0.49 and 7.0.52. 也许会话被钝化的策略在7.0.49和7.0.52之间已经改变。

Try to delete all passivated sessions. 尝试删除所有钝化的会话。

I faced similar problems in the past when I started to use same Tomcat version. 当我开始使用相同的Tomcat版本时,我在过去遇到过类似的问题。

If I recall correctly, there was some misconception between Tomcat and Servlet spec leading to some servlets starting twice. 如果我没记错的话,Tomcat和Servlet规范之间存在一些误解,导致一些servlet重启两次。 You can read a little more here . 你可以在这里阅读更多内容。

Anyway, what I always worked for me is add metadata-complete="true" in web-app element in web.xml . 无论如何,我一直在为我工作的是在web.xml中的web-app元素中添加metadata-complete="true" This is a pity, in my opinion, as I use Java only configuration, and I must keep this file only for this. 在我看来,这是一个遗憾,因为我只使用Java配置,我必须保留此文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM