Adding second conf folder to JBoss 5.1.0

ぃ、小莉子 提交于 2019-12-08 03:34:48

问题


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>

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.

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").

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

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


回答1:


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.

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




回答2:


I disagree. We've been using custom classpath entries for years with no issues. We find it to be a very efficient way to swap out classpath configurations. I think your issue is that JBoss is expecting a URL. E.g.,

<classpath codebase="file:/home/me/myProject/myBranch/patches" archives="*"/>
<classpath codebase="file:/home/me/myProject/myBranch/lib" archives="*"/>
<classpath codebase="file:/home/me/myProject/myBranch/ext/" archives="*"/>
<classpath codebase="file:/home/me/myProject/myBranch/"/>


来源:https://stackoverflow.com/questions/4669190/adding-second-conf-folder-to-jboss-5-1-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!