<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Extending web application's classpath
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/ahr">Adrie de Heer</a> in <i>Beginner's Corner</i> - <a href="http://community.jboss.org/message/605420#605420">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p class="moz-text-html" lang="x-western"><span style="font-family: Luxi Sans;">Hi all,<br/>&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160; When trying to migrate our web application which currently runs on&#160;&#160;&#160;&#160;&#160; Apache Geronimo to JBoss 6.0.0.Final I came across the following.<br/>&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160; Is there a way to add a custom directory to the web application's&#160;&#160;&#160;&#160;&#160; classpath without changing the server configuration manually. In&#160;&#160;&#160;&#160;&#160; our situation we have multiple web applications deployed to one&#160;&#160;&#160;&#160;&#160; server each having their own properties file and other&#160;&#160;&#160;&#160;&#160; configuration stuff </span><span style="font-family: Luxi Sans;">(for some&#160;&#160;&#160;&#160;&#160; reason this data is put outside the ear)</span><span style="font-family: Luxi Sans;">. In the application I want to read these files in an&#160;&#160;&#160;&#160;&#160; application independent manner, i.e. without the need to know the&#160;&#160;&#160;&#160;&#160; webapp's name. On Geronimo we use the 'classesDirs' property of&#160;&#160;&#160;&#160;&#160; the SharedLib gbean in geronimo-application.xml to extend the&#160;&#160;&#160;&#160;&#160; application's classpath with the specific webapp's configuration&#160;&#160;&#160;&#160;&#160; directory.<br/>&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160; On JBoss I was thinking about the following configuration. Let's&#160;&#160;&#160;&#160;&#160; say I have webapp1 and webapp2 each using a separate&#160;&#160;&#160;&#160;&#160; config.properties file. I can put these files e.g. in the JBoss&#160;&#160;&#160;&#160;&#160; conf directory as follows:<br/>&#160;&#160;&#160; </span><span style="font-family: Luxi Sans;">$JBOSS_HOME/server/&lt;server-name&gt;/conf</span>/webapp1/config.properties<br/>&#160;&#160;&#160; <span style="font-family: Luxi Sans;">$JBOSS_HOME/server/&lt;server-name&gt;/conf</span>/webapp2/config.properties<br/>&#160;&#160;&#160; <span style="font-family: Luxi Sans;">If I could add the </span> <span style="font-family: Luxi Sans;">$JBOSS_HOME/server/&lt;server-name&gt;/conf</span>/&lt;webapp&gt;&#160;&#160;&#160; directory to the application's classpath the properties file can be&#160;&#160;&#160; read by calling getResourceAsStream("/config.properties").<br/>&#160;&#160;&#160; <span style="font-family: Luxi Sans;">Is there a proper way to achieve this?<br/>&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160; I know the $JBOSS_HOME/server/&lt;server-name&gt;/conf directory&#160;&#160;&#160;&#160;&#160; is on the classpath by default so I can read the properties using&#160;&#160;&#160; </span>getResourceAsStream("/&lt;webapp&gt;/config.properties") but&#160;&#160;&#160; that's not what I want.<span style="font-family: Luxi Sans;"><br/>&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160; Thanks in advance.<br/>&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160; Regards,<br/>&#160;&#160;&#160;&#160;&#160; Adrie</span></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/605420#605420">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>