You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Gopi Lokavarapu <go...@gmail.com> on 2014/02/06 10:47:21 UTC

Could please help me how to resolve while exposing apache tuscany implementation.spring as rest full services how to use hibernate with spring and following scenario

could you please help me for the following scenario.
here is my composite file
`apache-tuscany.composite

    <composite xmlns="">
`<component name="CalculatorComponent">
`<implementation.spring location="spring-sca.context"/>
`<service name="calculatorService">
`<tuscany:binding.rest uri="CalculatorComponent/calculatorService/calc"/>
`</service>
`</component>
`<component name="AccountComponent">
`<implementation.spring location="spring-sca.context"/>
`<service name="AccountService">
`<tuscany:binding.rest uri="AccountComponent/AccountService/accounts"/>
`</service>
`</component>
`

`here is my spring configuration file
`spring-sca.context
`<beans xmlns="...."
`<bean id="sessionFactory"
`class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
`<property name="dataSource" ref="dataSource"></property>
`<property name="packagesToScan" value="org.entity></property>
`</bean>
`<sca:service name="AccountService" target="accountBean"
type="org.AccountService"/>
`<bean id="accountBean" class="org.AccountServiceImpl"/>
`<sca:service name="calculatorService" target="calcBean"
type="org.CalculatorService"/>
`<bean id="calcBean" class="org.CalculatorServiceImpl"/>
`</beans>
`</composite>

    My problem was on server start up,web server loading composite file and
as well as spring configuration file.Then it is looking Calcurator service
in spring configuration file,loading the CalculatorService and
sessionfactory,after that it looking for Account service then it was
loading both calculatorservice,sessionfactory along with Accountservice
.Please help me how to solve this issue.thanks in advance