You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by kiwisurfer <uk...@yahoo.co.uk> on 2007/07/28 20:44:04 UTC
embedded resources in Service Units
Hi,
Is it possible to embed within a Service Unit, resources that the classes in
that service unit require, in particular xml config files?
I have a lw-container managed SU, that has a POJO in it. As part of this SU,
I have already successfully embedded jar files that it requires, and added
the classpath definitions for each, as described on
http://incubator.apache.org/servicemix/servicemix-jsr181.html.
However, in my servicemix.xml file I have defined a number of beans that use
DI. One of the property values being set is the name/path of a configuration
xml file. Eg.
<bean id="sqlMapClient"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="config/sqlmap-config.xml"/>
<property name="dataSource" ref="dataSource"/>
</bean>
I have added the "config/sqlmap-config.xml" file to the Service Unit , and
it has also been added to the SU classpath.
However, when I try to deploy it, ServiceMix raises a FileNotFoundException.
Any ideas as to why ServiceMix can't see the path to the sqlmap-config.xml
file?
Thanks.
--
View this message in context: http://www.nabble.com/embedded-resources-in-Service-Units-tf4163165s12049.html#a11845456
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: embedded resources in Service Units
Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,
Have you tried specifying the configLocation as
"classpath:config/sqlmap-config.xml"?
btw, with ServiceMix 3.1, some locations are automatically added to the
classpath without having to specify them in your xbean.xml file (cfr.
"New in ServiceMix 3.1" on
http://incubator.apache.org/servicemix/classloaders.html"
Gert
kiwisurfer wrote:
> Hi,
>
> Is it possible to embed within a Service Unit, resources that the classes in
> that service unit require, in particular xml config files?
>
> I have a lw-container managed SU, that has a POJO in it. As part of this SU,
> I have already successfully embedded jar files that it requires, and added
> the classpath definitions for each, as described on
> http://incubator.apache.org/servicemix/servicemix-jsr181.html.
>
> However, in my servicemix.xml file I have defined a number of beans that use
> DI. One of the property values being set is the name/path of a configuration
> xml file. Eg.
>
> <bean id="sqlMapClient"
> class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
> <property name="configLocation" value="config/sqlmap-config.xml"/>
> <property name="dataSource" ref="dataSource"/>
> </bean>
>
> I have added the "config/sqlmap-config.xml" file to the Service Unit , and
> it has also been added to the SU classpath.
>
> However, when I try to deploy it, ServiceMix raises a FileNotFoundException.
>
> Any ideas as to why ServiceMix can't see the path to the sqlmap-config.xml
> file?
>
> Thanks.
>
>
>