简体   繁体   English

如何使用jboss-cli添加外部资源目录?

[英]How to add an external resources directory with jboss-cli?

I would like to add ${jboss.server.temp.dir}/foo_server/images_svg directory as external resources directory. 我想将${jboss.server.temp.dir}/foo_server/images_svg目录添加为外部资源目录。

For this I need to add the following line code into /subsystem/handlers 为此,我需要将以下行代码添加到/subsystem/handlers

<location name="/images_svg" handler="images"/>

And into /subsystem/server name="default-server"/host name="default-host" 并放入/subsystem/server name="default-server"/host name="default-host"

<file name="images" path="${jboss.server.temp.dir}/foos_server/images_svg" directory-listing="true"/>

I expect something like this: 我期望这样的事情:

<subsystem xmlns="urn:jboss:domain:undertow:2.0">
            <buffer-cache name="default"/>
            <server name="default-server">
                <http-listener name="default" socket-binding="http" redirect-socket="https"/>
                <host name="default-host" alias="localhost">
                    <location name="/images_svg" handler="images"/>
                    <filter-ref name="server-header"/>
                    <filter-ref name="x-powered-by-header"/>
                </host>
            </server>
            <servlet-container name="default">
                <jsp-config/>
                <websockets/>
            </servlet-container>
            <handlers>
                <file name="images" path="${jboss.server.temp.dir}/foo_server/images_svg" directory-listing="true"/>
            </handlers>
            <filters>
                <response-header name="server-header" header-name="Server" header-value="WildFly/9"/>
                <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
            </filters>
    </subsystem>

How to do it from jboss-cli command line ? 如何从jboss-cli命令行执行此操作?

I tried: 我试过了:

/subsystem=undertow/server=default-server/host=default-host/location="/images_svg":write-attribute(name="handler",value="images")
{
    "outcome" => "failed",
    "failure-description" => "WFLYCTL0216: Management resource '[
    (\"subsystem\" => \"undertow\"),
    (\"server\" => \"default-server\"),
    (\"host\" => \"default-host\"),
    (\"location\" => \"/images_svg\")
]' not found",
    "rolled-back" => true
}

And

/subsystem=undertow/server=default-server/host=default-host/location="/images_svg":add(handler="images")
16:02:43,851 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 27) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "undertow"),
    ("server" => "default-server"),
    ("host" => "default-host"),
    ("location" => "/images_svg")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.undertow.server.default-server.default-host.location./images_svg is missing [jboss.undertow.handler.images]"]}
{
    "outcome" => "failed",
    "failure-description" => {"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.undertow.server.default-server.default-host.location./images_svg is missing [jboss.undertow.handler.images]"]},
    "rolled-back" => true
}

regards 问候

Try the following 尝试以下

Handler images : 处理程序images

/subsystem=undertow/configuration=handler/file=images:add(path="${jboss.server.temp.dir}/images_svg", directory-listing="true")

Location /images_svg 位置/images_svg

/subsystem=undertow/server=default-server/host=default-host/location="/images_svg":add(handler="images")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用jboss-cli添加keycloak子系统以保护WAR - How to add keycloak subsystem to secure WARs using jboss-cli jboss-cli:如何使用 jboss-cli 读取一个特定的系统属性? - jboss-cli : How do I read one specific system property using jboss-cli? 怎么加“.” 作为使用 jboss-cli 的模块的资源根目录? - How can you add “.” as a resource-root to a module using jboss-cli? 如何使用jboss-cli向事务子系统添加属性“节点标识符”? - How to add an attribute 'node-identifier' to transactions subsystem using jboss-cli? JBOSS-CLI如何为as.weld更改或添加插槽到模块依赖项? - JBOSS-CLI How to change or add a slot to a module dependency for as.weld? 只启动一次 jboss-cli - Start jboss-cli only once Jboss 7中的“ jboss-admin”和“ jboss-cli”有什么区别 - What is the difference between “jboss-admin” and “jboss-cli” in Jboss 7 Jboss-cli:尝试添加数据源时,JBAS014653(“预期为[OBJECT],但已列出”) - Jboss-cli: JBAS014653 (“Expected [OBJECT] but was LIST”) when trying to add datasource jboss-cli 没有完整的 jboss/EAP 安装 - jboss-cli without full jboss/EAP installation JBOSS-AS-MAVEN-PLUGIN: - 身份验证失败但是Jboss-cli身份验证? - JBOSS-AS-MAVEN-PLUGIN :- Authentication Fails BUT Jboss-cli authentications?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM