[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tuscany-user
Subject:    Re: Tuscany1.6 unable to create SCA binding invoker
From:       jiang jian <jiangjian2000 () gmail ! com>
Date:       2011-02-07 5:55:53
Message-ID: AANLkTi=GqfdP9JWi0OLK9tLjTPjegAiUA8zoSo6UfWNx () mail ! gmail ! com
[Download RAW message or body]

Oh, yeah! Just as you said, it should be wroten into <reference
name="roleManager" target="Permission/roleManager" />.
I only noticed that the code should specify the service name, like this:
scadomain.getService(cl, ComponentName + "/" + serviceName);
but I neglected it in the .composite file.
Thanks a lot.
jiangjian

2011/2/7 Simon Nash <nash@apache.org>

> jiangjian wrote:
> 
> > Hi.
> > I'm using Tuscany1.6 to develope several component. I always got the
> > error:
> > org.osoa.sca.ServiceUnavailableException: Unable to create SCA binding
> > invoker for local target User reference roleManager (bindingURI=Permission
> > operation=add)
> > at
> > org.apache.tuscany.sca.binding.sca.impl.RuntimeSCAReferenceBindingProvider.createInvoker(RuntimeSCAReferenceBindingProvider.java:215)
> >  at
> > org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.addReferenceBindingInterceptor(RuntimeWireImpl.java:329)
> >  at
> > org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChains(RuntimeWireImpl.java:208)
> >  at
> > org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains(RuntimeWireImpl.java:118)
> >  at
> > org.apache.tuscany.sca.core.assembly.EndpointWireImpl.getInvocationChains(EndpointWireImpl.java:120)
> >  at
> > org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.getInvocationChain(JDKInvocationHandler.java:298)
> >  at
> > org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:188)
> >  at $Proxy35.get(Unknown Source)
> > at
> > com.nodeservice.framework.adapter.user.permission.RoleManagerAdapter4User.getRoleListByUserId(RoleManagerAdapter4User.java:29)
> >  at
> > com.nodeservice.framework.users.service.UsersManagerImpl.getUserByUserNameandpwd(UsersManagerImpl.java:319)
> >  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >  at java.lang.reflect.Method.invoke(Method.java:597)
> > at
> > org.apache.tuscany.sca.implementation.spring.invocation.SpringInvoker.doInvoke(SpringInvoker.java:97)
> >  at
> > org.apache.tuscany.sca.implementation.spring.invocation.SpringInvoker.invoke(SpringInvoker.java:113)
> >  at
> > org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)
> >  at
> > org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:349)
> >  at
> > org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:193)
> >  at $Proxy32.getUserByUserNameandpwd(Unknown Source)
> > *Here is the .Composite file:*
> > All of the components in my projects implemented using spring.
> > *crucian-user.composite*  :
> > <component name="User">
> > <implementation.spring
> > location="META-INF/sca-deployables/applicationContext-user.xml"></implementation.spring>
> >  <service name="usersManager">
> > <interface.java
> > interface="com.nodeservice.framework.users.IUsersManager"/>
> > </service>
> > <reference name="sessionFactory" target="Model" />
> > <reference name="organizationManager" target="Organization" />
> > <reference name="roleManager" target="Permission" />
> > </component>
> > *crucian-permission.composite:*
> > <component name="Permission">
> > <implementation.spring
> > location="META-INF/sca-deployables/applicationContext-permission.xml"></implementation.spring>
> >  <service name="permissionManager">
> > <interface.java
> > interface="com.nodeservice.framework.permission.IPermissionManager"/>
> > </service>
> > <service name="resourceManager">
> > <interface.java
> > interface="com.nodeservice.framework.resource.IResourceManager"/>
> > </service>
> > <service name="roleManager">
> > <interface.java
> > interface="com.nodeservice.framework.role.IRoleManager"/>
> > </service>
> > </component>
> > I debuged the error and found the error is because the "service" is null
> > in RuntimeSCAReferenceBindingProvider.
> > RuntimeComponentService service =
> > (RuntimeComponentService)target.getContract();
> > if (*service != null*) { // not a callback wire
> > SCABinding scaBinding =
> > service.getBinding(SCABinding.class);
> > InvocationChain chain =
> > service.getInvocationChain(scaBinding,
> > wire.getSource().getInterfaceContract(), operation);
> > return chain == null ? null : new SCABindingInvoker(chain);
> > }
> > But I don't know how to correct it. Does anybody know why?
> > Thanks,
> > 2011-02-06
> > ------------------------------------------------------------------------
> > jiangjian
> > 
> > 
> The problem might be in this line:
> 
> <reference name="roleManager" target="Permission" />
> 
> You have given the Permission component as the target of the reference,
> but you haven't said which service in this component should be used.
> In this case, SCA will choose a default service if and only if there is
> exactly one service in this component with a compatible interface.
> 
> If the component doesn't have a service with a compatible interface, or
> if it has more than one service with a compatible interface, SCA won't
> be able to connect the reference to the service.
> 
> You can find out if this is the cause of the problem by adding the
> service name to the reference target.  For example, you can specify:
> <reference name="roleManager" target="Permission/roleManager" />
> if you want the roleManager service to be the target.
> 
> Simon
> 
> 


