Collin Aranha
asked on
Context-root is set to '/' when deployed on any created server other than default-server [WildFly 12]
Hi,
I am facing a very strange issue. Currently, I have upgraded to WildFly 12. I have a test war file which is to be deployed on the server: secure-server and virtual-host: secure-host
I deploy my war file but I see the following log
INFO [org.wildfly.extension.und ertow] (ServerService Thread Pool -- 73) WFLYUT0021: Registered web context: '/' for server 'secure-server'
the context root is '/'
when I check the CLI I find the following
[domain@169.254.0.4:9990 /] /host=master/server=master -server/de ployment=t est_help.w ar/subsyst em=underto w:read-res ource
{
"outcome" => "success",
"result" => {
"context-root" => "/test_help",
"server" => "secure-server",
"virtual-host" => "secure-host",
"servlet" => {"equinoxbridgeservlet" => undefined},
"websocket" => undefined
}
}
The jboss-web.xml has the following:
<jboss-web>
<server-instance>secure-se rver</serv er-instanc e>
<virtual-host>secure-host< /virtual-h ost>
</jboss-web>
When I change the configuration and load it in the default-server and default-host the context root is fine.
INFO [org.wildfly.extension.und ertow] (ServerService Thread Pool -- 75) WFLYUT0021: Registered web context: '/test_help' for server 'default-server'
What would be wrong in the configuration?
I am facing a very strange issue. Currently, I have upgraded to WildFly 12. I have a test war file which is to be deployed on the server: secure-server and virtual-host: secure-host
I deploy my war file but I see the following log
INFO [org.wildfly.extension.und
the context root is '/'
when I check the CLI I find the following
[domain@169.254.0.4:9990 /] /host=master/server=master
{
"outcome" => "success",
"result" => {
"context-root" => "/test_help",
"server" => "secure-server",
"virtual-host" => "secure-host",
"servlet" => {"equinoxbridgeservlet" => undefined},
"websocket" => undefined
}
}
The jboss-web.xml has the following:
<jboss-web>
<server-instance>secure-se
<virtual-host>secure-host<
</jboss-web>
When I change the configuration and load it in the default-server and default-host the context root is fine.
INFO [org.wildfly.extension.und
What would be wrong in the configuration?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I do not see a solution... the context is wrong even with correct settings (server instance and host) in the jboss-web.xml
ASKER
When debugged in the code of org/wildfly/extension/unde
/*
This is to address WFLY-1894 but should probably be moved to some other place.
*/
private String resolveContextPath() {
if (deploymentName.equals(hos
return "/";
} else {
return contextPath;
}
}
So if the default web module is specified then the context-root gets set to "/" due to this my configuration was not working.