We have third party web based enterprise application, which is deployed on weblogic server and can be accessible using
http://hostname:port/myApp
But, due to some reason, we wanted to change context-root
for this application, so that it must be ONLY accessible using
http://hostname:port/newApp
So, to achieve this, we tried changing application.xml
<?xml version = '1.0' encoding = 'utf-8'?>
<application xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" version="1.4">
<display-name>myApp</display-name>
<module>
<web>
<web-uri>myApp.war</web-uri>
<context-root>newApp</context-root> // changed from myApp to newApp
</web>
</module>
</application>
But, while deploying this application on weblogic server, we are getting following error.
weblogic.management.DeploymentException: The application myApp contains a SubDeploymentMBean with a name myApp however there is no module in the application with that URI or context-root.
On the other hand, if we keep both context-root
as shown below application.xml
file, then it gets deployed successfully and also able to access application using both context-root.
<?xml version = '1.0' encoding = 'utf-8'?>
<application xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" version="1.4">
<display-name>myApp</display-name>
<module>
<web>
<web-uri>myApp.war</web-uri>
<context-root>newApp</context-root> // changed from myApp to newApp
</web>
</module>
<module>
<web>
<web-uri>myApp.war</web-uri>
<context-root>myApp</context-root>
</web>
</module>
</application>
Can anyone help me to resolve this issue ? Let me know, if additional information required.
==Edited==
I have added weblogic.xml
file, but not sure, what I suppose to change in this file as pointed by @Hououin Kyouma in his/her answer.
<?xml version = '1.0' encoding = 'US-ASCII'?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
<session-descriptor>
<cookie-path>/myApp</cookie-path>
</session-descriptor>
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>