简体   繁体   中英

JBoss eap 6.4 cli name deployment

I am attempting to deploy a war file in Jboss eap 6.4 and I want to use the --name argument with the deploy. However, when I do so the war gets deployed but is inaccessible via the name..

The war file is named testweb.war. It works perfectly fine when I deploy it without the --name argument during the deploy command, but I am creating a deploy script where customers need to be able to name the application as well...

Here is the web.xml in my war file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN"
    "http://www.jboss.org/j2ee/dtd/jboss-web_3_0.dtd">
<jboss-web>
     <context-root></context-root>
</jboss-web>

The command I'm using with the jboss-cli is:

deploy /path/to/war/testweb.war --name=testweb

And the web application is inaccessible via the url:

localhost:8085/testweb

This is the correct port number, and should be the correct application name..

Thank you in advance.

Well, I figured it out today in case anyone out there was also asking this very obscure question haha..

The issue is with the runtime-name of the deployed war. In Jboss the runtime name must end with the extension of the file being deployed.. So if you deploy example.war the runtime name must end with .war

When you specify a name without specifying the runtime name you get a problem, because by default jboss will use the application name as the runtime name.

So when I did: deploy /path/to/war/testweb.war --name=testweb It was subsequently using testweb as the runtime name, and therefore wouldn't work properly.

/path/to/war/testweb.war --name=testweb --runtime-name=testweb.war is a way to fix this issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM