Issue with Project References in Java Web Application

49 Views Asked by At

My project structure is as follows:

matrixWeb
----src(for Java code)
----WebContent
    ----WEB-INF
        ----lib
            ----custome-develop.jar
    ----resources (contains some config files under this folder)

Now another java code (custome-develop.jar) is being used and this code is packaged as jar and put inside the lib folder with all the references. Now from my 'src' folder I am able to access code in that jar file. But that custome-develop.jar needs to access the config files to under resource folder to do processing (resource folder contains property files for queuemanager name, queuename etc.).

Could anybody tell me how to access the resource folder to get the property file.

I used below code but in that custome-develop.jar but did not worked:

InputStream pin = Thread.currentThread().getContextClassLoader()
                .getResourceAsStream("/../../resources/QueueDetails.properties);

this 'pin' is null object.

I am using JBoss 7.1 and Java6 and doing admin console deployment!

Please help me regarding this.

Thanks, Debashis

1

There are 1 best solutions below

1
On

Add your properties file in Jboss standalone.xml considering that you are using standalone application

<system-properties>
     <property name="URLLIST" value="path for properties file"/>
</system-properties>

Then you can able to access this properties by using

String prop = System.getProperty("PROPERTY_NAME_UNDER_UR_FILE");

See details