将第二个conf文件夹添加到JBoss 5.1.0 [英] Adding second conf folder to JBoss 5.1.0

查看:78
本文介绍了将第二个conf文件夹添加到JBoss 5.1.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们对JBoss 5.1.0进行了稍加修改,在其中,我们向类路径添加了一个名为< JBOSS_HOME> / myconf 的新文件夹。这是 conf / jboss-service.xml 的相关位:

We have a slightly modified JBoss 5.1.0 configuration, where we have added a new folder called <JBOSS_HOME>/myconf to the classpath. Here is the pertinent bit of conf/jboss-service.xml:

<server>
    <classpath codebase="${jboss.server.lib.url}" archives="*"/>
    <classpath codebase="${jboss.common.lib.url}" archives="*"/>
    <classpath codebase="myconf" archives="*"/>
    ...
</server>

这个想法是,特定于应用程序的配置文件可以放入< JBOSS_HOME> ; / myconf ,而JBoss特定的配置文件可以保留在< JBOSS_HOME> / conf 中。

The idea being that application-specific configuration files can go into <JBOSS_HOME>/myconf while JBoss-specific configuration files can remain in <JBOSS_HOME>/conf.

myconf 中,我有一个名为 myapp_log4j.xml 的文件,它是标准的Log4J配置文件。该文件由AOP拦截器使用 getResourceAsStream( / myapp_log4j.xml)加载。

In myconf I have a file called myapp_log4j.xml which is a standard Log4J configuration file. This file is loaded by an AOP interceptor using getResourceAsStream("/myapp_log4j.xml").

如果xml文件位于以下工作位置:

If the .xml file is in the following location it works:

<JBOSS_HOME>/myconf/conf/myapp_log4j.xml

尽管位于此位置,但不会:

though if it is in this location, it doesn't:

<JBOSS_HOME>/myconf/myapp_log4j.xml

为什么.xml文件需要放在conf子文件夹中,并且有什么方法可以更改/修复此问题?

Why does the .xml file need to be inside a conf subfolder, and is there any way we can change/fix this?

推荐答案

总结评论,尝试将应用程序特定的配置放入单独的 conf 样式的JBoss目录中注定会失败。

To summarise the comments, trying to put application-specific config into a separate conf-style JBoss directory is doomed to failure. JBoss isn't meant to bend that way.

应用程序特定的配置应该放在(a)应用程序内部(即EAR / WAR内部),或(b )完全不在JBoss之外。

App-specic config should go either (a) inside the application (i.e. inside the EAR/WAR), or (b) somewhere outside of JBoss entirely.

这篇关于将第二个conf文件夹添加到JBoss 5.1.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