2

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?

Rich
  • 15,602
  • 15
  • 79
  • 126
  • The single `conf` folder is core to how JBoss works. Why isn't your application-specific config inside the application itself? – skaffman Jan 12 '11 at 13:17
  • Stick with it, it's the right thing to do. Messaging with the internals of JBoss, on the other hand, ain't. – skaffman Jan 14 '11 at 00:14
  • @skaffman: Thanks, if you want to add that as a proper answer then I can accept it :) – Rich Jan 14 '11 at 08:48

2 Answers2

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/"/>
user450731
  • 21
  • 3
-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.

skaffman
  • 398,947
  • 96
  • 818
  • 769