In the file application.xml in the source code of the project the path to the web context is set, according to which the web application should respond:

<module> <web> <web-uri>myapp-web-1.0-SNAPSHOT.war</web-uri> <context-root>MA</context-root> </web> </module> 

and in the C: \ jboss-as-7.1.1.Final \ standalone \ deployments \ myapp-ear.ear \ META-INF directory in the application.xml file — another:

  <module> <web> <web-uri>myapp-web-1.0-SNAPSHOT.war</web-uri> <context-root>/myapp-web</context-root> </web> </module> 

And in the end it responds to the address / myapp-web, and I need / MA Where does it get this left application.xml? How to make him take the right one?

PS: Before the application.xml file itself was not there, it was added later. But clearing / updating the application did not help, - JBoss does not accept application.xml. And another colleague perceives.

  • Do you just collect Maven? What directory is application.xml ? What is in the *.ear in the target directory? - delphist007
  • Sorry for the late reply, there were circumstances. I collect in Eclipse (Build automatically). The application.xml file is in the \ myapp \ myapp-ear \ src \ main \ application \ META-INF directory. There is no .ear file in the target directory, but then — thanks for the hint — it was found: \ myapp \ myapp-ear \ target \ m2e -wtp \ ear-resources \ META-INF \ application.xml And there is the outdated automatically created application.xml, which was used (instead of being updated). - dmitry_iii 8:04
  • Here: \ myapp \ myapp-ear \ target \ m2e-wtp \ ear-resources \ META-INF \ application.xml I correct the file manually, insert the correct path to the web module there, but it is still replaced with the old one! Where does he get it from? If NOT from the source (everything is fine, the path is correct). - dmitry_iii

1 answer 1

It was necessary in ... \ myapp \ myapp-ear \ pom.xml to uncomment and edit:

  <modules> <webModule> <groupId>com.myapp.pkg</groupId> <artifactId>myapp-web</artifactId> <contextRoot>/MA</contextRoot> </webModule> </modules>