I have an application that I am trying to deploy to JBoss EAP 6.4. I don't see any errors while deploying the application. However, when I try to access the application with the context root like http://localhost:8080/contextroot/
I am being redirected to http://localhost:8080/contextroot.war-345rdser34dwwe/login.jsp
where contextroot.war-345rdser34dwwe
is a folder created under ${jboss.home}/standalone/tmp/vfs/temp
This is my jboss-deployment-structure.xml
<jboss-deployment-structure> <!-- Make sub deployments isolated by default, so they cannot see each others
classes without a Class-Path entry -->
<ear-subdeployments-isolated>false</ear-subdeployments-isolated> <!-- This corresponds to the top level deployment. For a war this is the
war's module, for an ear --> <!-- This is the top level ear module, which contains all the classes in
the EAR's lib folder -->
<deployment>
<resources>
<resource-root path="WEB-INF/lib/bcprov-jdk16-1.46.jar" use-physical-code-source="true"/>
</resources>
<!-- exclude-subsystem prevents a subsystems deployment unit processors running
on a deployment --> <!-- which gives basically the same effect as removing the subsystem, but
it only affects single deployment -->
<exclusions>
<module name="org.javassist" />
<module name="org.hibernate" />
<module name="org.hibernate.validator" />
<module name="org.jboss.msc" />
<module name="javax.faces.api" />
<module name="com.sun.jsf-impl" />
<module name="org.apache.log4j" />
<module name="org.slf4j" />
<module name="org.slf4j.impl" />
<module name="org.apache.commons.logging" />
<module name="org.jboss.resteasy.resteasy-hibernatevalidator-provider" />
</exclusions>
<!-- This allows you to define additional dependencies, it is the same as
using the Dependencies: manifest attribute -->
<dependencies>
<module name="com.company.app.config" optional="TRUE"/>
<module name="deployment.module.nested.app"/>
</dependencies>
</deployment>
<module name="deployment.module.nested.app">
<resources>
<resource-root path="../contextroot.war"/>
</resources>
</module>
This is my jboss-web.xml
<!DOCTYPE jboss-web PUBLIC
"-//JBoss//DTD Web Application 4.2//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
<jboss-web>
<security-domain>UserModule</security-domain>
<security-domain>ServiceModule</security-domain>
</jboss-web>
This is my config in standalone-ha.xml for security subsystem
<security-domain name="UserModule" cache-type="default">
<authentication>
<login-module code="com.company.uas.service.authentication.loginmodule.UserLoginModule" flag="required"/>
</authentication>
</security-domain>
<security-domain name="ServiceModule" cache-type="default">
<authentication>
<login-module code="com.company.uas.service.authentication.loginmodule.ServiceLoginModule" flag="required"/>
</authentication>
</security-domain>
I have been working on it for couple of days now but could not find anything online related to this issue.
I am not sure if I consider this an answer but I understood why my /contextroot
was changing to /contextroot.war-345rdser34dwwe
. This was because, I was deploying a war file to JBoss and JBoss was pointing to the exploded version of my war file which was present in the tmp
folder for some reason.
I deployed an exploded version of my war file with the name contextroot.war
as the name of the folder and it worked.