[Attachment #3 (text/html)]

Oh, yeah! Just as you said, it should be wroten into &lt;reference \
name=&quot;roleManager&quot; target=&quot;Permission/roleManager&quot; /&gt;.<br>I \
only noticed that the code should specify the service name, like this:<br> \
scadomain.getService(cl, ComponentName + &quot;/&quot; + serviceName);<br>but I \
neglected it in the .composite file.<br>Thanks a lot.<br>jiangjian<br><br><div \
class="gmail_quote">2011/2/7 Simon Nash <span dir="ltr">&lt;<a \
href="mailto:nash@apache.org">nash@apache.org</a>&gt;</span><br> <blockquote \
class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, \
204, 204); padding-left: 1ex;"><div><div></div><div class="h5">jiangjian wrote:<br> \
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px \
solid rgb(204, 204, 204); padding-left: 1ex;"> Hi.<br>
I&#39;m using Tuscany1.6 to develope several component. I always got the error:<br>
org.osoa.sca.ServiceUnavailableException: Unable to create SCA binding invoker for \
local target User reference roleManager (bindingURI=Permission operation=add)<br> at \
org.apache.tuscany.sca.binding.sca.impl.RuntimeSCAReferenceBindingProvider.createInvoker(RuntimeSCAReferenceBindingProvider.java:215)<br>
 at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.addReferenceBindingInterceptor(RuntimeWireImpl.java:329)<br>
 at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.initInvocationChains(RuntimeWireImpl.java:208)<br>
 at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.getInvocationChains(RuntimeWireImpl.java:118)<br>
 at org.apache.tuscany.sca.core.assembly.EndpointWireImpl.getInvocationChains(EndpointWireImpl.java:120)<br>
 at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.getInvocationChain(JDKInvocationHandler.java:298)<br>
 at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:188)<br>
 at $Proxy35.get(Unknown Source)<br>
at com.nodeservice.framework.adapter.user.permission.RoleManagerAdapter4User.getRoleListByUserId(RoleManagerAdapter4User.java:29)<br>
 at com.nodeservice.framework.users.service.UsersManagerImpl.getUserByUserNameandpwd(UsersManagerImpl.java:319)<br>
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
 at java.lang.reflect.Method.invoke(Method.java:597)<br>
at org.apache.tuscany.sca.implementation.spring.invocation.SpringInvoker.doInvoke(SpringInvoker.java:97)<br>
 at org.apache.tuscany.sca.implementation.spring.invocation.SpringInvoker.invoke(SpringInvoker.java:113)<br>
 at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61)<br>
 at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:349)<br>
 at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:193)<br>
 at $Proxy32.getUserByUserNameandpwd(Unknown Source)<br>
 *Here is the .Composite file:*<br>
