hi,all.

Recently I use Tuscany for SCA projects.
but I have found some problem when using spring with Tuscany.
that is code snippet about use spring implementation in my composite
config file:
<component name="SpringServices" >
               <implementation.spring location="spring-sca.xml" />
               <service name="CfService" >
......
</component>

spring-sca.xml is in the same dir with composite config file at the
top of java package directory(source directory)

when I write standalone program to run this composite:
   SCADomain scaDomain = SCADomain.newInstance("scaservices.composite");

that every thing is ok, service define in composite config file startup OK.

but when I deploy this composite and spring config in web app(all file
in the {webapp}/WEB-INF/classes), there is error occurred:
Caused by: 
org.apache.tuscany.sca.contribution.service.ContributionReadException:Location
cannot be resloved: spring-sca.xml
I know it means program can not find the spring-sca.xml file.

I have spend so many time to  trace the code, and do some adjust,
Finally, I found those fact:
1.all config file except *.composite file that must use the relative
path begin from WebRoot path like "WEB-INF/classes/spring-sca.xml",
and when "spring-sca.xml" include some hibernate "*.hbm.xml" config
file that must be config use some format
"WEB-INF/classes/com.xxx.hbm/*.hbm.xml".

so i have some confuse, why not use classes dir as top dir to load
config file or direct use the relative path from the reference's
config file,like:
when xxx.composite include a implementation.spring that location =
"aaaa.xml", it can use the xxx.composite's path as the aaaa.xml's
reference path, just think there are in some directory?

or maybe i have missing some config work?
or is there have some right method to resolve those confuse?

sorry for my pool english.

Thks for reading this mail, and wish anyone can reply me, thks.

Reply via email to