问题
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/webappWEB-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