You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

已部署至WildFly 9.x仍遇404错误,求解决方案

Troubleshooting WildFly 9.x 404 Error After Successful Deployment

Hey there, let’s work through this 404 issue step by step—since you’ve confirmed deployment is successful via logs and screenshots, the problem is almost certainly tied to how you’re accessing the app or a small configuration detail you might have missed. Here are the most common fixes to check:

  • Double-check your context root
    WildFly uses a context root to route requests to your application. By default, this is usually the name of your WAR file (without the .war suffix), but if you set a custom root in jboss-web.xml or your project’s deployment settings, that’s the path you need to use.

    • To confirm: Look for a line in your WildFly console logs like Registered web context: /your-app-context—append this to your base URL (e.g., http://localhost:8080/your-app-context).
    • In Eclipse, you can also verify this by checking your project properties under Deployment Assembly or WildFly Deployment Settings.
  • Verify your servlet or resource mapping
    If your HelloWorld app uses servlets, make sure the url-pattern in web.xml (or annotation-based mapping like @WebServlet) matches what you’re accessing.

    • For example, if your servlet is annotated with @WebServlet("/hello"), your full request URL should be http://localhost:8080/your-app-context/hello.
    • If you’re using web.xml, check the <servlet-mapping> section to confirm the pattern aligns with your request.
  • Watch for case sensitivity and typos
    WildFly is case-sensitive when handling URLs—so /Hello is not the same as /hello. Triple-check that every part of your request URL matches exactly what’s configured in your app.

  • Confirm the correct port is being used
    By default, WildFly uses port 8080 for HTTP, but if you modified standalone.xml or domain.xml to use a different port, you need to include it in your URL. Look for a log line like HttpListener started to confirm the active port number.

  • Check for a default root resource
    If you’re trying to access the app’s root URL (e.g., http://localhost:8080/your-app-context directly), make sure there’s an index.html, index.jsp, or a servlet mapped to / (the root path). Without a default resource at the root, you’ll get a 404 even if the app is deployed.

  • Inspect the deployed content
    Navigate to WildFly’s deployment directory (typically wildfly-9.x/standalone/deployments/) and check if your WAR file is expanded into a folder. Inside that folder, confirm your static files (HTML/JSP) are in the root of the WAR, and compiled classes are in WEB-INF/classes—missing or misplaced files can cause 404s even with a successful deployment log.

From my experience, the context root mismatch or incorrect servlet mapping are the top two culprits here. Start with those checks first—they’re easy to overlook but fix most cases of this issue!

内容的提问来源于stack exchange,提问作者Dan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 08:06:07