All of the components in my projects implemented using spring. \
*crucian-user.composite*  :<br> &lt;component name=&quot;User&quot;&gt;<br>
&lt;implementation.spring \
location=&quot;META-INF/sca-deployables/applicationContext-user.xml&quot;&gt;&lt;/implementation.spring&gt;<br>
  &lt;service name=&quot;usersManager&quot;&gt;<br>
       &lt;interface.java \
interface=&quot;com.nodeservice.framework.users.IUsersManager&quot;/&gt;<br>  \
                &lt;/service&gt;<br>
        &lt;reference name=&quot;sessionFactory&quot; target=&quot;Model&quot; \
                /&gt;<br>
        &lt;reference name=&quot;organizationManager&quot; \
                target=&quot;Organization&quot; /&gt;<br>
        &lt;reference name=&quot;roleManager&quot; target=&quot;Permission&quot; \
/&gt;<br> &lt;/component&gt;<br>
*crucian-permission.composite:*<br>
&lt;component name=&quot;Permission&quot;&gt;<br>
&lt;implementation.spring \
location=&quot;META-INF/sca-deployables/applicationContext-permission.xml&quot;&gt;&lt;/implementation.spring&gt;<br>
  &lt;service name=&quot;permissionManager&quot;&gt;<br>
       &lt;interface.java \
interface=&quot;com.nodeservice.framework.permission.IPermissionManager&quot;/&gt;<br>
  &lt;/service&gt;<br>
        &lt;service name=&quot;resourceManager&quot;&gt;<br>
       &lt;interface.java \
interface=&quot;com.nodeservice.framework.resource.IResourceManager&quot;/&gt;<br>  \
&lt;/service&gt;<br>  &lt;service name=&quot;roleManager&quot;&gt;<br>
       &lt;interface.java \
interface=&quot;com.nodeservice.framework.role.IRoleManager&quot;/&gt;<br>  \
&lt;/service&gt;<br> &lt;/component&gt;<br>
I debuged the error and found the error is because the &quot;service&quot; is null in \
                RuntimeSCAReferenceBindingProvider.<br>
            RuntimeComponentService service = \
(RuntimeComponentService)target.getContract();<br>  if (*service != null*) { // not a \
                callback wire<br>
                SCABinding scaBinding = service.getBinding(SCABinding.class);<br>
                InvocationChain chain =<br>
                    service.getInvocationChain(scaBinding, \
                wire.getSource().getInterfaceContract(), operation);<br>
                return chain == null ? null : new SCABindingInvoker(chain);<br>
            }<br>
But I don&#39;t know how to correct it. Does anybody know why?<br>
Thanks,<br>
 2011-02-06<br>
------------------------------------------------------------------------<br>
jiangjian<br>
</blockquote>
&gt;<br></div></div>
The problem might be in this line:<div class="im"><br>
   &lt;reference name=&quot;roleManager&quot; target=&quot;Permission&quot; /&gt;<br>
<br></div>
You have given the Permission component as the target of the reference,<br>
but you haven&#39;t said which service in this component should be used.<br>
In this case, SCA will choose a default service if and only if there is<br>
exactly one service in this component with a compatible interface.<br>
<br>
If the component doesn&#39;t have a service with a compatible interface, or<br>
if it has more than one service with a compatible interface, SCA won&#39;t<br>
be able to connect the reference to the service.<br>
<br>
You can find out if this is the cause of the problem by adding the<br>
service name to the reference target.  For example, you can specify:<br>
   &lt;reference name=&quot;roleManager&quot; \
target=&quot;Permission/roleManager&quot; /&gt;<br> if you want the roleManager \
service to be the target.<br><font color="#888888"> <br>
  Simon<br>
<br>
</font></blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic