Atul,

As you will be able to find in this URL [1], starting with version 3.1 the
root of your service unit is automatically added to your classpath.  If you
want to store your resources somewhere else (e.g. in a resources folder in
the SU archive), you should add the folder to the classpath.

With the resource being available on the classpath, you should be able to
use getClass().getResource() or .getResourceAsStream() to load it in your
code.

Regards,

Gert

[1] http://incubator.apache.org/servicemix/classloaders.html


Atul From Infosys wrote:
> 
> Hi All,
>  I need your suggestion or help in  order to understand how the resources
> gets referred in servicemix of Serviceunit when packaged as a zip. 
> I define a servicemix assembly which has two servicemix unit and each su
> has got its own set of resource files in organized dir structure. it is
> the configuration data and files for the components referred in servicemix
> file. 
> This assembly works perfectly ok when i keep the resources outside from
> the su zip, as probably it able to resolve the path of resources. 
> However, i want these files to be packaged along with their serviceunit in
> respective zip to make deployment easier. When i try packaging them by
> putting them in resource dir of serviceunit as suggested in documents, i
> can see them  getting included in the root dir of serviceunit. however, 
> after deploying su along with sa, during intialization of su, it throws an
> exception , saying FileNotFound kind of exception.
> I tried even putting entry as classpath location in respective servicemix.
> 
> Pls do let know how to refer resources in servicemix.xml after packaging
> them in su zip. 
> thanks in adv for any kind of help .
> 
> Regards,
> Atul
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Loading-resources-in-Assembly-tf3762111s12049.html#a10636418
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to