Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JBoss - how set deployment runtime name (not using CLI, but directly from ear/war)

I'm facing this particular problem right now and I really don't know whether is it possible to achieve this somehow or not. But here's the situation:

We have this webapp(Java EE 6) which is organized into two modules. One is a Service module, and the other one is a Frontend module . The comunicate via remote ejb and they are deployed on different jboss servers(both EAP 6.2). (The modules just share the ejb interfaces(Service module implements them), and in the Frontend module, the actual service bean implementations are injected(@Inject) and instanced via remote JNDI locator and then remoting is used). This all works as expected.

But when we are deploying the application(using the jboss admin console) we have the app war name like this: app-service-1.0.war and during the uploading process, when jboss asks about the "name" and "runtinme name" we need to get rid of the "version" part so the runtime name would be like this app-service (name has to stay as it is, with the version number). But the problem is that this runtime name is always based on the deployment name, so we always need to delete the version part manually. I know it is possible to set the name via CLI but I would like to know if it's also possible to set is somewhere inside of the deployment(war/ear file), so that the admins don't need to alter the runtime name when using the web admin console. Thanks

like image 719
CoRTeXTeR Avatar asked Nov 01 '22 14:11

CoRTeXTeR


1 Answers

It definitely is possible, you just need to create file named jboss-web.xml in WEB-INF folder with following contents:

<?xml version="1.0" ?>
<jboss-web>
    <context-root>/app-service</context-root>
</jboss-web>

Package, deploy and your app should be accessible under /app-service.

For complete list of options see https://docs.jboss.org/jbossweb/7.0.x/appdev/jbossweb.html

like image 160
Mišo Stankay Avatar answered Dec 15 '22 03:12

Mišo Stankay