Jetty returning 403 Forbidden

∥☆過路亽.° 提交于 2019-12-23 14:02:07

问题


Hi I am porting my web app from tomcat to Jetty. I am using the Jetty runner to launch it. I am using the following command to launch Jetty:

java -jar jetty-runner.jar --port --path url-path path-to-war

However when I try to browse to the from the browser I get the following error:

HTTP ERROR 403

Problem accessing . Reason:

Forbidden

In the logs i see the following Warning:

WARN:oejs.SecurityHandler:No authenticator for: {RoleInfo,C[*, all_auth_users]}

I am trying to use Jetty out of the box and haven't customized any config anywhere. Is there any additional configuration required to make this work?


回答1:


Likely cause: your war/webapp has security constraints defined, but you haven't specified what authentication type to use on the server side.

Either:

  • Remove your <security-constraint> in your war/webapp WEB-INF/web.xml file. or..
  • Add an Authentication scheme on the server side. Look at etc/jetty-testrealm.xml for an example using the HashLoginService authenticator.



回答2:


In my case I forget that paste the index.html example page. Its all.



来源:https://stackoverflow.com/questions/15142962/jetty-returning-403-forbidden

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!