You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "winston antony (JIRA)" <de...@tuscany.apache.org> on 2010/08/24 13:54:16 UTC

[jira] Created: (TUSCANY-3658) SCA with JSF+Spring+Hibernate webapplication

SCA with JSF+Spring+Hibernate webapplication
--------------------------------------------

                 Key: TUSCANY-3658
                 URL: https://issues.apache.org/jira/browse/TUSCANY-3658
             Project: Tuscany
          Issue Type: Test
          Components: Java SCA Spring Implementation Extension
    Affects Versions: Java-SCA-2.0-M5
         Environment: WebApplication using JSF, Spring, Hibernate, Tuscany
            Reporter: winston antony


I am Implementing SCA in a Spring+JSF+Hibernate webapplication. I have done the below steps to expose the service layer of our aplication as SCA...But there is no help on how to access that SCA service in a controller layer which is nothing but a java class.  the application strucuture is DAO --> service (SCA)  --> Controller (Spring beans) -->....

1. Have written  a web.composite under web-inf directory
<component name="UserComponent">
        <implementation.spring location="/WEB-INF/applicationContext.xml"/>
        <service name="userServices">
            <interface.java interface="com.test.services.user.IUser"/>               
        </service>
    </component>

2.  In an applicationContext file
<bean id="userServiceImpl" class="com.test.services.user.impl.UserImpl">
    </bean>    
    <sca:service name="userServices"
        type="com.test.services.user.IUser" target="userServiceImpl"/> 
        
    <bean id="userController" class="com.test.controller.user.UserController">
    	<property name="userServices" ref="userServices" />
    </bean>  

But it is not able to find the userServices which is an SCA service. how can i access the sca services?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TUSCANY-3658) SCA with JSF+Spring+Hibernate webapplication

Posted by "winston antony (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12902522#action_12902522 ] 

winston antony commented on TUSCANY-3658:
-----------------------------------------

Thanks Raymond. That really works. I have a question that. If i write those 2 lines inside the init method, it is not getting the reference of sca service. But if i move the same code to some other method it is working.  so By the time init method is called, won't the SCADomain be available/loaded for the application? 

If i try to get the service in INIT method, It is throwing an error that 
'org.oasisopen.sca.NoSuchDomainException: default'
.......
Caused by: java.lang.IllegalArgumentException: Must specify remote IP address(es) for domain
........

xxxInterface  xxxSCAService = null;
@PostConstruct
public void init() {
System.out.println("init method is called..............................................");
SCAClientFactory factory = SCAClientFactory.newInstance(URI.create("default")); 
xxxSCAService = factory.getService(xxxInterface.class, "xxxComponent/xxxService");

}

> SCA with JSF+Spring+Hibernate webapplication
> --------------------------------------------
>
>                 Key: TUSCANY-3658
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-3658
>             Project: Tuscany
>          Issue Type: Test
>          Components: Java SCA Spring Implementation Extension
>    Affects Versions: Java-SCA-2.0-M5
>         Environment: WebApplication using JSF, Spring, Hibernate, Tuscany
>            Reporter: winston antony
>
> I am Implementing SCA in a Spring+JSF+Hibernate webapplication. I have done the below steps to expose the service layer of our aplication as SCA...But there is no help on how to access that SCA service in a controller layer which is nothing but a java class.  the application strucuture is DAO --> service (SCA)  --> Controller (Spring beans) -->....
> 1. Have written  a web.composite under web-inf directory
> <component name="UserComponent">
>         <implementation.spring location="/WEB-INF/applicationContext.xml"/>
>         <service name="userServices">
>             <interface.java interface="com.test.services.user.IUser"/>               
>         </service>
>     </component>
> 2.  In an applicationContext file
> <bean id="userServiceImpl" class="com.test.services.user.impl.UserImpl">
>     </bean>    
>     <sca:service name="userServices"
>         type="com.test.services.user.IUser" target="userServiceImpl"/> 
>         
>     <bean id="userController" class="com.test.controller.user.UserController">
>     	<property name="userServices" ref="userServices" />
>     </bean>  
> But it is not able to find the userServices which is an SCA service. how can i access the sca services?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TUSCANY-3658) SCA with JSF+Spring+Hibernate webapplication

Posted by "Raymond Feng (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-3658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12901963#action_12901963 ] 

Raymond Feng commented on TUSCANY-3658:
---------------------------------------

Based on your SCA composite and Spring XML, now you have an SCA service named "userServices" which represent the "userServiceImpl" Spring bean. If DAO is not an SCA component, you can use SCA client API to access the userServices, for example,

        SCAClientFactory factory = SCAClientFactory.newInstance(URI.create("default"));
        IUser user = factory.getService(IUser.class, "UserComponent/userServices");

The other way is to add a binding to the userServices so that it can be accessed via a protocol such as jsonrpc, REST/HTTP or WS.

> SCA with JSF+Spring+Hibernate webapplication
> --------------------------------------------
>
>                 Key: TUSCANY-3658
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-3658
>             Project: Tuscany
>          Issue Type: Test
>          Components: Java SCA Spring Implementation Extension
>    Affects Versions: Java-SCA-2.0-M5
>         Environment: WebApplication using JSF, Spring, Hibernate, Tuscany
>            Reporter: winston antony
>
> I am Implementing SCA in a Spring+JSF+Hibernate webapplication. I have done the below steps to expose the service layer of our aplication as SCA...But there is no help on how to access that SCA service in a controller layer which is nothing but a java class.  the application strucuture is DAO --> service (SCA)  --> Controller (Spring beans) -->....
> 1. Have written  a web.composite under web-inf directory
> <component name="UserComponent">
>         <implementation.spring location="/WEB-INF/applicationContext.xml"/>
>         <service name="userServices">
>             <interface.java interface="com.test.services.user.IUser"/>               
>         </service>
>     </component>
> 2.  In an applicationContext file
> <bean id="userServiceImpl" class="com.test.services.user.impl.UserImpl">
>     </bean>    
>     <sca:service name="userServices"
>         type="com.test.services.user.IUser" target="userServiceImpl"/> 
>         
>     <bean id="userController" class="com.test.controller.user.UserController">
>     	<property name="userServices" ref="userServices" />
>     </bean>  
> But it is not able to find the userServices which is an SCA service. how can i access the sca services?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.