【问题标题】:WildFly 10.x always getting HTTP error 403: forbiddenWildFly 10.x 总是收到 HTTP 错误 403:禁止
【发布时间】:2017-05-26 00:01:19
【问题描述】:

我开始了解 JSF,因此我尝试运行一个 hello world xhtml 站点。问题:在浏览器中访问网站时,我总是收到 HTTP 错误代码 403:禁止。

我正在使用 eclipse neon 和 WildFly Server v10。我使用 Eclipse 中的 JBoss Tools 插件进行部署。我总是使用默认配置。服务器的日志没有显示任何错误,应该正确部署站点:

09:50:23,999 INFO  [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBossWS 5.1.5.Final (Apache CXF 3.1.6) 
09:50:24,297 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
09:50:24,299 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.fabric.jdbc.FabricMySQLDriver (version 5.1)
09:50:24,315 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0018: Started Driver service with driver-name = mysql-connector-java-5.1.40-bin.jar_com.mysql.jdbc.Driver_5_1
09:50:24,315 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0018: Started Driver service with driver-name = mysql-connector-java-5.1.40-bin.jar_com.mysql.fabric.jdbc.FabricMySQLDriver_5_1
09:50:24,318 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) WFLYJCA0001: Bound data source [java:jboss/datasources/university]
09:50:24,551 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 60) Mojarra 2.2.13.SP1 20160303-1204 für Kontext '/HelloWorldJSF' wird initialisiert.
09:50:24,551 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 65) Mojarra 2.2.13.SP1 20160303-1204 für Kontext '/HelloWorld' wird initialisiert.
09:50:25,034 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 60) WFLYUT0021: Registered web context: /HelloWorldJSF
09:50:25,034 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 65) WFLYUT0021: Registered web context: /HelloWorld
09:50:25,060 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "mysql-connector-java-5.1.40-bin.jar" (runtime-name : "mysql-connector-java-5.1.40-bin.jar")
09:50:25,061 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "HelloWorldJSF.war" (runtime-name : "HelloWorldJSF.war")
09:50:25,061 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "HelloWorld.war" (runtime-name : "HelloWorld.war")
09:50:25,159 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
09:50:25,160 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
09:50:25,160 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started in 3828ms - Started 521 of 783 services (424 services are lazy, passive or on-demand)

网站部署到:

C:\wildfly-10.1.0.Final\standalone\deployments

我实际上使用了两个网络项目。我自己创建了一个,另一个直接从教程中获取。教程没有说任何关于额外配置的内容。我错过了什么?

【问题讨论】:

  • 您要访问的 URL 是什么?
  • 我打电话给localhost:8080/HelloWorldJSF 或localhost:8080/HelloWorld 也尝试过其他人,但后来我收到错误 404 - 未找到。
  • 感谢您的帮助!欣赏它!但我只是重新安装了所有东西,现在它可以工作了。

标签: java eclipse jboss jsf-2.2 wildfly-10


【解决方案1】:

确保您尝试的网址是以下网址之一:

http://localhost:8080/JavaServerFaces/hello.jsf
http://localhost:8080/JavaServerFaces/hello.faces
http://localhost:8080/JavaServerFaces/hello.xhtml
http://localhost:8080/JavaServerFaces/faces/hello.jsf

【讨论】:

  • 尝试了所有的,每一个都给了我错误 404。部署描述符有这个映射: Faces Servlet/faces/**.jsf
  • @LaoTse 抱歉,我的意思是不仅要尝试以上下文路径结尾的 url,还要尝试之后的完整路径。因此,对于您的上下文,对于上述所有其他路径,它将是 (localhost:8080/HelloWorldJSF/faces/hello.jsf) 等等。
  • 好的,我试过了,现在我不再收到错误 403,而是一个错误处理请求通知我 ServletException。但实际上我不能说这个错误有什么问题:错误处理请求上下文路径:/HelloWorldJSF Servlet 路径:/HelloWorld.jsf 路径信息:空查询字符串:空堆栈跟踪 javax.servlet.ServletException javax.faces.webapp.FacesServlet。服务(FacesServlet.java:671) io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
  • 感谢您的帮助!欣赏它!但我只是重新安装了所有东西,现在它可以工作了。
猜你喜欢
  • 2011-07-12
  • 1970-01-01
  • 2018-01-14
  • 1970-01-01
  • 2021-04-08
  • 1970-01-01
  • 2022-10-16
  • 1970-01-01
  • 2016-06-20
相关资源
最近更新 更多