File path are always resolved using the current directory, and I'm not
aware of any solution to do what you want.  You should try to add a
<classpath /> tag in your service unit, put your file in this location
and use the classpath: scheme in your spring resource.

Classpath location elements are handled by the deployer and are
relative to your service unit, so everything should works.

Cheers,
Guillaume Nodet

On 4/11/06, Peter Klotz <[EMAIL PROTECTED]> wrote:
> Guillaume Nodet wrote:
> > Which component does your SU target ?
> >
> > If the component uses an xbean based deployer (servicemix-http, -jms,
> > -jsr181, -lwcontainer), the <classpath /> tag should work and be
> > relative to your SU.
>
> I'm using servicemix-lwcontainer and the properties of my Spring beans use the
> Spring Resource classes e.g. setBlub(Resource res).
>
> If I use e.g. a property like this
>
>   <property name="repositoryResource" 
> value="file:conf/repository/reqresp.xml"/>
>
> I get a exception that the file was not found, although it is part of the SU 
> zip
> in the relative path conf/repository/reqresp.xml
> If I though create
>
> ~/sandbox/servicemix-3.0-SNAPSHOT/conf/repository/reqresp.xml
>
> it works as expected.
>
> So it looks like the context takes the servicemix.home location as the basis.
> Sometimes that's even ok, but in other cases I would like really to access a
> SU-private file from the zip file. In this case files are then located in
>
> [EMAIL PROTECTED]:~/sandbox/servicemix-3.0-SNAPSHOT> ls
> wdir/service-assemblies/midas-doc/version_1/sus/servicemix-lwcontainer/midas-file/conf/repository/
> reqresp.xml  task.xml
>
> I also tried to leave the "file:" away with the same result. servicemix 
> examples
> always use classpath: but that is not really realistic for modifiable files at
> least.
>
>
> Thanks, Peter
>
>

Reply via email to