azdonald
azdonald

Reputation: 336

404 error when I redeploy a war on Wildfly

I tried to deploy a war file on Wildfly (commandline) by changing the name of the old file (say app.war to appOld.war) and copying a new file with the name app.war to the deployment folder. On my other terminal, I can see the auto deploy scanner running and deploying the new file but when I try to access the app via URL, I get a 404. No error shows up in the logs so I don't realize what is happening or what to do.

Thanks.

Upvotes: 1

Views: 494

Answers (1)

Kiki
Kiki

Reputation: 2253

I think there is problem with your context root.

Because if you don’t set context root wildfly takes filename as your context root.

When you deploy file you just renamed try access <hostname>:<port>/appOld instead of <hostname>:<port>/app

Context root can be manually set set in /WEB-INF/jboss-web.xml

Here is the example of jboss-web.xml whit context root:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <context-root>/my-web-app</context-root>
</jboss-web>

So when you set it you should be able to access yout app at: <hostname>:<port>/my-web-app

Hope it helps.

Upvotes: 1

Related Questions