How to add external resources folder on JBoss7?

The next question is the JBossAS 7.1 Developer Guider:

Change the location of the ResourceBundle. In previous versions of AS, JBOSS_HOME / server // conf / was available in the classpath. Consequently, the properties files in this place were available in the classpath of the application.

In AS7, to get these properties available in the classpath, package them as part of your application. For example, if you deploy .war then package these properties in WAR WEB-INF / classes / folder. if you want these properties to be available for all components in .ear, then pack them in the root of some .jar and put this jar in the EAR lib / folder.

But this method is not very good, if there are too many resource files, we cannot pack all resource files in jar or ear.

For the method of loading a new class - module. I try the following method:

create the module.xml file .. you will select the module name ... for instnace custom.myconfig                   

<resources>
    <resource-root path="."/>
    <!-- Insert resources here -->
</resources>

<dependencies>     
</dependencies> </module>   In your jboss-deployment-structure.xml include this module to your app
<jboss-deployment-structure>
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
    <dependencies>
        <module name="custom.myconfig/>
    </dependencies>
    <resources>
    </resources>
</deployment>

<sub-deployment name="My_WAR.war">
    <dependencies>
        <module name="custom.myconfig" />
    </dependencies>
</sub-deployment>

https://community.jboss.org/message/723631

But I found that you cannot set the absolute path to the path, for example: [resource-root path = "C: \ resourcefolder"].

This means that you also need to include all resource files on JBossAS 7.

It is very simple on JBossAS 5.x-6.x, you just need to add the path to the folder, such as "C: \ resourcefolder" in the classpath, in order. But it looks like an impossible mission on JBossAS7.

+5
source share
1 answer

Finally, I set the soft link resource folder in JBossAS 7 .....

Linux:

In -s

Window:

MKLINK /D

or

Junction.exe
+2
source

All Articles